2014-10-14 09:26:16 +00:00
|
|
|
from __future__ import unicode_literals
|
|
|
|
|
|
|
|
import pytest
|
|
|
|
|
2015-06-07 15:24:49 +00:00
|
|
|
def test_hyphen(en_tokenizer):
|
|
|
|
tokens = en_tokenizer('best-known')
|
2015-06-06 03:57:36 +00:00
|
|
|
assert len(tokens) == 3
|
2014-10-14 09:26:16 +00:00
|
|
|
|
|
|
|
|
2015-06-07 15:24:49 +00:00
|
|
|
def test_period(en_tokenizer):
|
|
|
|
tokens = en_tokenizer('best.Known')
|
2014-10-14 09:26:16 +00:00
|
|
|
assert len(tokens) == 3
|
2015-06-07 15:24:49 +00:00
|
|
|
tokens = en_tokenizer('zombo.com')
|
2014-10-14 09:26:16 +00:00
|
|
|
assert len(tokens) == 1
|
2015-07-26 15:30:34 +00:00
|
|
|
|
|
|
|
|
|
|
|
def test_ellipsis(en_tokenizer):
|
|
|
|
tokens = en_tokenizer('best...Known')
|
|
|
|
assert len(tokens) == 3
|
|
|
|
tokens = en_tokenizer('best...known')
|
|
|
|
assert len(tokens) == 3
|
|
|
|
|
|
|
|
|
|
|
|
def test_email(en_tokenizer):
|
|
|
|
tokens = en_tokenizer('hello@example.com')
|
2015-07-26 15:32:55 +00:00
|
|
|
assert len(tokens) == 1
|
2015-07-26 15:30:34 +00:00
|
|
|
tokens = en_tokenizer('hi+there@gmail.it')
|
2015-07-26 15:32:55 +00:00
|
|
|
assert len(tokens) == 1
|
2015-07-26 15:30:34 +00:00
|
|
|
|
|
|
|
|