You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ja...@apache.org on 2013/07/03 04:27:27 UTC
svn commit: r1499180 - in /lucene/dev/branches/branch_4x: ./ lucene/
lucene/analysis/
lucene/analysis/common/src/java/org/apache/lucene/analysis/hunspell/
lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/
Author: janhoy
Date: Wed Jul 3 02:27:26 2013
New Revision: 1499180
URL: http://svn.apache.org/r1499180
Log:
SOLR-4452: Fix test for case insensitive mode
Modified:
lucene/dev/branches/branch_4x/ (props changed)
lucene/dev/branches/branch_4x/lucene/ (props changed)
lucene/dev/branches/branch_4x/lucene/analysis/ (props changed)
lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/hunspell/HunspellDictionary.java
lucene/dev/branches/branch_4x/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/HunspellStemmerTest.java
lucene/dev/branches/branch_4x/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/test.dic
Modified: lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/hunspell/HunspellDictionary.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/hunspell/HunspellDictionary.java?rev=1499180&r1=1499179&r2=1499180&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/hunspell/HunspellDictionary.java (original)
+++ lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/hunspell/HunspellDictionary.java Wed Jul 3 02:27:26 2013
@@ -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);
Modified: lucene/dev/branches/branch_4x/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/HunspellStemmerTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/HunspellStemmerTest.java?rev=1499180&r1=1499179&r2=1499180&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/HunspellStemmerTest.java (original)
+++ lucene/dev/branches/branch_4x/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/HunspellStemmerTest.java Wed Jul 3 02:27:26 2013
@@ -94,17 +94,21 @@ public class HunspellStemmerTest extends
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
Modified: lucene/dev/branches/branch_4x/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/test.dic
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/test.dic?rev=1499180&r1=1499179&r2=1499180&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/test.dic (original)
+++ lucene/dev/branches/branch_4x/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/test.dic Wed Jul 3 02:27:26 2013
@@ -1,9 +1,10 @@
-8
+9
lucen/A
lucene
mahout/A
olr/B
ab/C
Apach/A
+Foo/E
foo/D
-Foo/E
\ No newline at end of file
+Moo/E
\ No newline at end of file