wolfgarbe / SymSpell

SymSpell: 1 million times faster spelling correction & fuzzy search through Symmetric Delete spelling correction algorithm
https://seekstorm.com/blog/1000x-spelling-correction/
MIT License
3.12k stars 284 forks source link

Error when loading french dictionary #101

Closed vection closed 3 years ago

vection commented 3 years ago

I get StopIteration error for loading french dictionary and using word_segmentation. I used this one. link sym_spell = SymSpell(max_dictionary_edit_distance=2, count_threshold=10, prefix_length=7) dictionary_path = pkg_resources.resource_filename( "symspellpy", "fr-100k.txt") sym_spell.load_dictionary(dictionary_path, term_index=0, count_index=1) sym_spell.word_segmentation('mama mia')

Error:

/symspellpy.py in word_segmentation(self, phrase, max_edit_distance, max_segmentation_word_length, ignore_token) 1091 top_ed), 1092 compositions[idx].log_prob_sum + top_log_prob) -> 1093 idx = next(circular_index) 1094 return compositions[idx] 1095 StopIteration:

wolfgarbe commented 3 years ago

If you are using the Python port of SymSpell please forward your issue to the author of the Python port repository: https://github.com/mammothb/symspellpy