2 fsa - Finite State Automata
Copyright 2005, 2006, 2007, 2008, 2009, 2010 by Damir Ćavar, Petar Garžina, Larisa Grčić, Tanja Gulan, Damir Kero, Robert Paleka, Franjo Pehar, Pavle Valerjev
(require nltk/fsa) |
Das nltk/fsa Module stellt Prozeduren für die Generierung and die Verarbeitung von Endlichen Automaten (Finite State Automata, FSA) bereit. !!! TODO !!!
Die Dokumentation des nltk/fsa Moduls ist in der Entwicklung. Dies ist eine kurze und unvollständige Beschreibung einiger Prozeduren und Datenstrukturen in diesem Modul.
2.1 Grundlegende Prozeduren
liefert eine neue Datenstruktur vom Typ fsa zurück.
liefert #t zurück, wenn der Parameter sfsa auf eine Datenstruktur vom Typ fsa verweist. Sonst liefert die Prozedur fsa? den Wert #f zurück.
Returns the alphabet or list of symbols accepted by the FSA sfsa.
Sets a new list new-alphabet as the alphabet or list of symbols accepted by FSA sfsa.
Returns a list with final states as defined in FSA sfsa.
Sets the finalstates for FSA sfsa to be the list provided by the parameter new-finalstates.
Returns a list of states that are defined in FSA sfsa.
Sets the list of states in FSA sfsa to be states.
Returns the start state of FSA sfsa.
Sets the start state of FSA sfsa to be the state identifier state.
Returns the transitions defined in FSA sfsa as a hashtable. The keys in the returned hashtable are of the type vector containing a tuple of a state identifier and a symbol for the transition. The corresponding value is an integer representing the goal state of the respective transition.
Sets the transitions for FSA sfsa to be the hashtable transitions. The new hashtable is expected to have keys of the type vector, containing an identifier of a state and the related transition symbol, and the corresponding value is expected to contain an integer value, representing the goal of the transition.
2.2 Extended data manipulation
Declares the state with the id sid to be a final state in the FSA specified in the parameter sfsa.
Adds a new state state to the list of states of FSA sfsa.
Adds a new symbol nsymb to the list of symbols of FSA sfsa.
| ||||||||||||||||||||||||||||
sfsa : fsa? | ||||||||||||||||||||||||||||
from-state : integer? | ||||||||||||||||||||||||||||
symb : any? | ||||||||||||||||||||||||||||
to-state : integer? |
Adds a transition from state from-state with symbol symb to state to-state in FSA sfsa.
(fsa-get-transition sfsa from-state tsymb) → integer? |
sfsa : fsa? |
from-state : integer? |
tsymb : any? |
Returns an identifier of a goal state for the transition that is identified by the from-state and tsymb parameter. If there is no defined goal state for the specified transition, the returned value is -1.
Returns two values, a vector of the keys, and a vector of the corresponding values. The keys a of the type vector, containing the identifier of the state from which the transition starts, and the respective symbol for the transition. The values are of the type integer, representing an identifier for the goal of the the transition.
2.3 FSA manipulation
!!! TODO !!!
Returns a FSA that represents the concatenation of two FSAs provided via the parameters first-fsa and second-fsa. !!! TODO !!!
Returns a new FSA that is the Union of the two FSAs provided by the parameters first-fsa and second-fsa. The order of the two FSAs in the parameters is irrelevant.
Returns an automaton from
2.4 Output procedures
Returns a DOT representation of the directed graph that corresponds to the FSA provided in the first parameter fsa-par. The returned data structure is of the type string.
The resulting DOT data (or file) can be processed and visualized using Graphviz, and many other related tools. More information on DOT, Graphviz and other visualization software is available at the Graphviz homepage.