lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ehatc...@apache.org
Subject svn commit: r799593 - in /lucene/solr/trunk: CHANGES.txt src/java/org/apache/solr/analysis/CapitalizationFilterFactory.java src/test/org/apache/solr/analysis/TestCapitalizationFilter.java
Date Fri, 31 Jul 2009 12:54:02 GMT
Author: ehatcher
Date: Fri Jul 31 12:54:02 2009
New Revision: 799593

URL: http://svn.apache.org/viewvc?rev=799593&view=rev
Log:
SOLR-1317: Fix CapitalizationFilterFactory to work when keep parameter is not specified

Modified:
    lucene/solr/trunk/CHANGES.txt
    lucene/solr/trunk/src/java/org/apache/solr/analysis/CapitalizationFilterFactory.java
    lucene/solr/trunk/src/test/org/apache/solr/analysis/TestCapitalizationFilter.java

Modified: lucene/solr/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/CHANGES.txt?rev=799593&r1=799592&r2=799593&view=diff
==============================================================================
--- lucene/solr/trunk/CHANGES.txt (original)
+++ lucene/solr/trunk/CHANGES.txt Fri Jul 31 12:54:02 2009
@@ -449,6 +449,9 @@
     SolrQueryParser considers special.
     (hossman)
 
+54. SOLR-1317: Fix CapitalizationFilterFactory to work when keep parameter is not specified.
+    (ehatcher)
+
 Other Changes
 ----------------------
  1. Upgraded to Lucene 2.4.0 (yonik)

Modified: lucene/solr/trunk/src/java/org/apache/solr/analysis/CapitalizationFilterFactory.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/java/org/apache/solr/analysis/CapitalizationFilterFactory.java?rev=799593&r1=799592&r2=799593&view=diff
==============================================================================
--- lucene/solr/trunk/src/java/org/apache/solr/analysis/CapitalizationFilterFactory.java (original)
+++ lucene/solr/trunk/src/java/org/apache/solr/analysis/CapitalizationFilterFactory.java Fri
Jul 31 12:54:02 2009
@@ -141,7 +141,7 @@
       return;
     }
 
-    if (keep.contains(buffer, offset, length)) {
+    if (keep != null && keep.contains(buffer, offset, length)) {
       if (wordCount == 0 && forceFirstLetter) {
         buffer[offset] = Character.toUpperCase(buffer[offset]);
       }

Modified: lucene/solr/trunk/src/test/org/apache/solr/analysis/TestCapitalizationFilter.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/test/org/apache/solr/analysis/TestCapitalizationFilter.java?rev=799593&r1=799592&r2=799593&view=diff
==============================================================================
--- lucene/solr/trunk/src/test/org/apache/solr/analysis/TestCapitalizationFilter.java (original)
+++ lucene/solr/trunk/src/test/org/apache/solr/analysis/TestCapitalizationFilter.java Fri
Jul 31 12:54:02 2009
@@ -17,6 +17,8 @@
 
 package org.apache.solr.analysis;
 
+import junit.framework.TestCase;
+
 import java.util.HashMap;
 import java.util.Map;
 
@@ -115,5 +117,10 @@
     termBuffer = "kiTTEN".toCharArray();
     factory.processWord(termBuffer, 0, termBuffer.length, 0 );
     assertEquals( "kiTTEN",  new String(termBuffer, 0, termBuffer.length));
+
+    factory.keep = null;
+    termBuffer = "kiTTEN".toCharArray();
+    factory.processWord(termBuffer, 0, termBuffer.length, 0 );
+    assertEquals( "Kitten",  new String(termBuffer, 0, termBuffer.length));
   }
 }



Mime
View raw message