コード例 #1
0
def test_ngram_similarity_returns_score():
    test_string_1 = "University of California"
    score = ngram_similarity(test_string_1)
    eq_(float,type(score['score']))
コード例 #2
0
def test_ngram_similarity_returns_univ_name_berkeley():
    test_string_1 = "University of California Berkeley"
    score = ngram_similarity(test_string_1)
    eq_("university of california berkeley", str(score['univ']).strip().lower())
コード例 #3
0
def test_ngram_similarity_returns_univ_name_curry_college():
    test_string_1 = "Curry College"
    score = ngram_similarity(test_string_1)
    eq_("curry college", str(score['univ']).strip().lower())
コード例 #4
0
def test_ngram_similarity_returns_univ_similarity_score():
    test_string_1 = "University of California"
    score = ngram_similarity(test_string_1)
    eq_(0.57,int(score['score'] * 100) / 100.0)
コード例 #5
0
def test_ngram_similarity_returns_score_1():
    test_string_1 = "University of California Berkeley"
    score = ngram_similarity(test_string_1)
    eq_(0.5,int(score['score_used'] * 100) / 100.0)
コード例 #6
0
def test_ngram_similarity_returns_univ_name_curry_college():
    test_string_1 = "Curry College"
    score = ngram_similarity(test_string_1)
    eq_("curry college", str(score['univ']).strip().lower())
コード例 #7
0
def test_ngram_similarity_returns_univ_name_berkeley():
    test_string_1 = "University of California Berkeley"
    score = ngram_similarity(test_string_1)
    eq_("university of california berkeley",
        str(score['univ']).strip().lower())
コード例 #8
0
def test_ngram_similarity_returns_score_1():
    test_string_1 = "University of California Berkeley"
    score = ngram_similarity(test_string_1)
    eq_(0.5, int(score['score_used'] * 100) / 100.0)
コード例 #9
0
def test_ngram_similarity_returns_univ_similarity_score():
    test_string_1 = "University of California"
    score = ngram_similarity(test_string_1)
    eq_(0.57, int(score['score'] * 100) / 100.0)
コード例 #10
0
def test_ngram_similarity_returns_score():
    test_string_1 = "University of California"
    score = ngram_similarity(test_string_1)
    eq_(float, type(score['score']))