Skip to content

Apache Lucene open-source search software

LUCENE-5302: Make StemmerOverrideMap's methods public

Alan Woodwardca248b584772
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<BytesRef> fst, boolean ignoreCase) {
+ public StemmerOverrideMap(FST<BytesRef> 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 <code>null</code> if the key is not in the FST dictionary.
*/
- BytesRef get(char[] buffer, int bufferLen, Arc<BytesRef> scratchArc, BytesReader fstReader) throws IOException {
+ public BytesRef get(char[] buffer, int bufferLen, Arc<BytesRef> scratchArc, BytesReader fstReader) throws IOException {
BytesRef pendingOutput = fst.outputs.getNoOutput();
BytesRef matchOutput = null;
int bufUpto = 0;