Skip to content

Commit

Permalink
Add tests for more stemmers
Browse files Browse the repository at this point in the history
  • Loading branch information
nijel committed Dec 29, 2018
1 parent b5c71f9 commit 2a2a5d0
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 6 deletions.
6 changes: 0 additions & 6 deletions tests/test_spanish.py

This file was deleted.

31 changes: 31 additions & 0 deletions tests/test_stem.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
from whoosh.lang.snowball.english import EnglishStemmer
from whoosh.lang.snowball.french import FrenchStemmer
from whoosh.lang.snowball.finnish import FinnishStemmer
from whoosh.lang.snowball.spanish import SpanishStemmer


def test_english():
s = EnglishStemmer()
assert s.stem("hello") == "hello"
assert s.stem("atlas") == "atlas"
assert s.stem("stars") == "star"


def test_french():
s = FrenchStemmer()
assert s.stem("adresse") == "adress"
assert s.stem("lettres") == "lettr"


def test_finnish():
s = FinnishStemmer()
assert s.stem("valitse") == "valits"
assert s.stem("koko") == "koko"
assert s.stem("erikoismerkit") == "erikoismerk"


def test_spanish_spell_suffix():
word = 'tgue'
s = SpanishStemmer()
w = s.stem(word)
assert w == "tgu"

0 comments on commit 2a2a5d0

Please sign in to comment.