public final class ClassicTokenizer extends Tokenizer
This should be a good tokenizer for most European-language documents:
Many applications have specific tokenizer needs. If this tokenizer does
not suit your application, please consider copying this source code
directory to your project and maintaining your own grammar-based tokenizer.
ClassicTokenizer was named StandardTokenizer in Lucene versions prior to 3.1.
As of 3.1, StandardTokenizer implements Unicode text segmentation,
as specified by UAX#29.
AttributeSource.AttributeFactory, AttributeSource.State| Modifier and Type | Field and Description |
|---|---|
static int |
ACRONYM |
static int |
ACRONYM_DEP |
static int |
ALPHANUM |
static int |
APOSTROPHE |
static int |
CJ |
static int |
COMPANY |
static int |
EMAIL |
static int |
HOST |
static int |
NUM |
static String[] |
TOKEN_TYPES
String token types that correspond to token type int constants
|
| Constructor and Description |
|---|
ClassicTokenizer(Version matchVersion,
AttributeSource.AttributeFactory factory,
Reader input)
Creates a new ClassicTokenizer with a given
AttributeSource.AttributeFactory |
ClassicTokenizer(Version matchVersion,
Reader input)
Creates a new instance of the
ClassicTokenizer. |
| Modifier and Type | Method and Description |
|---|---|
void |
end() |
int |
getMaxTokenLength() |
boolean |
incrementToken() |
void |
reset() |
void |
setMaxTokenLength(int length)
Set the max allowed token length.
|
close, correctOffset, setReaderaddAttribute, addAttributeImpl, captureState, clearAttributes, cloneAttributes, copyTo, equals, getAttribute, getAttributeClassesIterator, getAttributeFactory, getAttributeImplsIterator, hasAttribute, hasAttributes, hashCode, reflectAsString, reflectWith, restoreStatepublic static final int ALPHANUM
public static final int APOSTROPHE
public static final int ACRONYM
public static final int COMPANY
public static final int EMAIL
public static final int HOST
public static final int NUM
public static final int CJ
public static final int ACRONYM_DEP
public static final String[] TOKEN_TYPES
public ClassicTokenizer(Version matchVersion, Reader input)
ClassicTokenizer. Attaches
the input to the newly created JFlex scanner.input - The input reader
See http://issues.apache.org/jira/browse/LUCENE-1068public ClassicTokenizer(Version matchVersion, AttributeSource.AttributeFactory factory, Reader input)
AttributeSource.AttributeFactorypublic void setMaxTokenLength(int length)
public int getMaxTokenLength()
setMaxTokenLength(int)public final boolean incrementToken()
throws IOException
incrementToken in class TokenStreamIOExceptionpublic final void end()
end in class TokenStreampublic void reset()
throws IOException
reset in class TokenStreamIOExceptionCopyright © 2000-2013 Apache Software Foundation. All Rights Reserved.