barrust / pyspellchecker

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

Allowing the language to be passed a filepath #116

Closed mikemalinowski closed 8 months ago

mikemalinowski commented 2 years ago

Allowing the language to be passed a filepath to the language argument file directly - allowing the behaviour to be the same as using the tags such as 'en' etc but from different locations.

By allowing the argument to take in an absolute path, it gives the module flexibility to integrate into projects with rigid data structures, where the languages will be placed in alternative locations.

codecov-commenter commented 2 years ago

Codecov Report

Merging #116 (9ddbdce) into master (7b5f109) will decrease coverage by 0.31%. The diff coverage is 75.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #116      +/-   ##
==========================================
- Coverage   98.66%   98.34%   -0.32%     
==========================================
  Files           4        4              
  Lines         300      303       +3     
==========================================
+ Hits          296      298       +2     
- Misses          4        5       +1     
Impacted Files Coverage Δ
spellchecker/spellchecker.py 98.73% <75.00%> (-0.41%) :arrow_down:
barrust commented 2 years ago

Thank you for this patch. I am wondering, though, why would this be better than using the local_dictionary parameter?

from spellchecker import SpellChecker

spell = SpellChecker(language=None, local_dictionary=filepath)
barrust commented 8 months ago

closing