Loading...
Searching...
No Matches
EST_WFST Class Reference

`#include <include/EST_WFST.h>`

## Public Member Functions

Constructor and initialisation functions
| EST_WFST ()
| ?
| EST_WFST (const EST_WFST &wfst)
| ?
Reseting functions
void | init (int init_num_states=10)
| Clear with (estimation of number of states required).
void | init (LISP in, LISP out)
| clear an initialise with given input and out alphabets
void | copy (const EST_WFST &wfst)
| Copy from existing wfst.
void | clear ()
| clear removing existing states if any
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.
const EST_String & | in_symbol (int i) const
| Map input alphabet index to input symbol.
int | out_symbol (const EST_String &s) const
| Map output symbol to output alphabet index.
const EST_String & | out_symbol (int i) const
| Map output alphabet index to output symbol.
LISP | epsilon_label () const
| LISP for on epsilon symbols.
int | in_epsilon () const
| Internal index for input epsilon.
int | out_epsilon () const
| Internal index for output epsilon.
const EST_WFST_State * | state (int i) const
| Return internal state information.
EST_WFST_State * | state_non_const (int i)
| Return internal state information (non-const).
int | final (int i) const
| True if state {\tt i} is final.
const EST_Discrete & | in_symbols () const
| Accessing the input alphabet.
const EST_Discrete & | out_symbols () const
| Accessing the output alphabet.
file i/o
EST_write_status | save (const EST_String &filename, const EST_String type="ascii")
| ?
EST_write_status | save_binary (FILE *fd)
EST_read_status | load (const EST_String &filename)
| ?
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.
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.
int | transition (int state, const EST_String &in, const EST_String &out) const
| Find (first) new state given in and out strings.
int | transition (int state, const EST_String &inout) const
| Find (first) new state given in/out string.
int | transduce (int state, int in, int &out) const
| Transduce in to out from state.
int | transduce (int state, const EST_String &in, EST_String &out) const
| Transduce in to out (strings) from state.
void | transduce (int state, int in, wfst_translist &out) const
| Transduce in to list of transitions.
void | transition_all (int state, int in, int out, EST_WFST_MultiState *ms) const
| Find all possible transitions for given state/input/output.
Cumulation functions for adding collective probabilities
for transitions from data
int | cumulate () const
| Cumulation condition.
void | start_cumulate ()
| Clear and start cumulation.
void | stop_cumulate ()
| Stop cumulation and calculate probabilities on transitions.
WFST construction functions from external representations
int | add_state (enum wfst_state_type state_type)
| Add a new state, returns new name.
enum wfst_state_type | ms_type (EST_WFST_MultiState *ms) const
| Given a multi-state return type (final, ok, error).
void | build_wfst (int start, int end, LISP regex)
| Basic regex constructor.
void | build_and_transition (int start, int end, LISP conjunctions)
| Basic conjunction constructor.
void | build_or_transition (int start, int end, LISP disjunctions)
| Basic disjunction constructor.
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.
void | minimize (const EST_WFST &a)
| Build minimized form of a.
void | complement (const EST_WFST &a)
| Build complement of a.
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.
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.
void | add_epsilon_reachable (EST_WFST_MultiState *ms) const
| Extend multi-state with epsilon reachable states.
void | remove_error_states (const EST_WFST &a)
| Remove error states from the WFST.
EST_String | summary () const
EST_WFST & | operator= (const EST_WFST &a)
| ?

## Detailed Description

a call representing a weighted finite-state transducer

Definition at line 150 of file EST_WFST.h.

## Constructor & Destructor Documentation

## EST_WFST() [1/2]

EST_WFST::EST_WFST | ( |  | ) |

?

Definition at line 126 of file EST_WFST.cc.

## EST_WFST() [2/2]

EST_WFST::EST_WFST | ( | const EST_WFST & | wfst | ) |

inline

?

Definition at line 183 of file EST_WFST.h.

## ~EST_WFST()

EST_WFST::~EST_WFST | ( |  | ) |

Definition at line 110 of file EST_WFST.cc.

## Member Function Documentation

## init() [1/2]

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.

## init() [2/2]

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.

## copy()

void EST_WFST::copy | ( | const EST_WFST & | wfst | ) |

Copy from existing wfst.

Definition at line 132 of file EST_WFST.cc.

## clear()

void EST_WFST::clear | ( |  | ) |

clear removing existing states if any

Definition at line 115 of file EST_WFST.cc.

## num_states()

int EST_WFST::num_states | ( |  | ) | const

inline

Definition at line 201 of file EST_WFST.h.

## start_state()

int EST_WFST::start_state | ( |  | ) | const

inline

Definition at line 202 of file EST_WFST.h.

## in_symbol() [1/2]

int EST_WFST::in_symbol | ( | const EST_String & | s | ) | const

inline

Map input symbol to input alphabet index.

Definition at line 204 of file EST_WFST.h.

## in_symbol() [2/2]

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

inline

Map input alphabet index to input symbol.

Definition at line 207 of file EST_WFST.h.

## out_symbol() [1/2]

int EST_WFST::out_symbol | ( | const EST_String & | s | ) | const

inline

