|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmorfologik.fsa.FSATraversalHelper
public final class FSATraversalHelper
This class implements some common matching and scanning operations on a generic FSA.
Optimized implementations may be provided my specific versions of FSA,
therefore objects of this class should be instantiated via
FSA.getTraversalHelper()
.
Method Summary | |
---|---|
java.util.Iterator<java.nio.ByteBuffer> |
getAllSubsequences(int node)
Returns an Iterator of all subsequences available from the given
node to all reachable final states. |
FSAFinalStatesIterator |
getFinalStatesIterator()
Returns a new iterator for walking along the final states of this FSA. |
FSAMatch |
matchSequence(byte[] sequence)
|
FSAMatch |
matchSequence(byte[] sequence,
int node)
|
FSAMatch |
matchSequence(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 . |
FSAMatch |
matchSequence(FSAMatch result,
byte[] sequence,
int start,
int length,
int node)
Same as matchSequence(byte[], int, int, int) , but allows passing
a reusable FSAMatch object so that no intermediate garbage is
produced. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public java.util.Iterator<java.nio.ByteBuffer> getAllSubsequences(int node)
Iterator
of all subsequences available from the given
node to all reachable final states.
public FSAFinalStatesIterator getFinalStatesIterator()
public FSAMatch matchSequence(FSAMatch result, byte[] sequence, int start, int length, int node)
matchSequence(byte[], int, int, int)
, but allows passing
a reusable FSAMatch
object so that no intermediate garbage is
produced.
result
, but with reset internal
type and other fields.public FSAMatch matchSequence(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.matchSequence(byte [], int)
public FSAMatch matchSequence(byte[] sequence, int node)
matchSequence(byte[], int, int, int)
public FSAMatch matchSequence(byte[] sequence)
matchSequence(byte[], int, int, int)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |