|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmorfologik.fsa.core.FSATraversalHelper
public class FSATraversalHelper
This class implements some common match/ traverse/ find 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 | |
---|---|
FSAFinalStatesIterator |
getAllSubsequences(FSA.Node node)
Returns an Iterator of all subsequences available from the given node to
all reachable final states. |
FSAMatch |
matchSequence(byte[] sequence,
FSA.Node node)
Finds a matching path in the dictionary for a given sequence of labels, starting from some internal dictionary's node. |
FSAMatch |
matchSequence(byte[] sequence,
FSA fsa)
Finds a matching path in the dictionary for a given sequence of labels. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public FSAFinalStatesIterator getAllSubsequences(FSA.Node node)
Iterator
of all subsequences available from the given node to
all reachable final states.
public FSAMatch matchSequence(byte[] sequence, FSA fsa)
FSAMatch.EXACT_MATCH
- The sequence ends exactly on the final node. A
match has been found.
FSAMatch.PREFIX_FOUND
- The sequence ends on an intermediate
automaton node. The sequence is therefore
a prefix of at least one other sequence stored in the dictionary. The result
Match will contain an index of the first character in the input sequence not present
in the dictionary and a pointer to the FSA.Node where mismatch occurred.
FSAMatch.PREMATURE_PATH_END_FOUND
- Dictionary's path ends before the sequence.
It means a prefix of the input sequence
is stored in the dictionary. (i.e. an empty sequence is a prefix of all other
sequences). The result Match will contain an index of the first character
not present in the dictionary.
FSAMatch.PREMATURE_WORD_END_FOUND
- The input sequence ends on an intermediate
automaton node. This is a special case of FSAMatch.PREFIX_FOUND
. A Node where the mismatch
(lack of input sequence's characters) occurred is returned in Match.
public FSAMatch matchSequence(byte[] sequence, FSA.Node node)
matchSequence(byte [], FSA.Node)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |