#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_String & | in_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_String & | out_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_State * | state (int i) const |
Return internal state information. More... | |
EST_WFST_State * | state_non_const (int i) |
Return internal state information (non-const) More... | |
int | final (int i) const |
True if state {\tt i} is final. More... | |
const EST_Discrete & | in_symbols () const |
Accessing the input alphabet. More... | |
const EST_Discrete & | out_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_Transition * | find_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_MultiState * | apply_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_WFST & | operator= (const EST_WFST &a) |
? More... | |
a call representing a weighted finite-state transducer
Definition at line 150 of file EST_WFST.h.
EST_WFST::EST_WFST | ( | ) |
?
Definition at line 126 of file EST_WFST.cc.
|
inline |
?
Definition at line 183 of file EST_WFST.h.
EST_WFST::~EST_WFST | ( | ) |
Definition at line 110 of file EST_WFST.cc.
void EST_WFST::init | ( | int | init_num_states = 10 | ) |
Clear with (estimation of number of states required)
Definition at line 145 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 158 of file EST_WFST.cc.
void EST_WFST::copy | ( | const EST_WFST & | wfst | ) |
Copy from existing wfst.
Definition at line 132 of file EST_WFST.cc.
void EST_WFST::clear | ( | void | ) |
clear removing existing states if any
Definition at line 115 of file EST_WFST.cc.
|
inline |
Definition at line 201 of file EST_WFST.h.
|
inline |
Definition at line 202 of file EST_WFST.h.
|
inline |
Map input symbol to input alphabet index.
Definition at line 204 of file EST_WFST.h.
|
inline |
Map input alphabet index to input symbol.
Definition at line 207 of file EST_WFST.h.
|
inline |
Map output symbol to output alphabet index.
Definition at line 210 of file EST_WFST.h.
|
inline |
Map output alphabet index to output symbol.
Definition at line 213 of file EST_WFST.h.
|
inline |
LISP for on epsilon symbols.
Definition at line 216 of file EST_WFST.h.
|
inline |
Internal index for input epsilon.
Definition at line 218 of file EST_WFST.h.
|
inline |
Internal index for output epsilon.
Definition at line 220 of file EST_WFST.h.
|
inline |
Return internal state information.
Definition at line 222 of file EST_WFST.h.
|
inline |
Return internal state information (non-const)
Definition at line 224 of file EST_WFST.h.
|
inline |
True if state {\tt i} is final.
Definition at line 226 of file EST_WFST.h.
|
inline |
Accessing the input alphabet.
Definition at line 229 of file EST_WFST.h.
|
inline |
Accessing the output alphabet.
Definition at line 231 of file EST_WFST.h.
EST_write_status EST_WFST::save | ( | const EST_String & | filename, |
const EST_String | type = "ascii" |
||
) |
?
Definition at line 349 of file EST_WFST.cc.
EST_write_status EST_WFST::save_binary | ( | FILE * | fd | ) |
Definition at line 304 of file EST_WFST.cc.
EST_read_status EST_WFST::load | ( | const EST_String & | filename | ) |
?
Definition at line 508 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 445 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 260 of file EST_WFST.cc.
int EST_WFST::transition | ( | int | state, |
int | in, | ||
int | out, | ||
float & | prob | ||
) | const |
Definition at line 287 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 267 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 244 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 236 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 219 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 182 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 201 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 294 of file wfst_ops.cc.
|
inline |
Cumulation condition.
Definition at line 277 of file EST_WFST.h.
void EST_WFST::start_cumulate | ( | void | ) |
Clear and start cumulation.
Definition at line 670 of file EST_WFST.cc.
void EST_WFST::stop_cumulate | ( | void | ) |
Stop cumulation and calculate probabilities on transitions.
Definition at line 685 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 652 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 271 of file wfst_ops.cc.
void EST_WFST::build_wfst | ( | int | start, |
int | end, | ||
LISP | regex | ||
) |
Basic regex constructor.
Definition at line 140 of file wfst_regex.cc.
void EST_WFST::build_and_transition | ( | int | start, |
int | end, | ||
LISP | conjunctions | ||
) |
Basic conjunction constructor.
Definition at line 62 of file wfst_regex.cc.
void EST_WFST::build_or_transition | ( | int | start, |
int | end, | ||
LISP | disjunctions | ||
) |
Basic disjunction constructor.
Definition at line 44 of file wfst_regex.cc.
void EST_WFST::build_from_regex | ( | LISP | inalpha, |
LISP | outalpha, | ||
LISP | regex | ||
) |
Definition at line 190 of file wfst_regex.cc.
void EST_WFST::kkrule_compile | ( | LISP | inalpha, |
LISP | outalpha, | ||
LISP | fp, | ||
LISP | rule, | ||
LISP | sets | ||
) |
Definition at line 231 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 126 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 164 of file wfst_ops.cc.
void EST_WFST::minimize | ( | const EST_WFST & | a | ) |
Build minimized form of a.
Definition at line 484 of file wfst_ops.cc.
void EST_WFST::complement | ( | const EST_WFST & | a | ) |
Build complement of a.
Definition at line 646 of file wfst_ops.cc.
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 356 of file wfst_ops.cc.
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 470 of file wfst_ops.cc.
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
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 717 of file wfst_ops.cc.
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 812 of file wfst_ops.cc.
Build WFST that accepts only strings in a that aren't also accepted by strings in b.
Definition at line 898 of file wfst_ops.cc.
Build WFST that accepts a language that consists of any string in a followed by any string in b
Definition at line 776 of file wfst_ops.cc.
int EST_WFST::deterministic | ( | ) | const |
True if WFST is deterministic.
Definition at line 975 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 250 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 319 of file wfst_ops.cc.
void EST_WFST::remove_error_states | ( | const EST_WFST & | a | ) |
Remove error states from the WFST.
Definition at line 917 of file wfst_ops.cc.
EST_String EST_WFST::summary | ( | ) | const |
Definition at line 630 of file EST_WFST.cc.
?
Definition at line 364 of file EST_WFST.h.