|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.lucene.util.AttributeSource
org.apache.lucene.analysis.TokenStream
org.apache.lucene.analysis.Tokenizer
org.apache.lucene.analysis.standard.StandardTokenizer
public final class StandardTokenizer
A grammar-based tokenizer constructed with JFlex.
As of Lucene version 3.1, 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.
You must specify the required Version
compatibility when creating StandardTokenizer:
ClassicTokenizer
for backwards compatibility.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.apache.lucene.util.AttributeSource |
---|
AttributeSource.AttributeFactory, AttributeSource.State |
Field Summary | |
---|---|
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 |
Fields inherited from class org.apache.lucene.analysis.Tokenizer |
---|
input |
Constructor Summary | |
---|---|
StandardTokenizer(Version matchVersion,
AttributeSource.AttributeFactory factory,
Reader input)
Creates a new StandardTokenizer with a given AttributeSource.AttributeFactory |
|
StandardTokenizer(Version matchVersion,
AttributeSource source,
Reader input)
Creates a new StandardTokenizer with a given AttributeSource . |
|
StandardTokenizer(Version matchVersion,
Reader input)
Creates a new instance of the StandardTokenizer . |
Method Summary | |
---|---|
void |
end()
|
int |
getMaxTokenLength()
|
boolean |
incrementToken()
|
void |
reset()
|
void |
setMaxTokenLength(int length)
Set the max allowed token length. |
Methods inherited from class org.apache.lucene.analysis.Tokenizer |
---|
close, correctOffset, setReader |
Methods inherited from class org.apache.lucene.util.AttributeSource |
---|
addAttribute, addAttributeImpl, captureState, clearAttributes, cloneAttributes, copyTo, equals, getAttribute, getAttributeClassesIterator, getAttributeFactory, getAttributeImplsIterator, hasAttribute, hasAttributes, hashCode, reflectAsString, reflectWith, restoreState |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
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
Constructor Detail |
---|
public StandardTokenizer(Version matchVersion, Reader input)
StandardTokenizer
. Attaches
the input
to the newly created JFlex scanner.
input
- The input reader
See http://issues.apache.org/jira/browse/LUCENE-1068public StandardTokenizer(Version matchVersion, AttributeSource source, Reader input)
AttributeSource
.
public StandardTokenizer(Version matchVersion, AttributeSource.AttributeFactory factory, Reader input)
AttributeSource.AttributeFactory
Method Detail |
---|
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()
end
in class TokenStream
public void reset() throws IOException
reset
in class TokenStream
IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |