Esempio n. 1
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)
Esempio n. 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)
Esempio n. 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())