예제 #1
0
 def generic_find(self, word):
     lemma_manager = Lemma(word)
     initial = lemma_manager.initial()
     prefix = lemma_manager.prefix()
     dsort = lemma_manager.lexical_sort()
     if not prefix in NgramFinder.cache:
         self.update_cache(initial, prefix)
     NgramFinder.call_num += 1
     NgramFinder.cache[prefix]["call_num"] = NgramFinder.call_num
     return NgramFinder.cache[prefix]["grams"].get(dsort, [])
예제 #2
0
파일: morphset.py 프로젝트: necrop/pylib3.2
 def _compose_sort_values(self):
     lemma_manager = Lemma(self.morphunits[0].form)
     self._lexical_sort = lemma_manager.lexical_sort()
     self._initial = lemma_manager.initial()
     self._prefix = lemma_manager.prefix()