示例#1
0
文件: test_single.py 项目: NLeSC/xtas
def test_stemmers():
    """Test morphy and snowball/Porter stemmers."""

    s_en = "The cats sat on the mats."
    out_en = "The cat sat on the mat .".split()     # "sat" is hard to stem...

    lemmata = morphy(s_en)
    assert_equal(lemmata, out_en)

    stems = stem_snowball(s_en, language='en')
    assert_equal(stems, out_en)

    stems = stem_snowball(s_en, language='porter')
    assert_equal(stems, out_en)
示例#2
0
def test_stemmers():
    """Test morphy and snowball/Porter stemmers."""

    s_en = "The cats sat on the mats."
    out_en = "The cat sat on the mat .".split()     # "sat" is hard to stem...

    lemmata = morphy(s_en)
    assert_equal(lemmata, out_en)

    stems = stem_snowball(s_en, language='en')
    assert_equal(stems, out_en)

    stems = stem_snowball(s_en, language='porter')
    assert_equal(stems, out_en)
示例#3
0
def test_morphy():
    s = "The cats sat on the mats."     # morphy doesn't catch sat
    lemmata = morphy(s)
    assert_equal(lemmata, "The cat sat on the mat .".split())