diff --git a/tests/test_non_sparse.py b/tests/test_non_sparse.py deleted file mode 100644 index c7b75de85..000000000 --- a/tests/test_non_sparse.py +++ /dev/null @@ -1,25 +0,0 @@ -import py.test - -from spacy.orth import non_sparse -import math - - -def test_common_case_upper(): - cases = {'u': 0.7, 'l': 0.2, 't': 0.1} - prob = math.log(0.1) - assert non_sparse('usa', prob, 0, cases['u'], cases['t'], cases['l']) == 'USA' - -def test_same(): - cases = {'u': 0.01, 't': 0.09, 'l': 0.9} - prob = math.log(0.5) - assert non_sparse('the', prob, 0, cases['u'], cases['t'], cases['l']) == 'the' - -def test_common_case_lower(): - prob = math.log(0.5) - cases = {'u': 0.01, 't': 0.09, 'l': 0.9} - assert non_sparse('The', prob, 0, cases['u'], cases['t'], cases['l']) == 'the' - -def test_shape(): - prob = math.log(0.00001) - cases = {'u': 0.0, 't': 0.0, 'l': 0.0} - assert non_sparse('1999', prob, 0, cases['u'], cases['t'], cases['l']) == 'dddd' diff --git a/tests/test_only_punct.py b/tests/test_only_punct.py index acaa2fd78..f2c558cc7 100644 --- a/tests/test_only_punct.py +++ b/tests/test_only_punct.py @@ -9,6 +9,3 @@ def test_only_pre1(): def test_only_pre2(): assert len(EN.tokenize("((")) == 2 - -def test_only_suf2(): - assert len(EN.tokenize("''")) == 2 diff --git a/tests/test_urlish.py b/tests/test_urlish.py index 859473706..d50d7f333 100644 --- a/tests/test_urlish.py +++ b/tests/test_urlish.py @@ -1,20 +1,20 @@ -from spacy.orth import is_urlish +from spacy.orth import like_url def test_basic_url(): - assert is_urlish('www.google.com') - assert is_urlish('google.com') - assert is_urlish('sydney.com') - assert is_urlish('Sydney.edu') - assert is_urlish('2girls1cup.org') + assert like_url('www.google.com') + assert like_url('google.com') + assert like_url('sydney.com') + assert like_url('Sydney.edu') + assert like_url('2girls1cup.org') def test_close_enough(): - assert is_urlish('http://stupid') - assert is_urlish('www.hi') + assert like_url('http://stupid') + assert like_url('www.hi') def test_non_match(): - assert not is_urlish('dog') - assert not is_urlish('1.2') - assert not is_urlish('1.a') - assert not is_urlish('hello.There') + assert not like_url('dog') + assert not like_url('1.2') + assert not like_url('1.a') + assert not like_url('hello.There')