2014-07-07 02:23:46 +00:00
|
|
|
from __future__ import unicode_literals
|
|
|
|
|
|
|
|
from spacy.util import utf8open
|
|
|
|
|
|
|
|
import pytest
|
|
|
|
from os import path
|
|
|
|
|
|
|
|
|
|
|
|
HERE = path.dirname(__file__)
|
|
|
|
|
2014-07-07 03:11:04 +00:00
|
|
|
|
2014-07-07 02:23:46 +00:00
|
|
|
@pytest.fixture
|
|
|
|
def sun_txt():
|
2015-06-07 16:07:32 +00:00
|
|
|
loc = path.join(HERE, '..', 'sun.txt')
|
2014-07-07 02:23:46 +00:00
|
|
|
return utf8open(loc).read()
|
|
|
|
|
|
|
|
|
2015-06-07 16:07:32 +00:00
|
|
|
def test_tokenize(sun_txt, en_tokenizer):
|
2014-07-07 02:23:46 +00:00
|
|
|
assert len(sun_txt) != 0
|
2015-06-07 16:07:32 +00:00
|
|
|
tokens = en_tokenizer(sun_txt)
|
2015-06-07 16:02:24 +00:00
|
|
|
assert len(tokens) > 100
|