Package org.apache.lucene.analysis.core
Class WhitespaceAnalyzer
- java.lang.Object
-
- org.apache.lucene.analysis.Analyzer
-
- org.apache.lucene.analysis.core.WhitespaceAnalyzer
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
public final class WhitespaceAnalyzer extends Analyzer
An Analyzer that usesWhitespaceTokenizer
.- Since:
- 3.1
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.lucene.analysis.Analyzer
Analyzer.ReuseStrategy, Analyzer.TokenStreamComponents
-
-
Field Summary
Fields Modifier and Type Field Description private int
maxTokenLength
-
Fields inherited from class org.apache.lucene.analysis.Analyzer
GLOBAL_REUSE_STRATEGY, PER_FIELD_REUSE_STRATEGY
-
-
Constructor Summary
Constructors Constructor Description WhitespaceAnalyzer()
Creates a newWhitespaceAnalyzer
with a maximum token length of 255 charsWhitespaceAnalyzer(int maxTokenLength)
Creates a newWhitespaceAnalyzer
with a custom maximum token length
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Analyzer.TokenStreamComponents
createComponents(java.lang.String fieldName)
Creates a newAnalyzer.TokenStreamComponents
instance for this analyzer.-
Methods inherited from class org.apache.lucene.analysis.Analyzer
attributeFactory, close, getOffsetGap, getPositionIncrementGap, getReuseStrategy, getVersion, initReader, initReaderForNormalization, normalize, normalize, setVersion, tokenStream, tokenStream
-
-
-
-
Constructor Detail
-
WhitespaceAnalyzer
public WhitespaceAnalyzer()
Creates a newWhitespaceAnalyzer
with a maximum token length of 255 chars
-
WhitespaceAnalyzer
public WhitespaceAnalyzer(int maxTokenLength)
Creates a newWhitespaceAnalyzer
with a custom maximum token length- Parameters:
maxTokenLength
- the maximum token length the analyzer will emit
-
-
Method Detail
-
createComponents
protected Analyzer.TokenStreamComponents createComponents(java.lang.String fieldName)
Description copied from class:Analyzer
Creates a newAnalyzer.TokenStreamComponents
instance for this analyzer.- Specified by:
createComponents
in classAnalyzer
- Parameters:
fieldName
- the name of the fields content passed to theAnalyzer.TokenStreamComponents
sink as a reader- Returns:
- the
Analyzer.TokenStreamComponents
for this analyzer.
-
-