From 685a386106f1c4624c1dba1bc8c6ee25491e8b6e Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Mon, 13 Jan 2025 14:00:06 +0100 Subject: [PATCH] Reformat --- spacy/tests/lang/ca/test_text.py | 1 + spacy/tests/lang/ja/test_lemmatization.py | 8 +++++++- spacy/tests/lang/ja/test_tokenizer.py | 7 ++++++- spacy/tests/lang/ko/test_lemmatization.py | 9 ++++++++- spacy/tests/lang/pl/test_text.py | 1 + spacy/tests/training/test_pretraining.py | 2 +- 6 files changed, 24 insertions(+), 4 deletions(-) diff --git a/spacy/tests/lang/ca/test_text.py b/spacy/tests/lang/ca/test_text.py index 5db7af553..231cc085e 100644 --- a/spacy/tests/lang/ca/test_text.py +++ b/spacy/tests/lang/ca/test_text.py @@ -1,4 +1,5 @@ """Test that longer and mixed texts are tokenized correctly.""" + import pytest diff --git a/spacy/tests/lang/ja/test_lemmatization.py b/spacy/tests/lang/ja/test_lemmatization.py index 21879a569..523917f6d 100644 --- a/spacy/tests/lang/ja/test_lemmatization.py +++ b/spacy/tests/lang/ja/test_lemmatization.py @@ -3,7 +3,13 @@ import pytest @pytest.mark.parametrize( "word,lemma", - [("新しく", "新しい"), ("赤く", "赤い"), ("すごく", "すごい"), ("いただきました", "いただく"), ("なった", "なる")], + [ + ("新しく", "新しい"), + ("赤く", "赤い"), + ("すごく", "すごい"), + ("いただきました", "いただく"), + ("なった", "なる"), + ], ) def test_ja_lemmatizer_assigns(ja_tokenizer, word, lemma): test_lemma = ja_tokenizer(word)[0].lemma_ diff --git a/spacy/tests/lang/ja/test_tokenizer.py b/spacy/tests/lang/ja/test_tokenizer.py index a26347444..36f7e3240 100644 --- a/spacy/tests/lang/ja/test_tokenizer.py +++ b/spacy/tests/lang/ja/test_tokenizer.py @@ -143,7 +143,12 @@ def test_ja_tokenizer_sub_tokens( [ ( "取ってつけた", - (["五段-ラ行;連用形-促音便"], [], ["下一段-カ行;連用形-一般"], ["助動詞-タ;終止形-一般"]), + ( + ["五段-ラ行;連用形-促音便"], + [], + ["下一段-カ行;連用形-一般"], + ["助動詞-タ;終止形-一般"], + ), (["トッ"], ["テ"], ["ツケ"], ["タ"]), ), ("2=3", ([], [], []), (["ニ"], ["_"], ["サン"])), diff --git a/spacy/tests/lang/ko/test_lemmatization.py b/spacy/tests/lang/ko/test_lemmatization.py index 7782ca4bc..371e410a6 100644 --- a/spacy/tests/lang/ko/test_lemmatization.py +++ b/spacy/tests/lang/ko/test_lemmatization.py @@ -2,7 +2,14 @@ import pytest @pytest.mark.parametrize( - "word,lemma", [("새로운", "새롭"), ("빨간", "빨갛"), ("클수록", "크"), ("뭡니까", "뭣"), ("됐다", "되")] + "word,lemma", + [ + ("새로운", "새롭"), + ("빨간", "빨갛"), + ("클수록", "크"), + ("뭡니까", "뭣"), + ("됐다", "되"), + ], ) def test_ko_lemmatizer_assigns(ko_tokenizer, word, lemma): test_lemma = ko_tokenizer(word)[0].lemma_ diff --git a/spacy/tests/lang/pl/test_text.py b/spacy/tests/lang/pl/test_text.py index e8654a498..43e4ab862 100644 --- a/spacy/tests/lang/pl/test_text.py +++ b/spacy/tests/lang/pl/test_text.py @@ -1,4 +1,5 @@ """Words like numbers are recognized correctly.""" + import pytest diff --git a/spacy/tests/training/test_pretraining.py b/spacy/tests/training/test_pretraining.py index 22364bb78..41cbddcae 100644 --- a/spacy/tests/training/test_pretraining.py +++ b/spacy/tests/training/test_pretraining.py @@ -265,7 +265,7 @@ def test_pretraining_tagger(): # Try to debug segfault on windows -#def test_pretraining_training(): +# def test_pretraining_training(): # """Test that training can use a pretrained Tok2Vec model""" # config = Config().from_str(pretrain_string_internal) # nlp = util.load_model_from_config(config, auto_fill=True, validate=False)