Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

maintenance: remove deprecated langdetect #160

Merged
merged 1 commit into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading