|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmorfologik.fsa.FSATraversal
public final class FSATraversal
This class implements some common matching and scanning operations on a generic FSA.
Constructor Summary | |
---|---|
FSATraversal(FSA fsa)
Traversals of the given FSA. |
Method Summary | |
---|---|
MatchResult |
match(byte[] sequence)
|
MatchResult |
match(byte[] sequence,
int node)
|
MatchResult |
match(byte[] sequence,
int start,
int length,
int node)
Finds a matching path in the dictionary for a given sequence of labels from sequence and starting at node node . |
MatchResult |
match(MatchResult result,
byte[] sequence,
int start,
int length,
int node)
Same as match(byte[], int, int, int) , but allows passing
a reusable MatchResult object so that no intermediate garbage is
produced. |
int |
perfectHash(byte[] sequence)
|
int |
perfectHash(byte[] sequence,
int start,
int length,
int node)
Calculate perfect hash for a given input sequence of bytes. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FSATraversal(FSA fsa)
Method Detail |
---|
public int perfectHash(byte[] sequence, int start, int length, int node)
FSA
is built with FSAFlags.NUMBERS
and corresponds to the sequential
order of input sequences used at automaton construction time.
start
- Start index in the sequence array.length
- Length of the byte sequence, must be at least 1.
MatchResult
.public int perfectHash(byte[] sequence)
perfectHash(byte[], int, int, int)
public MatchResult match(MatchResult result, byte[] sequence, int start, int length, int node)
match(byte[], int, int, int)
, but allows passing
a reusable MatchResult
object so that no intermediate garbage is
produced.
result
, but with reset internal
type and other fields.public MatchResult match(byte[] sequence, int start, int length, int node)
sequence
and starting at node node
.
sequence
- An array of labels to follow in the FSA.start
- Starting index in sequence
.length
- How many symbols to consider from sequence
?node
- Start node identifier in the FSA.match(byte [], int)
public MatchResult match(byte[] sequence, int node)
match(byte[], int, int, int)
public MatchResult match(byte[] sequence)
match(byte[], int, int, int)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |