SOLR-4452: Fix test for case insensitive mode

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1499179 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jan Høydahl 2013-07-03 02:25:56 +00:00
parent 756e541620
commit 7790f8e092
3 changed files with 15 additions and 10 deletions

View File

@ -378,10 +378,10 @@ public class HunspellDictionary {
wordForm = new HunspellWord(flagParsingStrategy.parseFlags(flagPart));
Arrays.sort(wordForm.getFlags());
entry = line.substring(0, flagSep);
}
if(ignoreCase) {
entry = entry.toLowerCase(Locale.ROOT);
}
}
List<HunspellWord> entries = new ArrayList<HunspellWord>();
entries.add(wordForm);

View File

@ -94,17 +94,21 @@ public class HunspellStemmerTest extends LuceneTestCase {
assertEquals(1, stems.size());
assertEquals("foo", stems.get(0).getStemString());
stems = stemmer.stem("food");
stems = stemmer.stem("mood");
assertEquals(1, stems.size());
assertEquals("foo", stems.get(0).getStemString());
assertEquals("moo", stems.get(0).getStemString());
stems = stemmer.stem("Foos");
assertEquals(1, stems.size());
assertEquals("foo", stems.get(0).getStemString());
// The "Foo" rule gets overridden by the "foo" rule, and we don't merge
stems = stemmer.stem("Food");
assertEquals(0, stems.size());
stems = stemmer.stem("Mood");
assertEquals(1, stems.size());
assertEquals("foo", stems.get(0).getStemString());
assertEquals("moo", stems.get(0).getStemString());
}
@Test

View File

@ -1,9 +1,10 @@
8
9
lucen/A
lucene
mahout/A
olr/B
ab/C
Apach/A
foo/D
Foo/E
foo/D
Moo/E