Edinburgh Speech Tools  2.1-release
EST_WFST Class Reference

a call representing a weighted finite-state transducer More...

#include <include/EST_WFST.h>

Public Member Functions

Constructor and initialisation functions
 EST_WFST ()
 ? More...
 
 EST_WFST (const EST_WFST &wfst)
 ? More...
 
 ~EST_WFST ()
 
Reseting functions
void init (int init_num_states=10)
 Clear with (estimation of number of states required) More...
 
void init (LISP in, LISP out)
 clear an initialise with given input and out alphabets More...
 
void copy (const EST_WFST &wfst)
 Copy from existing wfst. More...
 
void clear ()
 clear removing existing states if any More...
 
General utility functions
int num_states () const
 
int start_state () const
 
int in_symbol (const EST_String &s) const
 Map input symbol to input alphabet index. More...
 
const EST_Stringin_symbol (int i) const
 Map input alphabet index to input symbol. More...
 
int out_symbol (const EST_String &s) const
 Map output symbol to output alphabet index. More...
 
const EST_Stringout_symbol (int i) const
 Map output alphabet index to output symbol. More...
 
LISP epsilon_label () const
 LISP for on epsilon symbols. More...
 
int in_epsilon () const
 Internal index for input epsilon. More...
 
int out_epsilon () const
 Internal index for output epsilon. More...
 
const EST_WFST_Statestate (int i) const
 Return internal state information. More...
 
EST_WFST_Statestate_non_const (int i)
 Return internal state information (non-const) More...
 
int final (int i) const
 True if state i is final. More...
 
const EST_Discretein_symbols () const
 Accessing the input alphabet. More...
 
const EST_Discreteout_symbols () const
 Accessing the output alphabet. More...
 
file i/o
EST_write_status save (const EST_String &filename, const EST_String type="ascii")
 ? More...
 
EST_write_status save_binary (FILE *fd)
 
EST_read_status load (const EST_String &filename)
 ? More...
 
EST_read_status load_binary (FILE *fd, EST_Option &hinfo, int num_states, int swap)
 
transduction functions
int transition (int state, int in, int out) const
 Find (first) new state given in and out symbols. More...
 
int transition (int state, int in, int out, float &prob) const
 
EST_WFST_Transitionfind_transition (int state, int in, int out) const
 Find (first) transition given in and out symbols. More...
 
int transition (int state, const EST_String &in, const EST_String &out) const
 Find (first) new state given in and out strings. More...
 
int transition (int state, const EST_String &inout) const
 Find (first) new state given in/out string. More...
 
int transduce (int state, int in, int &out) const
 Transduce in to out from state. More...
 
int transduce (int state, const EST_String &in, EST_String &out) const
 Transduce in to out (strings) from state. More...
 
void transduce (int state, int in, wfst_translist &out) const
 Transduce in to list of transitions. More...
 
void transition_all (int state, int in, int out, EST_WFST_MultiState *ms) const
 Find all possible transitions for given state/input/output. More...
 
Cumulation functions for adding collective probabilities

for transitions from data

int cumulate () const
 Cumulation condition. More...
 
void start_cumulate ()
 Clear and start cumulation. More...
 
void stop_cumulate ()
 Stop cumulation and calculate probabilities on transitions. More...
 
WFST construction functions from external representations
int add_state (enum wfst_state_type state_type)
 Add a new state, returns new name. More...
 
enum wfst_state_type ms_type (EST_WFST_MultiState *ms) const
 Given a multi-state return type (final, ok, error) More...
 
void build_wfst (int start, int end, LISP regex)
 Basic regex constructor. More...
 
void build_and_transition (int start, int end, LISP conjunctions)
 Basic conjunction constructor. More...
 
void build_or_transition (int start, int end, LISP disjunctions)
 Basic disjunction constructor. More...
 
void build_from_regex (LISP inalpha, LISP outalpha, LISP regex)
 
void kkrule_compile (LISP inalpha, LISP outalpha, LISP fp, LISP rule, LISP sets)
 
