mirror of https://github.com/explosion/spaCy.git
Add test for English time exceptions ("1a.m." etc.)
This commit is contained in:
parent
ce9568af84
commit
c89e30d1a3
|
@ -18,3 +18,10 @@ def test_tokenizer_handles_exc_in_text(en_tokenizer):
|
||||||
tokens = en_tokenizer(text)
|
tokens = en_tokenizer(text)
|
||||||
assert len(tokens) == 6
|
assert len(tokens) == 6
|
||||||
assert tokens[3].text == "i.e."
|
assert tokens[3].text == "i.e."
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.parametrize('text', ["1am", "12a.m.", "11p.m.", "4pm"])
|
||||||
|
def test_tokenizer_handles_times(en_tokenizer, text):
|
||||||
|
tokens = en_tokenizer(text)
|
||||||
|
assert len(tokens) == 2
|
||||||
|
assert tokens[1].lemma_ in ["a.m.", "p.m."]
|
||||||
|
|
Loading…
Reference in New Issue