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:25:56 UTC

svn commit: r1499179 - in /lucene/dev/trunk/lucene/analysis/common/src: java/org/apache/lucene/analysis/hunspell/HunspellDictionary.java test/org/apache/lucene/analysis/hunspell/HunspellStemmerTest.java test/org/apache/lucene/analysis/hunspell/test.dic

Author: janhoy
Date: Wed Jul  3 02:25:56 2013
New Revision: 1499179

URL: http://svn.apache.org/r1499179
Log:
SOLR-4452: Fix test for case insensitive mode

Modified:
    lucene/dev/trunk/lucene/analysis/common/src/java/org/apache/lucene/analysis/hunspell/HunspellDictionary.java
    lucene/dev/trunk/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/HunspellStemmerTest.java
    lucene/dev/trunk/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/test.dic

Modified: lucene/dev/trunk/lucene/analysis/common/src/java/org/apache/lucene/analysis/hunspell/HunspellDictionary.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/analysis/common/src/java/org/apache/lucene/analysis/hunspell/HunspellDictionary.java?rev=1499179&r1=1499178&r2=1499179&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/analysis/common/src/java/org/apache/lucene/analysis/hunspell/HunspellDictionary.java (original)
+++ lucene/dev/trunk/lucene/analysis/common/src/java/org/apache/lucene/analysis/hunspell/HunspellDictionary.java Wed Jul  3 02:25:56 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/trunk/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/HunspellStemmerTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/HunspellStemmerTest.java?rev=1499179&r1=1499178&r2=1499179&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/HunspellStemmerTest.java (original)
+++ lucene/dev/trunk/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/HunspellStemmerTest.java Wed Jul  3 02:25:56 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/trunk/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/test.dic
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/test.dic?rev=1499179&r1=1499178&r2=1499179&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/test.dic (original)
+++ lucene/dev/trunk/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/test.dic Wed Jul  3 02:25:56 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