void build_from_rg (LISP inalpha, LISP outalpha, LISP distinguished, LISP rewrites, LISP sets, LISP terms, int max_depth)
 
void build_tree_lex (LISP inalpha, LISP outalpha, LISP wlist)
 
Basic WFST operators
void determinize (const EST_WFST &a)
 Build determinized form of a. More...
 
void minimize (const EST_WFST &a)
 Build minimized form of a. More...
 
void complement (const EST_WFST &a)
 Build complement of a. More...
 
void intersection (EST_TList< EST_WFST > &wl)
 
void intersection (const EST_WFST &a, const EST_WFST &b)
 
void uunion (EST_TList< EST_WFST > &wl)
 
void uunion (const EST_WFST &a, const EST_WFST &b)
 
void compose (const EST_WFST &a, const EST_WFST &b)
 
void difference (const EST_WFST &a, const EST_WFST &b)
 
void concat (const EST_WFST &a, const EST_WFST &b)
 
construction support functions
int deterministic () const
 True if WFST is deterministic. More...
 
EST_WFST_MultiStateapply_multistate (const EST_WFST &wfst, EST_WFST_MultiState *ms, int in, int out) const
 Transduce a multi-state given n and out. More...
 
void add_epsilon_reachable (EST_WFST_MultiState *ms) const
 Extend multi-state with epsilon reachable states. More...
 
void remove_error_states (const EST_WFST &a)
 Remove error states from the WFST. More...
 
EST_String summary () const
 
EST_WFSToperator= (const EST_WFST &a)
 ? More...
 

Detailed Description

a call representing a weighted finite-state transducer

Definition at line 154 of file EST_WFST.h.

Constructor & Destructor Documentation

EST_WFST::EST_WFST ( )

?

Definition at line 128 of file EST_WFST.cc.

EST_WFST::EST_WFST ( const EST_WFST wfst)
inline

?

Definition at line 187 of file EST_WFST.h.

EST_WFST::~EST_WFST ( )

Definition at line 112 of file EST_WFST.cc.

Member Function Documentation

void EST_WFST::init ( int  init_num_states = 10)

Clear with (estimation of number of states required)

Definition at line 149 of file EST_WFST.cc.

void EST_WFST::init ( LISP  in,
LISP  out 
)

clear an initialise with given input and out alphabets

Definition at line 162 of file EST_WFST.cc.

void EST_WFST::copy ( const EST_WFST wfst)

Copy from existing wfst.

Definition at line 136 of file EST_WFST.cc.

void EST_WFST::clear ( void  )

clear removing existing states if any

Definition at line 117 of file EST_WFST.cc.

int EST_WFST::num_states ( void  ) const
inline

Definition at line 205 of file EST_WFST.h.

int EST_WFST::start_state ( ) const
inline

Definition at line 206 of file EST_WFST.h.

int EST_WFST::in_symbol ( const EST_String s) const
inline

Map input symbol to input alphabet index.

Definition at line 208 of file EST_WFST.h.

const EST_String& EST_WFST::in_symbol ( int  i) const
inline

Map input alphabet index to input symbol.

Definition at line 211 of file EST_WFST.h.

int EST_WFST::out_symbol ( const EST_String s) const
inline

Map output symbol to output alphabet index.

Definition at line 214 of file EST_WFST.h.

const EST_String& EST_WFST::out_symbol ( int  i) const
inline

Map output alphabet index to output symbol.

Definition at line 217 of file EST_WFST.h.

LISP EST_WFST::epsilon_label ( ) const
inline

LISP for on epsilon symbols.

Definition at line 220 of file EST_WFST.h.

int EST_WFST::in_epsilon ( ) const
inline

Internal index for input epsilon.

Definition at line 222 of file EST_WFST.h.

int EST_WFST::out_epsilon ( ) const
inline

Internal index for output epsilon.

Definition at line 224 of file EST_WFST.h.

const EST_WFST_State* EST_WFST::state ( int  i) const
inline

