From d165af26be7813b7982a071d387859503d7decbb Mon Sep 17 00:00:00 2001 From: Ines Montani Date: Thu, 15 Oct 2020 10:08:53 +0200 Subject: [PATCH] Auto-format [ci skip] --- spacy/lang/hi/lex_attrs.py | 7 ++++--- spacy/tests/conftest.py | 2 +- spacy/tests/lang/hi/test_lex_attrs.py | 6 ++++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/spacy/lang/hi/lex_attrs.py b/spacy/lang/hi/lex_attrs.py index 6ae9812d6..a18c2e513 100644 --- a/spacy/lang/hi/lex_attrs.py +++ b/spacy/lang/hi/lex_attrs.py @@ -74,7 +74,7 @@ _eleven_to_beyond = [ "बावन", "तिरपन", "तिरेपन", "चौवन", "चउवन", - "पचपन", + "पचपन", "छप्पन", "सतावन", "सत्तावन", "अठावन", @@ -91,7 +91,7 @@ _eleven_to_beyond = [ "उनहत्तर", "सत्तर", "इकहत्तर" - "बहत्तर", + "बहत्तर", "तिहत्तर", "चौहत्तर", "पचहत्तर", @@ -144,6 +144,7 @@ _ordinal_words_one_to_ten = [ _ordinal_suffix = "वाँ" # fmt: on + def norm(string): # normalise base exceptions, e.g. punctuation or currency symbols if string in BASE_NORMS: @@ -180,7 +181,7 @@ def like_num(text): if text in _ordinal_words_one_to_ten: return True if text.endswith(_ordinal_suffix): - if text[:-len(_ordinal_suffix)] in _eleven_to_beyond: + if text[: -len(_ordinal_suffix)] in _eleven_to_beyond: return True return False diff --git a/spacy/tests/conftest.py b/spacy/tests/conftest.py index 2d34cf0d5..3733d345d 100644 --- a/spacy/tests/conftest.py +++ b/spacy/tests/conftest.py @@ -297,7 +297,7 @@ def zh_tokenizer_pkuseg(): "segmenter": "pkuseg", } }, - "initialize": {"tokenizer": {"pkuseg_model": "web",}}, + "initialize": {"tokenizer": {"pkuseg_model": "web"}}, } nlp = get_lang_class("zh").from_config(config) nlp.initialize() diff --git a/spacy/tests/lang/hi/test_lex_attrs.py b/spacy/tests/lang/hi/test_lex_attrs.py index 187a23cb4..80a7cc1c4 100644 --- a/spacy/tests/lang/hi/test_lex_attrs.py +++ b/spacy/tests/lang/hi/test_lex_attrs.py @@ -28,14 +28,16 @@ def test_hi_norm(word, word_norm): @pytest.mark.parametrize( - "word", ["१९८७", "1987", "१२,२६७", "उन्नीस", "पाँच", "नवासी", "५/१०"], + "word", + ["१९८७", "1987", "१२,२६७", "उन्नीस", "पाँच", "नवासी", "५/१०"], ) def test_hi_like_num(word): assert like_num(word) @pytest.mark.parametrize( - "word", ["पहला", "तृतीय", "निन्यानवेवाँ", "उन्नीस", "तिहत्तरवाँ", "छत्तीसवाँ",], + "word", + ["पहला", "तृतीय", "निन्यानवेवाँ", "उन्नीस", "तिहत्तरवाँ", "छत्तीसवाँ"], ) def test_hi_like_num_ordinal_words(word): assert like_num(word)