From ca248b58477238ecec0678bd7bd1318810f27239 Mon Sep 17 00:00:00 2001 From: Alan Woodward Date: Tue, 29 Oct 2013 19:24:33 +0000 Subject: [PATCH] LUCENE-5302: Make StemmerOverrideMap's methods public git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1536858 13f79535-47bb-0310-9956-ffa450edef68 --- lucene/CHANGES.txt | 2 ++ .../miscellaneous/StemmerOverrideFilter.java | 14 +++++++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt index 7d23a654453..9576d52df4d 100644 --- a/lucene/CHANGES.txt +++ b/lucene/CHANGES.txt @@ -126,6 +126,8 @@ New Features * LUCENE-2844: The benchmark module can now test the spatial module. See spatial.alg (David Smiley, Liviy Ambrose) +* LUCENE-5302: Make StemmerOverrideMap's methods public (Alan Woodward) + Bug Fixes * LUCENE-4998: Fixed a few places to pass IOContext.READONCE instead diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/miscellaneous/StemmerOverrideFilter.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/miscellaneous/StemmerOverrideFilter.java index d6d8c3de185..2042c84d0a5 100644 --- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/miscellaneous/StemmerOverrideFilter.java +++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/miscellaneous/StemmerOverrideFilter.java @@ -17,9 +17,6 @@ package org.apache.lucene.analysis.miscellaneous; * limitations under the License. */ -import java.io.IOException; -import java.util.ArrayList; - import org.apache.lucene.analysis.TokenFilter; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; @@ -34,6 +31,9 @@ import org.apache.lucene.util.fst.FST; import org.apache.lucene.util.fst.FST.Arc; import org.apache.lucene.util.fst.FST.BytesReader; +import java.io.IOException; +import java.util.ArrayList; + /** * Provides the ability to override any {@link KeywordAttribute} aware stemmer * with custom dictionary-based stemming. @@ -100,15 +100,15 @@ public final class StemmerOverrideFilter extends TokenFilter { * @param fst the fst to lookup the overrides * @param ignoreCase if the keys case should be ingored */ - StemmerOverrideMap(FST fst, boolean ignoreCase) { + public StemmerOverrideMap(FST fst, boolean ignoreCase) { this.fst = fst; this.ignoreCase = ignoreCase; } /** - * Returns a {@link BytesReader} to pass to the {@link #get(char[], int, Arc, BytesReader)} method. + * Returns a {@link BytesReader} to pass to the {@link #get(char[], int, FST.Arc, FST.BytesReader)} method. */ - BytesReader getBytesReader() { + public BytesReader getBytesReader() { if (fst == null) { return null; } else { @@ -119,7 +119,7 @@ public final class StemmerOverrideFilter extends TokenFilter { /** * Returns the value mapped to the given key or null if the key is not in the FST dictionary. */ - BytesRef get(char[] buffer, int bufferLen, Arc scratchArc, BytesReader fstReader) throws IOException { + public BytesRef get(char[] buffer, int bufferLen, Arc scratchArc, BytesReader fstReader) throws IOException { BytesRef pendingOutput = fst.outputs.getNoOutput(); BytesRef matchOutput = null; int bufUpto = 0;