mirror of https://github.com/explosion/spaCy.git
* Upd tests
This commit is contained in:
parent
c808cd50d9
commit
6d38c3cff0
|
@ -2,20 +2,21 @@ from __future__ import unicode_literals
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
# This approach is deprecated for now
|
||||||
@pytest.mark.models
|
#
|
||||||
def test_am_pm(en_nlp):
|
#@pytest.mark.models
|
||||||
numbers = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12']
|
#def test_am_pm(en_nlp):
|
||||||
variants = ['a.m.', 'am', 'p.m.', 'pm']
|
# numbers = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12']
|
||||||
spaces = ['', ' ']
|
# variants = ['a.m.', 'am', 'p.m.', 'pm']
|
||||||
for num in numbers:
|
# spaces = ['', ' ']
|
||||||
for var in variants:
|
# for num in numbers:
|
||||||
for space in spaces:
|
# for var in variants:
|
||||||
string = u"The meeting was at %s%s%s wasn't it?" % (num, space, var)
|
# for space in spaces:
|
||||||
tokens = en_nlp(string, merge_mwes=True)
|
# string = u"The meeting was at %s%s%s wasn't it?" % (num, space, var)
|
||||||
assert tokens[4].orth_ == '%s%s%s' % (num, space, var)
|
# tokens = en_nlp(string, merge_mwes=True)
|
||||||
ents = list(tokens.ents)
|
# assert tokens[4].orth_ == '%s%s%s' % (num, space, var)
|
||||||
assert len(ents) == 1, ents
|
# ents = list(tokens.ents)
|
||||||
assert ents[0].label_ == 'TIME', string
|
# assert len(ents) == 1, ents
|
||||||
if ents[0].start == 4 and ents[0].end == 5:
|
# assert ents[0].label_ == 'TIME', string
|
||||||
assert ents[0].orth_ == '%s%s%s' % (num, space, var)
|
# if ents[0].start == 4 and ents[0].end == 5:
|
||||||
|
# assert ents[0].orth_ == '%s%s%s' % (num, space, var)
|
||||||
|
|
Loading…
Reference in New Issue