lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jan...@apache.org
Subject 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/
Date Wed, 03 Jul 2013 02:27:27 GMT
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



Mime
View raw message