spaCy/tests/test_canon_case.py

21 lines
356 B
Python
Raw Normal View History

2014-09-02 01:26:49 +04:00
from __future__ import unicode_literals
import py.test
from spacy.orth import canon_case as cc
def test_nasa():
2014-10-29 15:19:38 +03:00
assert cc('Nasa', 0.6, 0.3, 0.1) == 'NASA'
2014-09-02 01:26:49 +04:00
def test_john():
2014-10-29 15:19:38 +03:00
assert cc('john', 0.3, 0.6, 0.1) == 'John'
2014-09-02 01:26:49 +04:00
def test_apple():
2014-10-29 15:19:38 +03:00
assert cc('apple', 0.1, 0.3, 0.6) == 'apple'
2014-09-02 01:26:49 +04:00
def test_tie():
2014-10-29 15:19:38 +03:00
assert cc('I', 0.0, 0.0, 0.0) == 'I'