* Add tests for canon_case

This commit is contained in:
Matthew Honnibal 2014-09-01 23:26:49 +02:00
parent 4c7b997df7
commit 786a4a86fe
1 changed files with 20 additions and 0 deletions

20
tests/test_canon_case.py Normal file
View File

@ -0,0 +1,20 @@
from __future__ import unicode_literals
import py.test
from spacy.orth import canon_case as cc
def test_nasa():
assert cc('Nasa', 0.0, 0, {'upper': 0.6, 'title': 0.3, 'lower': 0.1}, {}) == 'NASA'
def test_john():
assert cc('john', 0.0, 0, {'title': 0.6, 'upper': 0.3, 'lower': 0.1}, {}) == 'John'
def test_apple():
assert cc('apple', 0.0, 0, {'lower': 0.6, 'title': 0.3, 'upper': 0.1}, {}) == 'apple'
def test_tie():
assert cc('I', 0.0, 0, {'lower': 0.0, 'title': 0.0, 'upper': 0.0}, {}) == 'I'