pyspellchecker icon indicating copy to clipboard operation
pyspellchecker copied to clipboard

Allowing the language to be passed a filepath

Open mikemalinowski opened this issue 3 years ago • 2 comments

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.

mikemalinowski avatar Feb 18 '22 16:02 mikemalinowski

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:

codecov-commenter avatar Feb 18 '22 19:02 codecov-commenter

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 avatar Feb 25 '22 22:02 barrust

closing

barrust avatar Dec 28 '23 01:12 barrust