-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
31 additions
and
6 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |