|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectmorfologik.fsa.FSA
public abstract class FSA
This is a top interface for walking Finite State Automata as described in Jan Daciuk's Incremental Construction of Finite-State Automata and Transducers, and Their Use in the Natural Language Processing (PhD thesis, Technical University of Gdansk).
| Constructor Summary | |
|---|---|
FSA()
|
|
| Method Summary | |
|---|---|
abstract int |
getArc(int node,
byte label)
Returns the identifier of an arc leaving node and labeled
with label. |
abstract byte |
getArcLabel(int arc)
Return the label associated with a given arc. |
abstract int |
getEndNode(int arc)
Return the end node pointed to by a given arc. |
abstract int |
getFirstArc(int node)
Returns the identifier of the first arc leaving node or 0 if
the node has no outgoing arcs. |
abstract Set<FSAFlags> |
getFlags()
Returns a set of flags for this FSA instance. |
static FSA |
getInstance(InputStream in)
A factory for reading automata in any library-supported version. |
abstract int |
getNextArc(int arc)
Returns the identifier of the next arc after arc and leaving
node. |
abstract int |
getRootNode()
Returns the identifier of the root node of this automaton. |
FSATraversalHelper |
getTraversalHelper()
Returns an object which can be used to walk the edges of this finite state automaton and match arbitrary sequences against its states. |
abstract boolean |
isArcFinal(int arc)
Returns true if the destination node at the end of this
arc corresponds to an input sequence created when building
this automaton. |
abstract boolean |
isArcTerminal(int arc)
Returns true if this arc does not have a
terminating node (@link getEndNode(int) will throw an
exception). |
Iterator<ByteBuffer> |
iterator()
Returns an iterator over all binary sequences starting from the initial FSA state and ending in final nodes. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FSA()
| Method Detail |
|---|
public Iterator<ByteBuffer> iterator()
ByteBuffer that changes on each call to Iterator.next(),
so if the content should be preserved, it must be copied somewhere else.
It is guaranteed that the returned byte buffer is backed by a byte array and that the content of the byte buffer starts at the array's index 0.
iterator in interface Iterable<ByteBuffer>public FSATraversalHelper getTraversalHelper()
public abstract int getRootNode()
public abstract int getFirstArc(int node)
node or 0 if
the node has no outgoing arcs.
public abstract int getArc(int node,
byte label)
node and labeled
with label. An identifier equal to 0 means the node has no
outgoing arc labeled label.
public abstract int getNextArc(int arc)
arc and leaving
node. Zero is returned if no more arcs are available for the
node.
public abstract int getEndNode(int arc)
arc. Terminal arcs
(those that point to a terminal state) have no end node representation
and throw a runtime exception.
public abstract byte getArcLabel(int arc)
arc.
public abstract boolean isArcFinal(int arc)
true if the destination node at the end of this
arc corresponds to an input sequence created when building
this automaton.
public abstract boolean isArcTerminal(int arc)
true if this arc does not have a
terminating node (@link getEndNode(int) will throw an
exception). Implies isArcFinal(int).
public abstract Set<FSAFlags> getFlags()
public static FSA getInstance(InputStream in)
throws IOException
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||