org.apache.lucene.analysis
public abstract class Analyzer extends Object
Typical implementations first build a Tokenizer, which breaks the stream of characters from the Reader into raw Tokens. One or more TokenFilters may then be applied to the output of the Tokenizer.
WARNING: You must override one of the methods defined by this class in your subclass or the Analyzer will enter an infinite loop.
Method Summary | |
---|---|
int | getPositionIncrementGap(String fieldName)
Invoked before indexing a Field instance if
terms have already been added to that field. |
TokenStream | tokenStream(String fieldName, Reader reader) Creates a TokenStream which tokenizes all the text in the provided
Reader. |
TokenStream | tokenStream(Reader reader) Creates a TokenStream which tokenizes all the text in the provided
Reader. |
Parameters: fieldName Field name being indexed.
Returns: position increment gap, added to the next token emitted from {@link #tokenStream(String,Reader)}
Deprecated: use tokenStream(String, Reader) instead.
Creates a TokenStream which tokenizes all the text in the provided Reader. Provided for backward compatibility only.See Also: Analyzer