barrust / pyspellchecker

Pure Python Spell Checking http://pyspellchecker.readthedocs.io/en/latest/
MIT License
714 stars 164 forks source link

Tiny mistake in how to make a new dictionary #43

Closed grofte closed 5 years ago

grofte commented 5 years ago
from spellchecker import SpellChecker

spell = SpellChecker(language=None)  # turn off loading a built language dictionary

# if you have a dictionary...
spell.word_frequency.load_dictionary('./path-to-my-json-dictionary.json')

# or... if you have text
spell.word_frequency.load_text('./path-to-my-text-doc.txt')

# export it out for later use!
spell.export('my_custom_dictionary.gz', gzipped=True)

this should be

from spellchecker import SpellChecker

spell = SpellChecker(language=None)  # turn off loading a built language dictionary

# if you have a dictionary...
spell.word_frequency.load_dictionary('./path-to-my-json-dictionary.json')

# or... if you have text
spell.word_frequency.load_text_file('./path-to-my-text-doc.txt')

# export it out for later use!
spell.export('my_custom_dictionary.gz', gzipped=True)
barrust commented 5 years ago

Sorry, but I don't see the difference. perhaps it got changed when you edited the tittle?

steck commented 5 years ago

@barrust, I believe it's load_text_file instead of load_text

barrust commented 5 years ago

Yes! Great catch!

barrust commented 5 years ago

Resolved