Package org.languagetool.dev.index
Class AnyCharTokenizer
java.lang.Object
org.apache.lucene.util.AttributeSource
org.apache.lucene.analysis.TokenStream
org.apache.lucene.analysis.Tokenizer
org.languagetool.dev.index.AnyCharTokenizer
- All Implemented Interfaces:
Closeable,AutoCloseable
public final class AnyCharTokenizer
extends org.apache.lucene.analysis.Tokenizer
A tokenizer that renders the whole input as one token.
- Author:
- Tao Lin
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.lucene.util.AttributeSource
org.apache.lucene.util.AttributeSource.State -
Field Summary
Fields inherited from class org.apache.lucene.analysis.Tokenizer
inputFields inherited from class org.apache.lucene.analysis.TokenStream
DEFAULT_TOKEN_ATTRIBUTE_FACTORY -
Constructor Summary
ConstructorsConstructorDescriptionConstruct a new AnyCharTokenizer.AnyCharTokenizer(org.apache.lucene.util.AttributeFactory factory) Construct a new AnyCharTokenizer using a givenAttributeFactory. -
Method Summary
Modifier and TypeMethodDescriptionvoidend()booleanprotected booleanisTokenChar(int c) Collects any characters.protected intnormalize(int c) voidreset()Methods inherited from class org.apache.lucene.analysis.Tokenizer
close, correctOffset, setReaderMethods inherited from class org.apache.lucene.util.AttributeSource
addAttribute, addAttributeImpl, captureState, clearAttributes, cloneAttributes, copyTo, endAttributes, equals, getAttribute, getAttributeClassesIterator, getAttributeFactory, getAttributeImplsIterator, hasAttribute, hasAttributes, hashCode, reflectAsString, reflectWith, removeAllAttributes, restoreState, toString
-
Constructor Details
-
AnyCharTokenizer
public AnyCharTokenizer()Construct a new AnyCharTokenizer. -
AnyCharTokenizer
public AnyCharTokenizer(org.apache.lucene.util.AttributeFactory factory) Construct a new AnyCharTokenizer using a givenAttributeFactory.- Parameters:
factory- the attribute factory to use for thisTokenizer
-
-
Method Details
-
isTokenChar
protected boolean isTokenChar(int c) Collects any characters. -
normalize
protected int normalize(int c) -
incrementToken
- Specified by:
incrementTokenin classorg.apache.lucene.analysis.TokenStream- Throws:
IOException
-
end
- Overrides:
endin classorg.apache.lucene.analysis.TokenStream- Throws:
IOException
-
reset
- Overrides:
resetin classorg.apache.lucene.analysis.Tokenizer- Throws:
IOException
-