Return internal state information.

Definition at line 226 of file EST_WFST.h.

EST_WFST_State* EST_WFST::state_non_const ( int  i)
inline

Return internal state information (non-const)

Definition at line 228 of file EST_WFST.h.

int EST_WFST::final ( int  i) const
inline

True if state i is final.

Definition at line 230 of file EST_WFST.h.

const EST_Discrete& EST_WFST::in_symbols ( ) const
inline

Accessing the input alphabet.

Definition at line 233 of file EST_WFST.h.

const EST_Discrete& EST_WFST::out_symbols ( ) const
inline

Accessing the output alphabet.

Definition at line 235 of file EST_WFST.h.

EST_write_status EST_WFST::save ( const EST_String filename,
const EST_String  type = "ascii" 
)

?

Definition at line 353 of file EST_WFST.cc.

EST_write_status EST_WFST::save_binary ( FILE *  fd)

Definition at line 308 of file EST_WFST.cc.

EST_read_status EST_WFST::load ( const EST_String filename)

?

Definition at line 521 of file EST_WFST.cc.

EST_read_status EST_WFST::load_binary ( FILE *  fd,
EST_Option hinfo,
int  num_states,
int  swap 
)

Definition at line 457 of file EST_WFST.cc.

int EST_WFST::transition ( int  state,
int  in,
int  out 
) const

Find (first) new state given in and out symbols.

Definition at line 264 of file EST_WFST.cc.

int EST_WFST::transition ( int  state,
int  in,
int  out,
float &  prob 
) const

Definition at line 291 of file EST_WFST.cc.

EST_WFST_Transition * EST_WFST::find_transition ( int  state,
int  in,
int  out 
) const

Find (first) transition given in and out symbols.

Definition at line 271 of file EST_WFST.cc.

int EST_WFST::transition ( int  state,
const EST_String in,
const EST_String out 
) const

Find (first) new state given in and out strings.

Definition at line 248 of file EST_WFST.cc.

int EST_WFST::transition ( int  state,
const EST_String inout 
) const

Find (first) new state given in/out string.

Definition at line 240 of file EST_WFST.cc.

int EST_WFST::transduce ( int  state,
int  in,
int out 
) const

Transduce in to out from state.

Definition at line 223 of file EST_WFST.cc.

int EST_WFST::transduce ( int  state,
const EST_String in,
EST_String out 
) const

Transduce in to out (strings) from state.

Definition at line 186 of file EST_WFST.cc.

void EST_WFST::transduce ( int  state,
int  in,
wfst_translist out 
) const

Transduce in to list of transitions.

Definition at line 205 of file EST_WFST.cc.

void EST_WFST::transition_all ( int  state,
int  in,
int  out,
EST_WFST_MultiState ms 
) const

Find all possible transitions for given state/input/output.

Definition at line 295 of file wfst_ops.cc.

int EST_WFST::cumulate ( ) const
inline

Cumulation condition.

Definition at line 281 of file EST_WFST.h.

void EST_WFST::start_cumulate ( void  )

Clear and start cumulation.

Definition at line 687 of file EST_WFST.cc.

void EST_WFST::stop_cumulate ( void  )

Stop cumulation and calculate probabilities on transitions.

Definition at line 702 of file EST_WFST.cc.

int EST_WFST::add_state ( enum wfst_state_type  state_type)

Add a new state, returns new name.

Definition at line 669 of file EST_WFST.cc.

enum wfst_state_type EST_WFST::ms_type ( EST_WFST_MultiState ms) const

Given a multi-state return type (final, ok, error)

Definition at line 272 of file wfst_ops.cc.

void EST_WFST::build_wfst ( int  start,
int  end,
LISP  regex 
)

Basic regex constructor.

Definition at line 142 of file wfst_regex.cc.

void EST_WFST::build_and_transition ( int  start,
int  end,
LISP  conjunctions 
)

Basic conjunction constructor.

Definition at line 64 of file wfst_regex.cc.

