Skip to content

Apache Lucene open-source search software

LUCENE-3400: Removed DutchAnalyzer.setStemDictionary

Christopher John Male1057d24e7f9b
diff --git a/modules/analysis/CHANGES.txt b/modules/analysis/CHANGES.txt
index b7716d487cf..9c73965dbef 100644
--- a/modules/analysis/CHANGES.txt
+++ b/modules/analysis/CHANGES.txt
@@ -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
diff --git a/modules/analysis/common/src/java/org/apache/lucene/analysis/nl/DutchAnalyzer.java b/modules/analysis/common/src/java/org/apache/lucene/analysis/nl/DutchAnalyzer.java
index 5139f818cb3..fcf4d033b14 100644
--- a/modules/analysis/common/src/java/org/apache/lucene/analysis/nl/DutchAnalyzer.java
+++ b/modules/analysis/common/src/java/org/apache/lucene/analysis/nl/DutchAnalyzer.java
@@ -105,7 +105,7 @@ public final class DutchAnalyzer extends ReusableAnalyzerBase {
*/
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 ReusableAnalyzerBase {
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}.
diff --git a/modules/analysis/common/src/test/org/apache/lucene/analysis/nl/TestDutchStemmer.java b/modules/analysis/common/src/test/org/apache/lucene/analysis/nl/TestDutchStemmer.java
index 7477893cfd8..5bdaa3e8d3e 100644
--- a/modules/analysis/common/src/test/org/apache/lucene/analysis/nl/TestDutchStemmer.java
+++ b/modules/analysis/common/src/test/org/apache/lucene/analysis/nl/TestDutchStemmer.java
@@ -150,18 +150,6 @@ public class TestDutchStemmer extends BaseTokenStreamTestCase {
}
- /*
- * 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.