On this page:
2.1 Grundlegende Prozeduren
make-fsa
fsa?
fsa-alphabet
fsa-alphabet-set!
fsa-finalstates
fsa-finalstates-set!
fsa-states
fsa-states-set!
fsa-startstate
fsa-startstate-set!
fsa-transitions
fsa-transitions-set!
2.2 Extended data manipulation
fsa-set-finalstate!
fsa-add-state!
fsa-add-symbol!
fsa-add-transition!
fsa-get-transition
fsa-all-transitions
2.3 FSA manipulation
fsa-minimize
fsa-concatenate
fsa-union
sequence->fsa
2.4 Output procedures
fsa->dot

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

(make-fsa [finalstates    
  alphabet    
  states    
  transitions    
  startstate])  fsa?
  finalstates : list? = '()
  alphabet : list? = '()
  states : list? = '()
  transitions : hashtable? = (make-hashtable equal-hash equal?)
  startstate : integer? = 0
liefert eine neue Datenstruktur vom Typ fsa zurück.

(fsa? sfsa)  boolean?
  sfsa : fsa?
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.

(fsa-alphabet sfsa)  list?
  sfsa : fsa?
Returns the alphabet or list of symbols accepted by the FSA sfsa.

(fsa-alphabet-set! sfsa new-alphabet)  void?
  sfsa : fsa?
  new-alphabet : list?
Sets a new list new-alphabet as the alphabet or list of symbols accepted by FSA sfsa.

(fsa-finalstates sfsa)  list?
  sfsa : fsa?
Returns a list with final states as defined in FSA sfsa.

(fsa-finalstates-set! sfsa new-finalstates)  void?
  sfsa : fsa?
  new-finalstates : list?
Sets the finalstates for FSA sfsa to be the list provided by the parameter new-finalstates.

(fsa-states sfsa)  list?
  sfsa : fsa?
Returns a list of states that are defined in FSA sfsa.

(fsa-states-set! sfsa states)  void?
  sfsa : fsa?
  states : list?
Sets the list of states in FSA sfsa to be states.

(fsa-startstate sfsa)  integer?
  sfsa : fsa?
Returns the start state of FSA sfsa.

(fsa-startstate-set! sfsa state)  void?
  sfsa : fsa?
  state : integer?
Sets the start state of FSA sfsa to be the state identifier state.

(fsa-transitions sfsa)  hashtable?
  sfsa : fsa?
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.

(fsa-transitions-set! sfsa transitions)  void?
  sfsa : fsa?
  transitions : hashtable?
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

(fsa-set-finalstate! sfsa sid)  void?
  sfsa : fsa?
  sid : integer?
Declares the state with the id sid to be a final state in the FSA specified in the parameter sfsa.

(fsa-add-state! sfsa state)  void?
  sfsa : fsa?
  state : integer?
Adds a new state state to the list of states of FSA sfsa.

(fsa-add-symbol! sfsa nsymb)  void?
  sfsa : fsa?
  nsymb : any?
Adds a new symbol nsymb to the list of symbols of FSA sfsa.

(fsa-add-transition! sfsa    
  from-state    
  symb    
  to-state)  void?
  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.

(fsa-all-transitions sfsa)  values?
  sfsa : fsa?
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

(fsa-minimize first-fsa)  fsa?
  first-fsa : fsa?
!!! TODO !!!

(fsa-concatenate first-fsa second-fsa)  fsa?
  first-fsa : fsa?
  second-fsa : fsa?
Returns a FSA that represents the concatenation of two FSAs provided via the parameters first-fsa and second-fsa. !!! TODO !!!

(fsa-union first-fsa second-fsa)  fsa?
  first-fsa : fsa?
  second-fsa : fsa?
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.

(sequence->fsa seq)  fsa?
  seq : (or/c list? vector? string?)
Returns an automaton from

2.4 Output procedures

(fsa->dot fsa-par)  string?
  fsa-par : fsa?
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.