2014-10-14 09:26:16 +00:00
|
|
|
from __future__ import unicode_literals
|
|
|
|
|
|
|
|
import pytest
|
|
|
|
|
2014-12-23 00:40:32 +00:00
|
|
|
from spacy.en import English
|
2014-10-14 09:26:16 +00:00
|
|
|
|
2015-06-06 03:57:36 +00:00
|
|
|
EN = English()
|
2014-10-14 09:26:16 +00:00
|
|
|
|
2015-06-06 03:57:36 +00:00
|
|
|
def test_hyphen():
|
|
|
|
tokens = EN.tokenizer('best-known')
|
|
|
|
assert len(tokens) == 3
|
2014-10-14 09:26:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
def test_period():
|
2015-05-24 23:02:03 +00:00
|
|
|
tokens = EN.tokenizer('best.Known')
|
2014-10-14 09:26:16 +00:00
|
|
|
assert len(tokens) == 3
|
2015-06-06 03:57:36 +00:00
|
|
|
tokens = EN.tokenizer('zombo.com')
|
2014-10-14 09:26:16 +00:00
|
|
|
assert len(tokens) == 1
|