Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

LUCENE-1693: Add AttributeSource ctors to Tokenizer

Uwe Schindler187ac2b4f35a
diff --git a/src/java/org/apache/lucene/analysis/Tokenizer.java b/src/java/org/apache/lucene/analysis/Tokenizer.java
index 5e4d9dbafed..d2082f68606 100644
--- a/src/java/org/apache/lucene/analysis/Tokenizer.java
+++ b/src/java/org/apache/lucene/analysis/Tokenizer.java
@@ -38,16 +38,34 @@ public abstract class Tokenizer extends TokenStream {
/** Construct a tokenizer with null input. */
protected Tokenizer() {}
-
+
/** Construct a token stream processing the given input. */
protected Tokenizer(Reader input) {
this.input = CharReader.get(input);
}
+ /** Construct a token stream processing the given input. */
protected Tokenizer(CharStream input) {
this.input = input;
}
+ /** Construct a tokenizer with null input using the given AttributeFactory. */
+ protected Tokenizer(AttributeFactory factory) {
+ super(factory);
+ }
+
+ /** Construct a token stream processing the given input using the given AttributeFactory. */
+ protected Tokenizer(AttributeFactory factory, Reader input) {
+ super(factory);
+ this.input = CharReader.get(input);
+ }
+
+ /** Construct a token stream processing the given input using the given AttributeFactory. */
+ protected Tokenizer(AttributeFactory factory, CharStream input) {
+ super(factory);
+ this.input = input;
+ }
+
/** By default, closes the input Reader. */
public void close() throws IOException {
input.close();