mirror of
https://github.com/explosion/spaCy.git
synced 2025-08-03 20:00:21 +03:00
Correct test
This commit is contained in:
parent
c763c500d8
commit
c2c0a28ede
|
@ -208,13 +208,23 @@ def test_incomplete_data(lowercasing: bool):
|
|||
xp = lemmatizer.model.ops.xp
|
||||
|
||||
# Missing annotations.
|
||||
assert xp.count_nonzero(dX[0][0]) == 0
|
||||
assert xp.count_nonzero(dX[0][3]) == 0
|
||||
assert xp.count_nonzero(dX[1][0]) == 0
|
||||
assert xp.count_nonzero(dX[1][3]) == 0
|
||||
if lowercasing:
|
||||
assert xp.count_nonzero(dX[0][0][:-1]) == 0
|
||||
assert xp.count_nonzero(dX[0][3][:-1]) == 0
|
||||
assert xp.count_nonzero(dX[1][0][:-1]) == 0
|
||||
assert xp.count_nonzero(dX[1][3][:-1]) == 0
|
||||
|
||||
# Misaligned annotations.
|
||||
assert xp.count_nonzero(dX[1][1]) == 0
|
||||
# Misaligned annotations.
|
||||
assert xp.count_nonzero(dX[1][1][:-1]) == 0
|
||||
|
||||
else:
|
||||
assert xp.count_nonzero(dX[0][0]) == 0
|
||||
assert xp.count_nonzero(dX[0][3]) == 0
|
||||
assert xp.count_nonzero(dX[1][0]) == 0
|
||||
assert xp.count_nonzero(dX[1][3]) == 0
|
||||
|
||||
# Misaligned annotations.
|
||||
assert xp.count_nonzero(dX[1][1]) == 0
|
||||
|
||||
|
||||
@pytest.mark.parametrize("lowercasing", [True, False])
|
||||
|
|
Loading…
Reference in New Issue
Block a user