diff --git a/pyproject.toml b/pyproject.toml index 3ebb40c..9f7cfdd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,6 +3,7 @@ requires = ["setuptools>=58.0.4", "wheel"] build-backend = "setuptools.build_meta" [tool.basedpyright] +ignore = ["tests"] pythonVersion = "3.8" reportUnusedCallResult = "none" diff --git a/tests/fortests/below_threshold_dict.txt b/tests/fortests/below_threshold_dict.txt new file mode 100644 index 0000000..c2e74b4 --- /dev/null +++ b/tests/fortests/below_threshold_dict.txt @@ -0,0 +1,3 @@ +below 8 +threshold 10 +word 10 diff --git a/tests/test_symspellpy.py b/tests/test_symspellpy.py index b7c4cd7..08cf2f4 100644 --- a/tests/test_symspellpy.py +++ b/tests/test_symspellpy.py @@ -9,6 +9,7 @@ FORTESTS_DIR = Path(__file__).resolve().parent / "fortests" BAD_DICT_PATH = FORTESTS_DIR / "bad_dict.txt" +BELOW_THRESHOLD_DICT_PATH = FORTESTS_DIR / "below_threshold_dict.txt" BIG_MODIFIED_PATH = FORTESTS_DIR / "big_modified.txt" BIG_WORDS_PATH = FORTESTS_DIR / "big_words.txt" NON_EN_DICT_PATH = FORTESTS_DIR / "non_en_dict.txt" @@ -196,6 +197,15 @@ def test_load_dictionary_count(self, symspell_default, dictionary_path): assert 82834 == symspell_default.word_count assert 676094 == symspell_default.entry_count + @pytest.mark.parametrize("symspell_short", [10], indirect=True) + def test_load_dictionary_below_threshold(self, symspell_short): + symspell_short.load_dictionary(BELOW_THRESHOLD_DICT_PATH, 0, 1) + + assert 1 == len(symspell_short.below_threshold_words) + assert 8 == symspell_short.below_threshold_words["below"] + + assert 2 == symspell_short.word_count + def test_load_dictionary_separator(self, symspell_default): assert symspell_default.load_dictionary(SEPARATOR_DICT_PATH, 0, 1, SEPARATOR) assert 5 == symspell_default.word_count