Package org.apache.lucene.analysis
Class WhitespaceAnalyzer
- java.lang.Object
-
- org.apache.lucene.analysis.Analyzer
-
- org.apache.lucene.analysis.ReusableAnalyzerBase
-
- org.apache.lucene.analysis.WhitespaceAnalyzer
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public final class WhitespaceAnalyzer extends ReusableAnalyzerBase
An Analyzer that usesWhitespaceTokenizer.You must specify the required
Versioncompatibility when creatingCharTokenizer:- As of 3.1,
WhitespaceTokenizeruses an int based API to normalize and detect token codepoints. SeeCharTokenizer.isTokenChar(int)andCharTokenizer.normalize(int)for details.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.lucene.analysis.ReusableAnalyzerBase
ReusableAnalyzerBase.TokenStreamComponents
-
-
Constructor Summary
Constructors Constructor Description WhitespaceAnalyzer()Deprecated.useWhitespaceAnalyzer(Version)insteadWhitespaceAnalyzer(Version matchVersion)Creates a newWhitespaceAnalyzer
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ReusableAnalyzerBase.TokenStreamComponentscreateComponents(String fieldName, Reader reader)Creates a newReusableAnalyzerBase.TokenStreamComponentsinstance for this analyzer.-
Methods inherited from class org.apache.lucene.analysis.ReusableAnalyzerBase
initReader, reusableTokenStream, tokenStream
-
Methods inherited from class org.apache.lucene.analysis.Analyzer
close, getOffsetGap, getPositionIncrementGap, getPreviousTokenStream, setPreviousTokenStream
-
-
-
-
Constructor Detail
-
WhitespaceAnalyzer
public WhitespaceAnalyzer(Version matchVersion)
Creates a newWhitespaceAnalyzer- Parameters:
matchVersion- Lucene version to match See {@link above}
-
WhitespaceAnalyzer
@Deprecated public WhitespaceAnalyzer()
Deprecated.useWhitespaceAnalyzer(Version)insteadCreates a newWhitespaceAnalyzer
-
-
Method Detail
-
createComponents
protected ReusableAnalyzerBase.TokenStreamComponents createComponents(String fieldName, Reader reader)
Description copied from class:ReusableAnalyzerBaseCreates a newReusableAnalyzerBase.TokenStreamComponentsinstance for this analyzer.- Specified by:
createComponentsin classReusableAnalyzerBase- Parameters:
fieldName- the name of the fields content passed to theReusableAnalyzerBase.TokenStreamComponentssink as a readerreader- the reader passed to theTokenizerconstructor- Returns:
- the
ReusableAnalyzerBase.TokenStreamComponentsfor this analyzer.
-
-