Map output symbol to output alphabet index.

Definition at line 210 of file EST_WFST.h.

## out_symbol() [2/2]

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

inline

Map output alphabet index to output symbol.

Definition at line 213 of file EST_WFST.h.

## epsilon_label()

LISP EST_WFST::epsilon_label | ( |  | ) | const

inline

LISP for on epsilon symbols.

Definition at line 216 of file EST_WFST.h.

## in_epsilon()

int EST_WFST::in_epsilon | ( |  | ) | const

inline

Internal index for input epsilon.

Definition at line 218 of file EST_WFST.h.

## out_epsilon()

int EST_WFST::out_epsilon | ( |  | ) | const

inline

Internal index for output epsilon.

Definition at line 220 of file EST_WFST.h.

## state()

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

inline

Return internal state information.

Definition at line 222 of file EST_WFST.h.

## state_non_const()

EST_WFST_State * EST_WFST::state_non_const | ( | int | i | ) |

inline

Return internal state information (non-const).

Definition at line 224 of file EST_WFST.h.

## final()

int EST_WFST::final | ( | int | i | ) | const

inline

True if state {\tt i} is final.

Definition at line 226 of file EST_WFST.h.

## in_symbols()

const EST_Discrete & EST_WFST::in_symbols | ( |  | ) | const

inline

Accessing the input alphabet.

Definition at line 229 of file EST_WFST.h.

## out_symbols()

const EST_Discrete & EST_WFST::out_symbols | ( |  | ) | const

inline

Accessing the output alphabet.

Definition at line 231 of file EST_WFST.h.

## save()

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

?

Definition at line 349 of file EST_WFST.cc.

## save_binary()

EST_write_status EST_WFST::save_binary | ( | FILE * | fd | ) |

Definition at line 304 of file EST_WFST.cc.

## load()

EST_read_status EST_WFST::load | ( | const EST_String & | filename | ) |

?

Definition at line 508 of file EST_WFST.cc.

## load_binary()

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.

## transition() [1/4]

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.

## transition() [2/4]

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

Definition at line 287 of file EST_WFST.cc.

## find_transition()

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.

## transition() [3/4]

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.

## transition() [4/4]

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.

## transduce() [1/3]

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.

## transduce() [2/3]

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.

## transduce() [3/3]

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.

## transition_all()

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.

## cumulate()

int EST_WFST::cumulate | ( |  | ) | const

inline

Cumulation condition.

Definition at line 277 of file EST_WFST.h.

## start_cumulate()

void EST_WFST::start_cumulate | ( | void |  | ) |

Clear and start cumulation.

Definition at line 670 of file EST_WFST.cc.

## stop_cumulate()

void EST_WFST::stop_cumulate | ( | void |  | ) |

Stop cumulation and calculate probabilities on transitions.

Definition at line 685 of file EST_WFST.cc.

## add_state()

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.

## ms_type()

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.

## build_wfst()

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

Basic regex constructor.

Definition at line 140 of file wfst_regex.cc.

## build_and_transition()

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

Basic conjunction constructor.

Definition at line 62 of file wfst_regex.cc.

## build_or_transition()

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

Basic disjunction constructor.

Definition at line 44 of file wfst_regex.cc.

## build_from_regex()

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

Definition at line 190 of file wfst_regex.cc.

## kkrule_compile()

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

Definition at line 231 of file kkcompile.cc.

## build_from_rg()

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.

## build_tree_lex()

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

Definition at line 98 of file tlcompile.cc.

## determinize()

void EST_WFST::determinize | ( | const EST_WFST & | a | ) |

Build determinized form of a.

Definition at line 164 of file wfst_ops.cc.

## minimize()

void EST_WFST::minimize | ( | const EST_WFST & | a | ) |

Build minimized form of a.

Definition at line 484 of file wfst_ops.cc.

## complement()

void EST_WFST::complement | ( | const EST_WFST & | a | ) |

Build complement of a.

Definition at line 646 of file wfst_ops.cc.

## intersection() [1/2]

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 356 of file wfst_ops.cc.

## intersection() [2/2]

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 470 of file wfst_ops.cc.

## uunion() [1/2]

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

## uunion() [2/2]

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 717 of file wfst_ops.cc.

## compose()

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 812 of file wfst_ops.cc.

## difference()

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 898 of file wfst_ops.cc.

## concat()

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 776 of file wfst_ops.cc.

## deterministic()

int EST_WFST::deterministic | ( |  | ) | const

True if WFST is deterministic.

Definition at line 975 of file wfst_ops.cc.

## apply_multistate()

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.

## add_epsilon_reachable()

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.

## remove_error_states()

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.

## summary()

EST_String EST_WFST::summary | ( |  | ) | const

Definition at line 630 of file EST_WFST.cc.

## operator=()

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

inline

?

Definition at line 364 of file EST_WFST.h.

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

- include/EST_WFST.h
- grammar/wfst/EST_WFST.cc
- grammar/wfst/kkcompile.cc
- grammar/wfst/rgcompile.cc
- grammar/wfst/tlcompile.cc
- grammar/wfst/wfst_ops.cc
- grammar/wfst/wfst_regex.cc