mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-27 01:34:30 +03:00
update test
This commit is contained in:
parent
81c52c8ff2
commit
e263b6c8fd
|
@ -131,29 +131,36 @@ def test_split_noun_coordination(noun_construction_case1,
|
|||
|
||||
#test 1: no modifier - it should return None from _split_doc
|
||||
case1_split = split_noun_coordination(noun_construction_case1)
|
||||
|
||||
assert case1_split == None
|
||||
|
||||
#test 2: modifier is at the beginning of the noun phrase
|
||||
case2_split = split_noun_coordination(noun_construction_case2)
|
||||
|
||||
assert len(case2_split) == 2
|
||||
assert isinstance(case2_split, list)
|
||||
assert all(isinstance(phrase, str) for phrase in case2_split)
|
||||
assert case2_split == ["red apples", "red oranges"]
|
||||
|
||||
|
||||
#test 3: modifier is at the end of the noun phrase
|
||||
case3_split = split_noun_coordination(noun_construction_case3)
|
||||
|
||||
assert len(case3_split) == 2
|
||||
assert isinstance(case3_split, list)
|
||||
assert all(isinstance(phrase, str) for phrase in case3_split)
|
||||
assert case3_split == ["juicy apples", "juicy oranges"]
|
||||
assert case3_split == ["juicy oranges", "juicy apples"]
|
||||
|
||||
#test 4: deal with compound nouns
|
||||
case4_split = split_noun_coordination(noun_construction_case4)
|
||||
|
||||
assert len(case4_split) == 2
|
||||
assert isinstance(case4_split, list)
|
||||
assert all(isinstance(phrase, str) for phrase in case4_split)
|
||||
assert case4_split == ["hot chicken wings", "hot soup"]
|
||||
|
||||
|
||||
#test 5: multiple modifiers
|
||||
case5_split = split_noun_coordination(noun_construction_case5)
|
||||
assert case5_split == None
|
||||
|
||||
pass #this should return none i think
|
Loading…
Reference in New Issue
Block a user