Adding upstream version 2.5.1.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
c71cb8b61d
commit
982828099e
783 changed files with 150650 additions and 0 deletions
46
analysis/lang/en/plural_stemmer_test.go
Normal file
46
analysis/lang/en/plural_stemmer_test.go
Normal file
|
@ -0,0 +1,46 @@
|
|||
package en
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestEnglishPluralStemmer(t *testing.T) {
|
||||
data := []struct {
|
||||
In, Out string
|
||||
}{
|
||||
{"dresses", "dress"},
|
||||
{"dress", "dress"},
|
||||
{"axes", "axe"},
|
||||
{"ad", "ad"},
|
||||
{"ads", "ad"},
|
||||
{"gas", "ga"},
|
||||
{"sass", "sass"},
|
||||
{"berries", "berry"},
|
||||
{"dresses", "dress"},
|
||||
{"spies", "spy"},
|
||||
{"shoes", "shoe"},
|
||||
{"headaches", "headache"},
|
||||
{"computer", "computer"},
|
||||
{"dressing", "dressing"},
|
||||
{"clothes", "clothe"},
|
||||
{"DRESSES", "dress"},
|
||||
{"frog", "frog"},
|
||||
{"dress", "dress"},
|
||||
{"runs", "run"},
|
||||
{"pies", "pie"},
|
||||
{"foxes", "fox"},
|
||||
{"axes", "axe"},
|
||||
{"foes", "fo"},
|
||||
{"dishes", "dish"},
|
||||
{"snitches", "snitch"},
|
||||
{"cliches", "cliche"},
|
||||
{"forests", "forest"},
|
||||
{"yes", "ye"},
|
||||
}
|
||||
|
||||
for _, datum := range data {
|
||||
stemmed := stem(datum.In)
|
||||
|
||||
if stemmed != datum.Out {
|
||||
t.Errorf("expected %v but got %v", datum.Out, stemmed)
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue