Exemple #1
0
 def __init__(self, raw_string):
     self.string = raw_string
     if EASY_WORDS.get(self.string, None):
         self.stems = EASY_WORDS[self.string]
     else:
         self._prefixes = extract_prefixes(self.string)
         self._suffixes = extract_suffixes(self.string)
         self._prefixes_and_suffixes = [prefix_suffix
             for prefix_suffix in product(self._prefixes, self._suffixes)
             if self.is_valid_segment(prefix_suffix)
         ]
         self.update_stems()
Exemple #2
0
 def suffixes(self, word):
     return set([suffix.string for suffix in extract_suffixes(word)])