Skip to content

Commit

Permalink
update morphology test
Browse files Browse the repository at this point in the history
  • Loading branch information
asajatovic committed Jun 13, 2021
1 parent 77571eb commit e23bdc8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
15 changes: 15 additions & 0 deletions tests/languages/en/test_en_language.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,26 @@ def test_spacy_udpipe_default(lang: str) -> None:
assert [t.is_sent_start for t in doc] == [True, False, False, False, False, False, False, # noqa: E501
True, False, False, False, False]
assert any([t.is_stop for t in doc])
assert [str(t.morph) for t in doc] == [
'Number=Sing',
'NumType=Card',
'',
'NumType=Card',
'',
'NumType=Card',
'',
'Number=Sing|PronType=Dem',
'Mood=Ind|Number=Sing|Person=3|Tense=Pres|VerbForm=Fin',
'Definite=Ind|PronType=Art',
'Number=Sing',
''
]
# test doc attributes
assert len(list(doc.sents)) == 2
assert doc.has_annotation("TAG")
assert doc.has_annotation("DEP")
assert doc.has_annotation("SENT_START")
assert doc.has_annotation("MORPH")
# test pipe
docs = list(nlp.pipe(["Testing one, two, three.", "This is a test."]))
assert docs[0].text == "Testing one, two, three."
Expand Down
12 changes: 0 additions & 12 deletions tests/test_spacy_udpipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,3 @@ def test_pipe(lang: str) -> None:
assert len(docs) == len(texts)
assert docs[0].to_json() == doc.to_json()
assert docs[-1].to_json() == doc.to_json()


def test_ro_morph() -> None:
lang = "ro"
text = "Ce mai faci?"

download(lang=lang)

nlp = load(lang=lang)
doc = nlp(text)

assert doc.to_json()

0 comments on commit e23bdc8

Please sign in to comment.