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