Skip to content

Commit

Permalink
Update a random test to reflect the latest models
Browse files Browse the repository at this point in the history
  • Loading branch information
AngledLuffa committed Dec 21, 2024
1 parent d50517f commit 449daeb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions stanza/tests/pipeline/test_decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<Token id=1;words=[<Word id=1;text=This;lemma=cool;upos=PRON;xpos=DT;feats=Number=Sing|PronType=Dem>]>
<Token id=2;words=[<Word id=2;text=is;lemma=cool;upos=AUX;xpos=VBZ;feats=Mood=Ind|Number=Sing|Person=3|Tense=Pres|VerbForm=Fin>]>
<Token id=3;words=[<Word id=3;text=another;lemma=cool;upos=DET;xpos=DT>]>
<Token id=3;words=[<Word id=3;text=another;lemma=cool;upos=DET;xpos=DT;feats=PronType=Ind>]>
<Token id=4;words=[<Word id=4;text=!;lemma=cool;upos=PUNCT;xpos=.>]>'''

@register_processor("lowercase")
Expand All @@ -72,7 +72,7 @@ def process(self, doc):
return doc

def test_register_processor():
nlp = stanza.Pipeline(dir=TEST_MODELS_DIR, lang='en', processors='tokenize,lowercase')
nlp = stanza.Pipeline(dir=TEST_MODELS_DIR, lang='en', processors='tokenize,lowercase', download_method=None)
doc = nlp(EN_DOC)
assert EN_DOC_LOWERCASE_TOKENS == '\n\n'.join(sent.tokens_string() for sent in doc.sentences)

Expand All @@ -94,7 +94,7 @@ def process(self, text):
return Document([sentence], text)

def test_register_processor_variant():
nlp = stanza.Pipeline(dir=TEST_MODELS_DIR, lang='en', processors={"tokenize": "lol"}, package=None)
nlp = stanza.Pipeline(dir=TEST_MODELS_DIR, lang='en', processors={"tokenize": "lol"}, package=None, download_method=None)
doc = nlp(EN_DOC)
assert EN_DOC_LOL_TOKENS == '\n\n'.join(sent.tokens_string() for sent in doc.sentences)

Expand All @@ -115,7 +115,7 @@ def process(self, document):
return document

def test_register_processor_variant_with_override():
nlp = stanza.Pipeline(dir=TEST_MODELS_DIR, lang='en', processors={"tokenize": "combined", "pos": "combined_nocharlm", "lemma": "cool"}, package=None)
nlp = stanza.Pipeline(dir=TEST_MODELS_DIR, lang='en', processors={"tokenize": "combined", "pos": "combined_nocharlm", "lemma": "cool"}, package=None, download_method=None)
doc = nlp(EN_DOC)
result = '\n\n'.join(sent.tokens_string() for sent in doc.sentences)
assert EN_DOC_COOL_LEMMAS == result
Expand Down

0 comments on commit 449daeb

Please sign in to comment.