Skip to content

Commit

Permalink
maintenance: remove deprecated langdetect (#160)
Browse files Browse the repository at this point in the history
  • Loading branch information
adbar authored Nov 6, 2024
1 parent 94931a8 commit 91130df
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 24 deletions.
18 changes: 0 additions & 18 deletions simplemma/langdetect.py

This file was deleted.

8 changes: 2 additions & 6 deletions tests/test_language_detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import pytest

from simplemma import LanguageDetector, in_target_language, langdetect
from simplemma.langdetect import in_target_language as deprecated_itl
from simplemma.langdetect import lang_detector as deprecated_ld
from simplemma.strategies import DefaultStrategy

from .test_token_sampler import CustomTokenSampler
Expand Down Expand Up @@ -78,8 +76,7 @@ def test_proportion_in_each_language() -> None:
def test_in_target_language() -> None:
lang = "en"
text = ""
with pytest.raises(ValueError):
deprecated_itl(text, lang=lang)

assert (
LanguageDetector(lang=(lang,)).proportion_in_target_languages(text)
== in_target_language(text, lang=lang)
Expand Down Expand Up @@ -126,8 +123,7 @@ def test_in_target_language() -> None:
def test_main_language():
text = "Dieser Satz ist auf Deutsch."
lang = ("de", "en")
with pytest.raises(ValueError):
deprecated_ld(text, lang=lang)

assert (
LanguageDetector(
lang=lang, lemmatization_strategy=DefaultStrategy(greedy=False)
Expand Down

0 comments on commit 91130df

Please sign in to comment.