void EST_WFST::build_or_transition ( int  start,
int  end,
LISP  disjunctions 
)

Basic disjunction constructor.

Definition at line 46 of file wfst_regex.cc.

void EST_WFST::build_from_regex ( LISP  inalpha,
LISP  outalpha,
LISP  regex 
)

Definition at line 192 of file wfst_regex.cc.

void EST_WFST::kkrule_compile ( LISP  inalpha,
LISP  outalpha,
LISP  fp,
LISP  rule,
LISP  sets 
)

Definition at line 233 of file kkcompile.cc.

void EST_WFST::build_from_rg ( LISP  inalpha,
LISP  outalpha,
LISP  distinguished,
LISP  rewrites,
LISP  sets,
LISP  terms,
int  max_depth 
)

Definition at line 128 of file rgcompile.cc.

void EST_WFST::build_tree_lex ( LISP  inalpha,
LISP  outalpha,
LISP  wlist 
)

Definition at line 98 of file tlcompile.cc.

void EST_WFST::determinize ( const EST_WFST a)

Build determinized form of a.

Definition at line 166 of file wfst_ops.cc.

void EST_WFST::minimize ( const EST_WFST a)

Build minimized form of a.

Definition at line 485 of file wfst_ops.cc.

void EST_WFST::complement ( const EST_WFST a)

Build complement of a.

Definition at line 647 of file wfst_ops.cc.

void EST_WFST::intersection ( EST_TList< EST_WFST > &  wl)

Build intersection of all WFSTs in given list. The new WFST recognizes the only the strings that are recognized by all WFSTs in the given list

Definition at line 357 of file wfst_ops.cc.

void EST_WFST::intersection ( const EST_WFST a,
const EST_WFST b 
)

Build intersection of WFSTs a and b The new WFST recognizes the only the strings that are recognized by both a and b list

Definition at line 471 of file wfst_ops.cc.

void EST_WFST::uunion ( EST_TList< EST_WFST > &  wl)

Build union of all WFSTs in given list. The new WFST recognizes the only the strings that are recognized by at least one WFSTs in the given list

void EST_WFST::uunion ( const EST_WFST a,
const EST_WFST b 
)

Build union of WFSTs a and b. The new WFST recognizes the only the strings that are recognized by either a or b

Definition at line 718 of file wfst_ops.cc.

void EST_WFST::compose ( const EST_WFST a,
const EST_WFST b 
)

Build new WFST by composition of a and b. Outputs of a are fed to b, given a new WFSTs which has a's input language and b's output set. a's output and b's input alphabets must be the same

Definition at line 813 of file wfst_ops.cc.

void EST_WFST::difference ( const EST_WFST a,
const EST_WFST b 
)

Build WFST that accepts only strings in a that aren't also accepted by strings in b.

Definition at line 899 of file wfst_ops.cc.

void EST_WFST::concat ( const EST_WFST a,
const EST_WFST b 
)

Build WFST that accepts a language that consists of any string in a followed by any string in b

Definition at line 777 of file wfst_ops.cc.

int EST_WFST::deterministic ( ) const

True if WFST is deterministic.

Definition at line 976 of file wfst_ops.cc.

EST_WFST_MultiState * EST_WFST::apply_multistate ( const EST_WFST wfst,
EST_WFST_MultiState ms,
int  in,
int  out 
) const

Transduce a multi-state given n and out.

Definition at line 251 of file wfst_ops.cc.

void EST_WFST::add_epsilon_reachable ( EST_WFST_MultiState ms) const

Extend multi-state with epsilon reachable states.

Definition at line 320 of file wfst_ops.cc.

void EST_WFST::remove_error_states ( const EST_WFST a)

Remove error states from the WFST.

Definition at line 918 of file wfst_ops.cc.

EST_String EST_WFST::summary ( ) const

Definition at line 647 of file EST_WFST.cc.

EST_WFST& EST_WFST::operator= ( const EST_WFST a)
inline

?

Definition at line 368 of file EST_WFST.h.


The documentation for this class was generated from the following files: