kascediva.blogg.se

Fst finite state automata
Fst finite state automata






fst finite state automata

$fsm = $fsm1->compose($fsm2) # transducer composition $sinkid = $fsm->complete($abet) # complete lower wrt. $fsm = $fsm1->complement($abet) # lower complement wrt. $fsm = $fsm1->complement() # lower complement wrt. $fsm = $fsm1->compact($rmeps) # heuristic compaction (encoded minimization) $fsm = $fsm1->n_closure($n) # n-ary closure

fst finite state automata

$fsm = $fsm1->closure(1) # transitive closure $fsm = $fsm1->closure() # reflexive + transitive closure $bool = $fsm->viewps(%options) # for debugging $bool = $fsm->draw_dot($filename_or_handle,%options) # save in DOT format $bool = $fsm->draw_vcg($filename_or_handle,%options) # save in VCG format $fsm_or_undef = $fsm->print_att_string($string, ?$abet_lo, ?$abet_hi, ?$abet_states) # compile AT&T-style text format $string (class method ok) $fsm_or_undef = $fsm->compile_string($string, ?$abet_lo, ?$abet_hi, ?$abet_states) # save AT&T-style text format file (transducer format only) $fsm_or_undef = $fsm->print_att($filename_or_handle, %options) # compile AT&T-style text format file (transducer format only class method ok) $fsm_or_undef = $fsm->compile($filename_or_handle, %options) $fsm_or_undef = $fsm->save_string($buffer) # save to in-memory buffer $string $fsm_or_undef = $fsm->load_string($buffer) # load from in-memory buffer $string (class method ok) $fsm_or_undef = $fsm->save($filename_or_handle) # save binary file $fsm_or_undef = $fsm->load($filename_or_handle) # load binary file (class method ok) $ai->seek_both($lo,$hi) # (inclusive) seek next arc with labels $lo,$hi $ai->seek_upper($lab) # (inclusive) seek next arc with upper label $lab $ai->seek_lower($lab) # (inclusive) seek next arc with lower label $lab $ai->next() # increment to next outgoing arc $weight = $ai->weight(?$weight) # get/set current arc weight $lab = $ai->upper(?$lab) # get/set current arc upper label $lab = $ai->lower(?$lab) # get/set current arc lower label $stateid = $ai->target(?$stateid) # get/set current arc target StateId $ai->remove() # remove current arc from the automaton $bool = $ai->ok() # check iterator validity $ai->open($fsm,$stateid) # open outgoing arcs from $stateid in $fsm $ai = Gfsm::ArcIter->new($fsm,$stateid) # create & open $ai = Gfsm::ArcIter->new() # create new arc-iterator $fsm->arcsort($fsm,$mode) # sort automaton arcs $fsm->add_arc($fsm,$id_from,$id_to,$lab_lo,$lab_hi,$weight) # add an arc $fsm->statesort_bfs() # breadth-first state sort $fsm->statesort_dfs() # depth-first state sort $fsm->renumber_states() # close gaps in stateid numbering $w = $fsm->final_weight($id,?$w) # get/set final weight for state $id $deg = $fsm->out_degree($id) # get number of outgoing arcs for state $id $bool = $fsm->is_final($id,?$bool) # get/set final-flag for state $id $fsm->remove_state($id) # remove a state from an FSM $id = $fsm->ensure_state($id) # ensure that a state exists $id = $fsm->add_state() # add a new state $bool = $fsm->is_cyclic() # check for cyclicity $bool = $fsm->has_state($id) # check whether a state exists $id = $fsm->root(?$id) # get/set id of initial state $n = $fsm->n_final_states() # get number of final states $n = $fsm->n_states() # get number of states

fst finite state automata

$srtype = $fsm->semiring_type(?$srtype) # get/set semiring type $bool = $fsm->is_deterministic(?$bool) # get/set 'is_deterministic' flag (dangerous) $mode = $fsm->sort_mode(?$mode) # get/set sort-mode flag (dangerous) $bool = $fsm->is_weighted(?$bool) # get/set 'is_weighted' flag $bool = $fsm->is_transducer() # get 'is_transducer' flag $fsm->clear() # clear automaton structure $fsm2->assign($fsm1) # assigns $fsm1 to $fsm2

fst finite state automata

$fsm2 = $fsm->shadow() # copy non-structural elements $fsm = Gfsm::Automaton->new($is_transducer,$srtype,$n_preallocated_states) Gfsm::Automaton - object-oriented interface to libgfsm finite-state automata SYNOPSIS use Gfsm








Fst finite state automata