Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

LUCENE-1804: allow Tokenizer to specify it's AttributeSource

Yonik Seeleyab2afad0d17e
diff --git a/src/java/org/apache/lucene/analysis/Tokenizer.java b/src/java/org/apache/lucene/analysis/Tokenizer.java
index d2082f68606..7e027281965 100644
--- a/src/java/org/apache/lucene/analysis/Tokenizer.java
+++ b/src/java/org/apache/lucene/analysis/Tokenizer.java
@@ -17,6 +17,8 @@ package org.apache.lucene.analysis;
* limitations under the License.
*/
+import org.apache.lucene.util.AttributeSource;
+
import java.io.Reader;
import java.io.IOException;
@@ -65,7 +67,12 @@ public abstract class Tokenizer extends TokenStream {
super(factory);
this.input = input;
}
-
+
+ /** Construct a token stream processing the given input using the given AttributeSource. */
+ protected Tokenizer(AttributeSource source) {
+ super(source);
+ }
+
/** By default, closes the input Reader. */
public void close() throws IOException {
input.close();