Esempio n. 1
0
 def __init__(self, vocabulary: dict, docfreq: DocumentFrequencies,
              getter: callable):
     self._docfreq = docfreq
     self._uast2bag = UastIds2Bag(vocabulary)
     self._reverse_vocabulary = [None] * len(vocabulary)
     for key, val in vocabulary.items():
         self._reverse_vocabulary[val] = key
     self._getter = getter
Esempio n. 2
0
 def __init__(self,
              role: int = SIMPLE_IDENTIFIER,
              filter_set: set = None,
              *args,
              **kwargs):
     super().__init__(*args, **kwargs)
     self._uast2bag = UastIds2Bag(
         FilterVocabulary(filter_set) if filter_set else None)
     self.role = role
Esempio n. 3
0
 def __init__(self, vocabulary: dict, docfreq: DocumentFrequencies,
              getter: callable, token_parser=None, role=SIMPLE_IDENTIFIER):
     super().__init__(vocabulary, docfreq, getter)
     if token_parser is not None:
         self._uast2bag = UastIds2Bag(vocabulary, token_parser)
     self.role = role
Esempio n. 4
0
 def __init__(self, *args, **kwargs):
     super().__init__(*args, **kwargs)
     self._uast2bag = UastIds2Bag(None)