mirror of https://github.com/apache/lucene.git
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:
parent
756e541620
commit
7790f8e092
|
@ -378,11 +378,11 @@ 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);
|
||||
}
|
||||
}
|
||||
|
||||
if(ignoreCase) {
|
||||
entry = entry.toLowerCase(Locale.ROOT);
|
||||
}
|
||||
|
||||
List<HunspellWord> entries = new ArrayList<HunspellWord>();
|
||||
entries.add(wordForm);
|
||||
words.put(entry, entries);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
8
|
||||
9
|
||||
lucen/A
|
||||
lucene
|
||||
mahout/A
|
||||
olr/B
|
||||
ab/C
|
||||
Apach/A
|
||||
Foo/E
|
||||
foo/D
|
||||
Foo/E
|
||||
Moo/E
|
Loading…
Reference in New Issue