public class TokenStreamToAutomaton extends Object
Automaton
where the transition labels are UTF8 bytes from the TermToBytesRefAttribute. Between tokens we insert
POS_SEP and for holes we insert HOLE.| Modifier and Type | Field and Description |
|---|---|
static int |
HOLE
We add this arc to represent a hole.
|
static int |
POS_SEP
We create transition between two adjacent tokens.
|
| Constructor and Description |
|---|
TokenStreamToAutomaton()
Sole constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected BytesRef |
changeToken(BytesRef in)
Subclass & implement this if you need to change the
token (such as escaping certain bytes) before it's
turned into a graph.
|
Automaton |
toAutomaton(TokenStream in)
Pulls the graph (including
PositionLengthAttribute) from the provided TokenStream, and creates the corresponding
automaton where arcs are bytes from each term. |
public static final int POS_SEP
public static final int HOLE
protected BytesRef changeToken(BytesRef in)
public Automaton toAutomaton(TokenStream in) throws IOException
PositionLengthAttribute) from the provided TokenStream, and creates the corresponding
automaton where arcs are bytes from each term.IOExceptionCopyright © 2000-2013 Apache Software Foundation. All Rights Reserved.