You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ch...@apache.org on 2011/08/25 12:32:22 UTC

svn commit: r1161484 - in /lucene/dev/trunk/modules/analysis: CHANGES.txt common/src/java/org/apache/lucene/analysis/nl/DutchAnalyzer.java common/src/test/org/apache/lucene/analysis/nl/TestDutchStemmer.java

Author: chrism
Date: Thu Aug 25 10:32:21 2011
New Revision: 1161484

URL: http://svn.apache.org/viewvc?rev=1161484&view=rev
Log:
LUCENE-3400: Removed DutchAnalyzer.setStemDictionary

Modified:
    lucene/dev/trunk/modules/analysis/CHANGES.txt
    lucene/dev/trunk/modules/analysis/common/src/java/org/apache/lucene/analysis/nl/DutchAnalyzer.java
    lucene/dev/trunk/modules/analysis/common/src/test/org/apache/lucene/analysis/nl/TestDutchStemmer.java

Modified: lucene/dev/trunk/modules/analysis/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/modules/analysis/CHANGES.txt?rev=1161484&r1=1161483&r2=1161484&view=diff
==============================================================================
--- lucene/dev/trunk/modules/analysis/CHANGES.txt (original)
+++ lucene/dev/trunk/modules/analysis/CHANGES.txt Thu Aug 25 10:32:21 2011
@@ -31,6 +31,8 @@ API Changes
  * LUCENE-2514, LUCENE-2551: JDK and ICU CollationKeyAnalyzers were changed to
    use pure byte keys when Version >= 4.0. This cuts sort key size approximately
    in half. (Robert Muir)
+
+ * LUCENE-3400: Removed DutchAnalyzer.setStemDictionary (Chris Male)
    
 New Features
 

Modified: lucene/dev/trunk/modules/analysis/common/src/java/org/apache/lucene/analysis/nl/DutchAnalyzer.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/modules/analysis/common/src/java/org/apache/lucene/analysis/nl/DutchAnalyzer.java?rev=1161484&r1=1161483&r2=1161484&view=diff
==============================================================================
--- lucene/dev/trunk/modules/analysis/common/src/java/org/apache/lucene/analysis/nl/DutchAnalyzer.java (original)
+++ lucene/dev/trunk/modules/analysis/common/src/java/org/apache/lucene/analysis/nl/DutchAnalyzer.java Thu Aug 25 10:32:21 2011
@@ -105,7 +105,7 @@ public final class DutchAnalyzer extends
    */
   private Set<?> excltable = Collections.emptySet();
 
-  private Map<String, String> stemdict = new HashMap<String, String>();
+  private final Map<String, String> stemdict = new HashMap<String, String>();
   private final Version matchVersion;
 
   /**
@@ -130,23 +130,7 @@ public final class DutchAnalyzer extends
     excltable = CharArraySet.unmodifiableSet(CharArraySet.copy(matchVersion, stemExclusionTable));
     this.matchVersion = matchVersion;
   }
-
-  /**
-   * Reads a stemdictionary file , that overrules the stemming algorithm
-   * This is a textfile that contains per line
-   * <tt>word<b>\t</b>stem</tt>, i.e: two tab seperated words
-   */
-  public void setStemDictionary(File stemdictFile) {
-    try {
-      stemdict = WordlistLoader.getStemDict(stemdictFile);
-      setPreviousTokenStream(null); // force a new stemmer to be created
-    } catch (IOException e) {
-      // TODO: throw IOException
-      throw new RuntimeException(e);
-    }
-  }
-
-
+  
   /**
    * Returns a (possibly reused) {@link TokenStream} which tokenizes all the 
    * text in the provided {@link Reader}.

Modified: lucene/dev/trunk/modules/analysis/common/src/test/org/apache/lucene/analysis/nl/TestDutchStemmer.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/modules/analysis/common/src/test/org/apache/lucene/analysis/nl/TestDutchStemmer.java?rev=1161484&r1=1161483&r2=1161484&view=diff
==============================================================================
--- lucene/dev/trunk/modules/analysis/common/src/test/org/apache/lucene/analysis/nl/TestDutchStemmer.java (original)
+++ lucene/dev/trunk/modules/analysis/common/src/test/org/apache/lucene/analysis/nl/TestDutchStemmer.java Thu Aug 25 10:32:21 2011
@@ -150,18 +150,6 @@ public class TestDutchStemmer extends Ba
 
   }
   
-  /* 
-   * Test that changes to the dictionary stemming table are applied immediately
-   * when using reusable token streams.
-   */
-  public void testStemDictionaryReuse() throws Exception {
-    DutchAnalyzer a = new DutchAnalyzer(TEST_VERSION_CURRENT);
-    checkOneTermReuse(a, "lichamelijk", "licham");
-    File customDictFile = getDataFile("customStemDict.txt");
-    a.setStemDictionary(customDictFile);
-    checkOneTermReuse(a, "lichamelijk", "somethingentirelydifferent");
-  }
-  
   /**
    * Prior to 3.1, this analyzer had no lowercase filter.
    * stopwords were case sensitive. Preserve this for back compat.