spaCy/tests/tokenizer/test_infix.py

19 lines
345 B
Python
Raw Normal View History

2014-10-14 13:26:16 +04:00
from __future__ import unicode_literals
import pytest
from spacy.en import English
2014-10-14 13:26:16 +04:00
EN = English()
2014-10-14 13:26:16 +04:00
def test_hyphen():
tokens = EN.tokenizer('best-known')
assert len(tokens) == 3
2014-10-14 13:26:16 +04:00
def test_period():
tokens = EN.tokenizer('best.Known')
2014-10-14 13:26:16 +04:00
assert len(tokens) == 3
tokens = EN.tokenizer('zombo.com')
2014-10-14 13:26:16 +04:00
assert len(tokens) == 1