Package fsa_recognizer :: Module class_nondet_fsa_recognize
[hide private]
[frames] | no frames]

Module class_nondet_fsa_recognize

source code

A class version of the non-deterministic FSA recognizer.

Classes for recognizer_agenda and search_states are also defined here.


Author: Jean Mark Gawron

Contact: gawron@mail.sdsu.edu

Classes [hide private]
    FSA Classes
  nondet_fsa
Class for non-deterministic fsa's, subclass of fsa that differs from it in allows state transition functions with multiple values for a single symbol as well as ε-transitions.
    Recognizer Classes
  nondet_fsa_recognizer
Class for non_deterministic fsa recognizer.
    Helper Classes
  recognizer_agenda
A list of search states.
  search_state
search_states are what populate the Agenda, determining a string position and machine state to resume recognition from, for example, after backtracking.
Variables [hide private]
TransitionTable nd_table = [{'!': ('und'), 'a': ('und'), 'b': (1), 'epsilon': ...
The TransitionTable for ndfsa [no εs].
TransitionTable nd_table_eps = [{'!': ('und'), 'a': ('und'), 'b': (1), 'epsilo...
The TransitionTable for ndfsa_eps [has ε-transitions].
TransitionTable nd_table2 = [{'b': (1)}, {'a': (2)}, {'a': (3, 2)}, {'!': (4)}...
A more concise TransitionTable equivalent to nd_table, leaving out all undefined symbols from the dictionary.
tuple nd_finals = (4)
The tuple of final states for ndfsa and ndfsa2.
    fsas
fsa ndfsa = {nondet_f...
The nondet sheep language fsa (Jurafsky and Martin, Speech and Natural Language Processing, Fig 2.18)
fsa ndfsa2 = {nondet_f...
More succinct fsa equivalent to ndfsa
fsa ndfsa_eps = {nondet_f...
The nondet sheep language machine with ε transitions (Jurafsky and Martin, Speech and Natural Language Processing, Fig 2.19)
    recognizers
nondet_fsa_recognizer nondet_R = [nondet_fsa_recogniz...
fsa_recognizer for ndfsa
nondet_fsa_recognizer nondet_R2 = [nondet_fsa_recogniz...
fsa_recognizer for ndfsa
nondet_fsa_recognizer nondet_R_eps = [nondet_fsa_recogniz...
fsa_recognizer for ndfsa_eps
Variables Details [hide private]

nd_table

The TransitionTable for ndfsa [no εs].
Type:
TransitionTable
Value:
[{'!': ('und'), 'a': ('und'), 'b': (1), 'epsilon': ('und')},
 {'!': ('und'), 'a': (2), 'b': ('und'), 'epsilon': ('und')},
 {'!': ('und'), 'a': (3, 2), 'b': ('und'), 'epsilon': ('und')},
 {'!': (4), 'a': ('und'), 'b': ('und'), 'epsilon': ('und')},
 {'!': ('und'), 'a': ('und'), 'b': ('und'), 'epsilon': ('und')}]

nd_table_eps

The TransitionTable for ndfsa_eps [has ε-transitions].
Type:
TransitionTable
Value:
[{'!': ('und'), 'a': ('und'), 'b': (1), 'epsilon': ('und')},
 {'!': ('und'), 'a': (2), 'b': ('und'), 'epsilon': ('und')},
 {'!': ('und'), 'a': (3), 'b': ('und'), 'epsilon': ('und')},
 {'!': (4), 'a': ('und'), 'b': ('und'), 'epsilon': (2)},
 {'!': ('und'), 'a': ('und'), 'b': ('und'), 'epsilon': ('und')}]

nd_table2

A more concise TransitionTable equivalent to nd_table, leaving out all undefined symbols from the dictionary. Note that since state 4 has no defined transitions, it is represented by the empty dictionary.
Type:
TransitionTable
Value:
[{'b': (1)}, {'a': (2)}, {'a': (3, 2)}, {'!': (4)}, {}]

ndfsa

The nondet sheep language fsa (Jurafsky and Martin, Speech and Natural Language Processing, Fig 2.18)
Type:
fsa
Value:
{nondet_fsa 
  0: initial state
    b => (1,)
  1:
    a => (2,)
  2:
    a => (3, 2)
  3:
...

ndfsa2

More succinct fsa equivalent to ndfsa
Type:
fsa
Value:
{nondet_fsa 
  0: initial state
    b => (1,)
  1:
    a => (2,)
  2:
    a => (3, 2)
  3:
...

ndfsa_eps

The nondet sheep language machine with ε transitions (Jurafsky and Martin, Speech and Natural Language Processing, Fig 2.19)
Type:
fsa
Value:
{nondet_fsa 
  0: initial state
    b => (1,)
  1:
    a => (2,)
  2:
    a => (3,)
  3:
...

nondet_R

fsa_recognizer for ndfsa
Type:
nondet_fsa_recognizer
Value:
[nondet_fsa_recognizer 
  {nondet_fsa 
    0: initial state
      b => (1,)
    1:
      a => (2,)
    2:
      a => (3, 2)
...

nondet_R2

fsa_recognizer for ndfsa
Type:
nondet_fsa_recognizer
Value:
[nondet_fsa_recognizer 
  {nondet_fsa 
    0: initial state
      b => (1,)
    1:
      a => (2,)
    2:
      a => (3, 2)
...

nondet_R_eps

fsa_recognizer for ndfsa_eps
Type:
nondet_fsa_recognizer
Value:
[nondet_fsa_recognizer 
  {nondet_fsa 
    0: initial state
      b => (1,)
    1:
      a => (2,)
    2:
      a => (3,)
...