spaCy/tests/test_canon_case.py

21 lines
356 B
Python
Raw Normal View History

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