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:
Closeable,AutoCloseable
An Analyzer that uses
WhitespaceTokenizer.- Since:
- 3.1
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.lucene.analysis.Analyzer
Analyzer.ReuseStrategy, Analyzer.TokenStreamComponents -
Field Summary
FieldsFields inherited from class org.apache.lucene.analysis.Analyzer
GLOBAL_REUSE_STRATEGY, PER_FIELD_REUSE_STRATEGY -
Constructor Summary
ConstructorsConstructorDescriptionCreates a newWhitespaceAnalyzerwith a maximum token length of 255 charsWhitespaceAnalyzer(int maxTokenLength) Creates a newWhitespaceAnalyzerwith a custom maximum token length -
Method Summary
Modifier and TypeMethodDescriptionprotected Analyzer.TokenStreamComponentscreateComponents(String fieldName) Creates a newAnalyzer.TokenStreamComponentsinstance for this analyzer.Methods inherited from class org.apache.lucene.analysis.Analyzer
attributeFactory, close, getOffsetGap, getPositionIncrementGap, getReuseStrategy, initReader, initReaderForNormalization, normalize, normalize, tokenStream, tokenStream
-
Field Details
-
maxTokenLength
private final int maxTokenLength
-
-
Constructor Details
-
WhitespaceAnalyzer
public WhitespaceAnalyzer()Creates a newWhitespaceAnalyzerwith a maximum token length of 255 chars -
WhitespaceAnalyzer
public WhitespaceAnalyzer(int maxTokenLength) Creates a newWhitespaceAnalyzerwith a custom maximum token length- Parameters:
maxTokenLength- the maximum token length the analyzer will emit
-
-
Method Details
-
createComponents
Description copied from class:AnalyzerCreates a newAnalyzer.TokenStreamComponentsinstance for this analyzer.- Specified by:
createComponentsin classAnalyzer- Parameters:
fieldName- the name of the fields content passed to theAnalyzer.TokenStreamComponentssink as a reader- Returns:
- the
Analyzer.TokenStreamComponentsfor this analyzer.
-