public final class StandardTokenizer extends Tokenizer
This class implements the Word Break rules from the Unicode Text Segmentation algorithm, as specified in Unicode Standard Annex #29.
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.
AttributeSource.State
Modifier and Type | Field and Description |
---|---|
static int |
ACRONYM
Deprecated.
(3.1)
|
static int |
ACRONYM_DEP
Deprecated.
(3.1)
|
static int |
ALPHANUM |
static int |
APOSTROPHE
Deprecated.
(3.1)
|
static int |
CJ
Deprecated.
(3.1)
|
static int |
COMPANY
Deprecated.
(3.1)
|
static int |
EMAIL |
static int |
HANGUL |
static int |
HIRAGANA |
static int |
HOST
Deprecated.
(3.1)
|
static int |
IDEOGRAPHIC |
static int |
KATAKANA |
static int |
NUM |
static int |
SOUTHEAST_ASIAN |
static String[] |
TOKEN_TYPES
String token types that correspond to token type int constants
|
DEFAULT_TOKEN_ATTRIBUTE_FACTORY
Constructor and Description |
---|
StandardTokenizer()
Creates a new instance of the
StandardTokenizer . |
StandardTokenizer(AttributeFactory factory)
Creates a new StandardTokenizer with a given
AttributeFactory |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
end() |
int |
getMaxTokenLength() |
boolean |
incrementToken() |
void |
reset() |
void |
setMaxTokenLength(int length)
Set the max allowed token length.
|
correctOffset, setReader
addAttribute, addAttributeImpl, captureState, clearAttributes, cloneAttributes, copyTo, equals, getAttribute, getAttributeClassesIterator, getAttributeFactory, getAttributeImplsIterator, hasAttribute, hasAttributes, hashCode, reflectAsString, reflectWith, restoreState, toString
public static final int ALPHANUM
@Deprecated public static final int APOSTROPHE
@Deprecated public static final int ACRONYM
@Deprecated public static final int COMPANY
public static final int EMAIL
@Deprecated public static final int HOST
public static final int NUM
@Deprecated public static final int CJ
@Deprecated public static final int ACRONYM_DEP
public static final int SOUTHEAST_ASIAN
public static final int IDEOGRAPHIC
public static final int HIRAGANA
public static final int KATAKANA
public static final int HANGUL
public static final String[] TOKEN_TYPES
public StandardTokenizer()
StandardTokenizer
. Attaches
the input
to the newly created JFlex scanner.
See http://issues.apache.org/jira/browse/LUCENE-1068public StandardTokenizer(AttributeFactory factory)
AttributeFactory
public void setMaxTokenLength(int length)
public int getMaxTokenLength()
setMaxTokenLength(int)
public final boolean incrementToken() throws IOException
incrementToken
in class TokenStream
IOException
public final void end() throws IOException
end
in class TokenStream
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class Tokenizer
IOException
public void reset() throws IOException
reset
in class Tokenizer
IOException
Copyright © 2000-2015 Apache Software Foundation. All Rights Reserved.