Transducer Layer


Datatypes



typedef TransducerHandle TransducerHandle
 A finite state transducer (FST).

Constructive and Destructive Functions for Elementary Transducers

TransducerHandle create_empty_transducer ()
 Create an empty transducer.
TransducerHandle create_epsilon_transducer ()
 Create an epsilon transducer.
TransducerHandle define_transducer (Key k)
 Create a transducer that accepts one occurrence of key identity pair k:k.
TransducerHandle define_transducer (KeyPair *p)
 Create a transducer that accepts one occurrence of key pair p.
TransducerHandle define_transducer (KeySet *ks)
 Create a transducer that accepts the union of the key identity pairs in a set ks.
TransducerHandle define_transducer (KeyPairSet *Pi)
 Create a transducer that accepts the union of the key pairs in a set Pi.
KeyPairSetdefine_keypair_set (TransducerHandle t)
 Define a set of pairs by collecting all key pairs in transducer t.
KeySetdefine_key_set (TransducerHandle t)
 Define a set of keys by collecting all keys in transducer t.
TransducerHandle add_weight (TransducerHandle t, float w)
 Add weight w to transducer t.
void delete_transducer (TransducerHandle t)
 Delete transducer t.

Basic Algebraic Functions

TransducerHandle compose (TransducerHandle t1, TransducerHandle t2, bool destructive=true)
 Composition of t1 and t2.
TransducerHandle concatenate (TransducerHandle t1, TransducerHandle t2)
 Concatenation of t1 and t2.
TransducerHandle copy (TransducerHandle t)
 A deep copy of t.
TransducerHandle disjunct (TransducerHandle t1, TransducerHandle t2)
 Disjunction of t1 and t2.
TransducerHandle disjunct_transducers_as_tries (TransducerHandle t1, TransducerHandle t2)
 Disjunction of t1 and t2 that are both tries. The resulting transducer is also a trie.
TransducerHandle disjunct_as_trie (TransducerHandle t, KeyVector *key_string, float weight=0, bool sum_weights=false)
 Add the KeyVector * key_string as a path to the trie t.
TransducerHandle disjunct_as_trie (TransducerHandle t, KeyPairVector *key_pair_string, float weight=0, bool sum_weights=false)
 Add the KeyPairVector * key_pair_string as a path to the trie t.
TransducerHandle extract_input_language (TransducerHandle t)
 Extract the input language of t.
TransducerHandle extract_output_language (TransducerHandle t)
 Extract the output language of t.
TransducerHandle intersect (TransducerHandle t1, TransducerHandle t2)
 Intersection of t1 and t2.
TransducerHandle intersecting_composition (TransducerHandle t, vector< TransducerHandle > *v, KeyTable *kt=NULL)
 The intersecting composition of t with the transducers in v.
TransducerHandle invert (TransducerHandle t)
 Switch input and output in the transition pairs of transducer t.
TransducerHandle negate (TransducerHandle t, KeyPairSet *Pi)
 Complement of t with regard to a set of key pairs Pi.
TransducerHandle optionalize (TransducerHandle t)
 Disjunction of t and epsilon.
TransducerHandle repeat_le_n (TransducerHandle t, int n)
 Transducer t repeated at most n times.
TransducerHandle repeat_n (TransducerHandle t, int n)
 t catenated n times.
TransducerHandle repeat_plus (TransducerHandle t)
 Transducer t +.
TransducerHandle repeat_star (TransducerHandle t)
 Transducer t *.
TransducerHandle reverse (TransducerHandle t)
 Reverse transducer t.
TransducerHandle subtract (TransducerHandle t1, TransducerHandle t2)
 t1 minus t2.

Substitution, Insertion and Removal functions

TransducerHandle add_input_language (TransducerHandle t, KeyPairSet *Pi)
 Add input language to t using a set of feasible pairs in Pi.
TransducerHandle add_output_language (TransducerHandle t, KeyPairSet *Pi)
 Add output language to t using a set of feasible pairs in Pi.
TransducerHandle insert_freely (TransducerHandle t, KeyPair *p)
 Freely insert key pair p into t.
TransducerHandle remove_pair (TransducerHandle t, KeyPair *p)
 Remove transitions that are equal to key pair p.
TransducerHandle remove_pairs (TransducerHandle t, KeySet *ks)
 Remove transitions where a key from ks is used on both the input and output sides.
TransducerHandle shuffle (TransducerHandle t1, TransducerHandle t2)
 Shuffle t1 and t2.
TransducerHandle substitute_key (TransducerHandle t, Key k1, Key k2, bool ignore_epsilon_pairs=false)
 In all transitions, substitute key k1 with key k2.
TransducerHandle substitute_key (TransducerHandle t, KeySet *ks, Key k2)
 In all transitions, if a key is equal to some key in key set ks, substitute it with key k2.
TransducerHandle substitute_with_pair (TransducerHandle t, KeyPair *p1, KeyPair *p2)
 Substitute all transitions equal to p1 with a copy of p2.
TransducerHandle substitute_with_transducer (TransducerHandle t, KeyPair *p, TransducerHandle tr)
 Substitute all transitions in transducer t equal to p with a copy of transducer tr.

Optimizing and Converting Functions

TransducerHandle determinize (TransducerHandle t)
 Determinize t.
vector< TransducerHandlefind_all_paths (TransducerHandle t, bool unique=false)
 Find all paths from initial to final state in transducer t. unique defines whether t is determinized before finding paths.
TransducerHandle find_best_paths (TransducerHandle t, int n, bool unique=false)
 n best paths from initial to final state in transducer t. unique defines whether equal paths are included only once.
TransducerHandle find_random_paths (TransducerHandle t, int max_number, bool unique=false)
 For unweighted transducers: find a maximum of max_number random paths in transducer t. unique defines whether equal paths are included only once.
TransducerHandle minimize (TransducerHandle t)
 Minimize t.
TransducerHandle push_weights (TransducerHandle t, bool initial)
 Push weights in transducer t towards the initial state, if initial is true, otherwise towards the final state.
TransducerHandle modify_weights (TransducerHandle t, float(*modify)(float), bool modify_transition_weights=false)
 Modify final weights of transducer t according to function modify. modify_transition_weights defines whether transition weights are modified as well.
TransducerHandle remove_epsilons (TransducerHandle t)
 Remove from t transitions whose input and output labels are epsilons.

Testing Functions

These functions do not delete their arguments.

bool are_equivalent (TransducerHandle t1, TransducerHandle t2)
 Whether t1 and t2 are equivalent.
bool are_disjoint (TransducerHandle t1, TransducerHandle t2)
 Whether t1 and t2 have an empty intersection.
float get_weight (TransducerHandle t)
 The total weight of one-path transducer t.
bool is_automaton (TransducerHandle t)
 Whether for every transition in t the input symbol is the same as the output symbol.
bool is_cyclic (TransducerHandle t)
 Whether t is cyclic.
bool is_infinitely_ambiguous (TransducerHandle t, bool output=true, KeyVector *kv=NULL)
 Whether t has infinitely many output strings for some input string (or for a certain input string kv), if output is true and whether it has infinitely many input strings for some output string (or for a certain output string kv), if output is false.
bool is_deterministic (TransducerHandle t)
 Whether t is deterministic.
bool is_empty (TransducerHandle t)
 Whether t is the empty transducer.
bool is_epsilon (TransducerHandle t)
 Whether t is the epsilon transducer.
bool is_minimal (TransducerHandle t)
 Whether t is a minimal transducer.
bool is_subset (TransducerHandle t1, TransducerHandle t2)
 Whether t1 is a subset of t2.
KeyVectorVectorlookup_all (TransducerHandle t, vector< Key > *input_string)
 Look up the output-strings corresponding to string input_string. Return NULL, if there are no output-strings for input-string.
KeyVectorlookup_first (TransducerHandle t, vector< Key > *input_string)
 Look up the first found output-string corresponding to string input_string. Return NULL, if there are no output-strings for input-string.

Input/Output Functions

Transducers in this layer are not aware of any restrictions to their alphabet or any attributes. Thus the file format for these transducers neither lists the known keys nor the properties of the transducer.

int read_format (istream &is=cin)
 Read the format of the next transducer in the input stream is.
TransducerHandle read_transducer (istream &is=cin)
 Read transducer in binary form from input stream is.
TransducerHandle read_transducer (const char *filename)
 Read a binary transducer from file filename.
TransducerHandle read_transducer_number (istream &is)
 Read a transducer in AT&T number format from istream is.
void write_transducer (TransducerHandle t, ostream &os=cout, bool backwards_compatibility=false)
 Write Transducer t in binary form to ostream os.
void write_transducer (TransducerHandle t, const char *filename, bool backwards_compatibility=false)
 Write transducer t to file filename.
void print_transducer_number (TransducerHandle t, bool print_weights=true, ostream &os=cout)
 Print transducer t in number format to ostream os. print_weights defines whether weights are printed.

Detailed Description

Datatypes and functions related to transducer calculus and support. This layer depends on the Key Layer .

Typedef Documentation

A finite state transducer (FST).

A FST is a weighted or an unweighted synchronous finite-state transducer i.e. an automaton representing a set of strings of symbol pairs.

Definition at line 21 of file transducer-layer.h.


Function Documentation

TransducerHandle add_input_language ( TransducerHandle  t,
KeyPairSet Pi 
)

Add input language to t using a set of feasible pairs in Pi.

Equivalent to a composition of transducer t and a transducer accepting any number of pairs in Pi.

Definition at line 1103 of file hofst.C.

TransducerHandle add_output_language ( TransducerHandle  t,
KeyPairSet Pi 
)

Add output language to t using a set of feasible pairs in Pi.

Equivalent to a composition of a transducer accepting any number of pairs in Pi and transducer t.

Definition at line 1128 of file hofst.C.

TransducerHandle add_weight ( TransducerHandle  t,
float  w 
)

Add weight w to transducer t.

Set the weights of all final states in transducer t to w.

Note:
Does nothing if the underlying library does not support weights.

Definition at line 934 of file hofst.C.

bool are_disjoint ( TransducerHandle  t1,
TransducerHandle  t2 
)

Whether t1 and t2 have an empty intersection.

Precondition:
t1 and t2 are deterministic
Postcondition:
t1 and t2 are not deleted.

Definition at line 1618 of file hofst.C.

bool are_equivalent ( TransducerHandle  t1,
TransducerHandle  t2 
)

Whether t1 and t2 are equivalent.

The same that has been said of alignment in function intersect goes for are_equivalent. For example, both [a:b] and [a:0 0:b] map the string "a" to "b", but they are not equivalent because the alignment is different.

Postcondition:
t1 and t2 are not deleted.

Definition at line 1718 of file hofst.C.

TransducerHandle compose ( TransducerHandle  t1,
TransducerHandle  t2,
bool  destructive = true 
)

Composition of t1 and t2.

Parameters:
t1 first transducer in composition operation
t2 second transducer in composition operation
destructive Whether the argument transducers are deleted.
Composition of t1 and t2 maps "a" to "c" iff t1 maps "a" to some "b" and t2 maps "b" to "c".

Postcondition:
The resulting transducer may be nondeterministic and not minimal. t1 and t2 are deleted.

Definition at line 390 of file hofst.C.

TransducerHandle concatenate ( TransducerHandle  t1,
TransducerHandle  t2 
)

Concatenation of t1 and t2.

If t1 maps the string "a" to "b" and t2 maps "c" to "d", then concatenation of t1 and t2 maps the string "ac" to "bd".

Postcondition:
The resulting transducer may contain epsilons and be nondeterministic and not minimal. t1 and t2 are deleted.

Definition at line 990 of file hofst.C.

A deep copy of t.

Postcondition:
t is not deleted.

Definition at line 998 of file hofst.C.

TransducerHandle create_empty_transducer (  ) 

Create an empty transducer.

Returns:
A transducer that has one state that is not final and has no transitions, i.e. does not accept any string.

Definition at line 899 of file hofst.C.

TransducerHandle create_epsilon_transducer (  ) 

Create an epsilon transducer.

Returns:
A transducer that has one state that is final and has no transitions, i.e. accepts the epsilon string.

Definition at line 904 of file hofst.C.

KeySet* define_key_set ( TransducerHandle  t  ) 

Define a set of keys by collecting all keys in transducer t.

Returns:
A set of keys that contains all keys that occur in transitions of transducer t.

Definition at line 686 of file hofst.C.

KeyPairSet* define_keypair_set ( TransducerHandle  t  ) 

Define a set of pairs by collecting all key pairs in transducer t.

Returns:
A set of pairs that contains all key pairs that occur in transitions of transducer t.

Definition at line 929 of file hofst.C.

TransducerHandle define_transducer ( KeyPairSet Pi  ) 

Create a transducer that accepts the union of the key pairs in a set Pi.

Returns:
A disjunction of all key pairs in Pi.

Definition at line 924 of file hofst.C.

TransducerHandle define_transducer ( KeySet ks  ) 

Create a transducer that accepts the union of the key identity pairs in a set ks.

Returns:
A disjunction of all key identity pairs in ks.

Definition at line 919 of file hofst.C.

TransducerHandle define_transducer ( KeyPair p  ) 

Create a transducer that accepts one occurrence of key pair p.

Returns:
A transducer that has one transition of key pair p.

Definition at line 914 of file hofst.C.

TransducerHandle define_transducer ( Key  k  ) 

Create a transducer that accepts one occurrence of key identity pair k:k.

Returns:
A transducer that has one transition of key identity pair k:k.

Definition at line 909 of file hofst.C.

void delete_transducer ( TransducerHandle  t  ) 

Delete transducer t.

Definition at line 971 of file hofst.C.

TransducerHandle determinize ( TransducerHandle  t  ) 

Determinize t.

Remove transitions whose input and output symbols are epsilons from t and determinize it. After determinization no state in t has two transitions with equal input and output labels.

Postcondition:
t is deleted.

Definition at line 466 of file hofst.C.

Disjunction of t1 and t2.

Disjunction of t1 and t2 maps "a" to "b" iff t1 and/or t2 maps "a" to "b".

Postcondition:
t1 and t2 are deleted. The resulting transducer may have epsilons.

Definition at line 1004 of file hofst.C.

TransducerHandle disjunct_as_trie ( TransducerHandle  t,
KeyPairVector key_pair_string,
float  weight = 0,
bool  sum_weights = false 
)

Add the KeyPairVector * key_pair_string as a path to the trie t.

See also:
disjunct_as_trie

Definition at line 2309 of file hofst.C.

TransducerHandle disjunct_as_trie ( TransducerHandle  t,
KeyVector key_string,
float  weight = 0,
bool  sum_weights = false 
)

Add the KeyVector * key_string as a path to the trie t.

Parameters:
t The trie where the path is added.
key_string A KeyVector representing the path.
weight The weight of the path.
sum_weights If the path already exists with a different weight: whether (1) a new path is added or (2) the weight of the old path is modified by summing the weights.

Definition at line 2302 of file hofst.C.

TransducerHandle disjunct_transducers_as_tries ( TransducerHandle  t1,
TransducerHandle  t2 
)

Disjunction of t1 and t2 that are both tries. The resulting transducer is also a trie.

Definition at line 2288 of file hofst.C.

TransducerHandle extract_input_language ( TransducerHandle  t  ) 

Extract the input language of t.

Maps "A" to "A" iff t maps "A" to some string "B". For example the argument transducer [ a:b [c:d | e:f] ] gives the result [ a:a [c:c | e:e] ].

Postcondition:
t is deleted.

Definition at line 1096 of file hofst.C.

TransducerHandle extract_output_language ( TransducerHandle  t  ) 

Extract the output language of t.

Maps "B" to "B" iff t maps some string "A" to "B". For example the argument transducer [ a:b [c:d | e:f] ] gives the result [ b:b [d:d | f:f] ].

Postcondition:
t is deleted.

Definition at line 1089 of file hofst.C.

vector<TransducerHandle> find_all_paths ( TransducerHandle  t,
bool  unique = false 
)

Find all paths from initial to final state in transducer t. unique defines whether t is determinized before finding paths.

Parameters:
t The transducer where best paths are searched. Cannot be cyclic.
unique Whether equal paths are included only once (i.e whether t is determinized before finding paths).

Definition at line 1225 of file hofst.C.

TransducerHandle find_best_paths ( TransducerHandle  t,
int  n,
bool  unique = false 
)

n best paths from initial to final state in transducer t. unique defines whether equal paths are included only once.

Returns n paths with smallest weight. If t is unweighted, returns n paths that are found first (not necessarily the shortest ones).

Parameters:
t The transducer where best paths are searched. Can be cyclic.
n Number of paths that are returned.
unique Whether equal paths are included only once (i.e whether t is determinized before finding paths).
Returns:
A disjunction of n best paths.

Definition at line 1181 of file hofst.C.

TransducerHandle find_random_paths ( TransducerHandle  t,
int  max_number,
bool  unique = false 
)

For unweighted transducers: find a maximum of max_number random paths in transducer t. unique defines whether equal paths are included only once.

For weighted transducer: the same as find_best_paths. For unweighted transducers, the paths returned and their number may vary randomly.

Parameters:
t The transducer where best paths are searched. Can be cyclic.
max_number A maximum number of paths that are returned.
unique Whether t is determinized before finding paths.

Definition at line 4541 of file hsfst.C.

float get_weight ( TransducerHandle  t  ) 

The total weight of one-path transducer t.

In HWFST: The sum of all transition weights and the final weight in transducer t. In HFST: Returns always zero.

Precondition:
t is a one-path transducer.

Definition at line 4530 of file hofst.C.

TransducerHandle insert_freely ( TransducerHandle  t,
KeyPair p 
)

Freely insert key pair p into t.

For example, freely inserting the key pair x:y into the transducer [a b] is equivalent to [x:y]* a [x:y]* b [x:y]*.

Postcondition:
t is deleted.

Definition at line 763 of file hofst.C.

Intersection of t1 and t2.

Maps string S_1 to string S_2 (length of both strings is n) iff both t1 and t2 map S_1 to S_2 by aligning the i:th symbol in S_1 with the i:th symbol in S_2 for all i in n.

For example, [a:b] and [a:0 0:b] both map a to b, but their intersection is empty because the alignment is different.

Postcondition:
t1 and t2 are deleted.

Definition at line 293 of file hofst.C.

TransducerHandle intersecting_composition ( TransducerHandle  t,
vector< TransducerHandle > *  v,
KeyTable kt = NULL 
)

The intersecting composition of t with the transducers in v.

Intersecting composition of the transducer t and the transducers in the vector v is equivalent to the composition of t with the intersection of the transducers in v. If kt is not NULL, then the keys in kt, which correspond to Xerox-style flag-diacritics will be treated as epsilons, i.e. the will be in the result-transducer, but will not affect the rules in any way.

Postcondition:
The transducer t is deleted.

The transducers in the vector v are deleted.

The vector v is deleted.

The result is not minimized.

Definition at line 5220 of file hofst.C.

TransducerHandle invert ( TransducerHandle  t  ) 

Switch input and output in the transition pairs of transducer t.

Inversion of t maps "A" to "B" iff t maps "B" to "A". For example inversion of [a:b c:d e:f] is [b:a d:c f:e].

Postcondition:
t is deleted.

Definition at line 1082 of file hofst.C.

bool is_automaton ( TransducerHandle  t  ) 

Whether for every transition in t the input symbol is the same as the output symbol.

Postcondition:
t is not deleted.

Definition at line 1430 of file hofst.C.

bool is_cyclic ( TransducerHandle  t  ) 

Whether t is cyclic.

Postcondition:
t is not deleted.

Definition at line 1435 of file hofst.C.

bool is_deterministic ( TransducerHandle  t  ) 

Whether t is deterministic.

Definition at line 1565 of file hofst.C.

bool is_empty ( TransducerHandle  t  ) 

Whether t is the empty transducer.

t is the empty transducer if it is equivalent to a transducer that has one state that is not final and has no transitions.

Postcondition:
t is not deleted.

Definition at line 1570 of file hofst.C.

bool is_epsilon ( TransducerHandle  t  ) 

Whether t is the epsilon transducer.

t is the epsilon transducer if it equivalent to a transducer that has one state that is final and has no transitions.

Postcondition:
t is not deleted.

Definition at line 1575 of file hofst.C.

bool is_infinitely_ambiguous ( TransducerHandle  t,
bool  output = true,
KeyVector kv = NULL 
)

Whether t has infinitely many output strings for some input string (or for a certain input string kv), if output is true and whether it has infinitely many input strings for some output string (or for a certain output string kv), if output is false.

Postcondition:
t is not deleted.

Definition at line 1546 of file hofst.C.

bool is_minimal ( TransducerHandle  t  ) 

Whether t is a minimal transducer.

Definition at line 1580 of file hofst.C.

bool is_subset ( TransducerHandle  t1,
TransducerHandle  t2 
)

Whether t1 is a subset of t2.

Definition at line 1698 of file hofst.C.

KeyVectorVector* lookup_all ( TransducerHandle  t,
vector< Key > *  input_string 
)

Look up the output-strings corresponding to string input_string. Return NULL, if there are no output-strings for input-string.

KeyVector* lookup_first ( TransducerHandle  t,
vector< Key > *  input_string 
)

Look up the first found output-string corresponding to string input_string. Return NULL, if there are no output-strings for input-string.

TransducerHandle minimize ( TransducerHandle  t  ) 

Minimize t.

Remove epsilons from t and determinize and minimize it.

Postcondition:
t is deleted.
See also:
remove_epsilons determinize

Definition at line 472 of file hofst.C.

TransducerHandle modify_weights ( TransducerHandle  t,
float(*)(float)  modify,
bool  modify_transition_weights = false 
)

Modify final weights of transducer t according to function modify. modify_transition_weights defines whether transition weights are modified as well.

Definition at line 945 of file hofst.C.

TransducerHandle negate ( TransducerHandle  t,
KeyPairSet Pi 
)

Complement of t with regard to a set of key pairs Pi.

Complement is computed by subtraction: ~t = [.*] - t

Complement of transducer [t] maps the string 'a_1a_2 ... a_n' to 'b_1b_2 ... b_n' iff Pi contains 'a_i:b_i' for all 1 <= i <= n, and t & [a_1:b_1 a_2:b_2 ... a_n:b_n] is the empty transducer. Either a_i or b_i is allowed to be the empty symbol.

The same that has been said of alignment in function intersect goes for negation. For example, both [a:b] and [a:0 0:b] map the string "a" to "b", but the complement of [a:b] nevertheless includes 'a:0 0:b' because the alignment is different.

Postcondition:
t is deleted.

Definition at line 411 of file hofst.C.

TransducerHandle optionalize ( TransducerHandle  t  ) 

Disjunction of t and epsilon.

Postcondition:
t is deleted.

Definition at line 1012 of file hofst.C.

void print_transducer_number ( TransducerHandle  t,
bool  print_weights = true,
ostream &  os = cout 
)

Print transducer t in number format to ostream os. print_weights defines whether weights are printed.

See also:
print_transducer

Definition at line 2598 of file hofst.C.

TransducerHandle push_weights ( TransducerHandle  t,
bool  initial 
)

Push weights in transducer t towards the initial state, if initial is true, otherwise towards the final state.

Note:
Does nothing if the underlying implementation does not support weights.

Definition at line 1161 of file hofst.C.

int read_format ( istream &  is = cin  ) 

Read the format of the next transducer in the input stream is.

Returns:
  • 0 == ordinary unweighted transducer (HFST)
  • 1 == weighted transducer (HWFST)
  • 2 == compact unweighted transducer (HFST)
  • -1 == the end of file has been reached
  • -2 == transducer format is unknown or an error has occurred
Postcondition:
is is not changed.

Definition at line 1737 of file hofst.C.

TransducerHandle read_transducer ( const char *  filename  ) 

Read a binary transducer from file filename.

Definition at line 3382 of file hsfst.C.

TransducerHandle read_transducer ( istream &  is = cin  ) 

Read transducer in binary form from input stream is.

Definition at line 1765 of file hofst.C.

TransducerHandle read_transducer_number ( istream &  is  ) 

Read a transducer in AT&T number format from istream is.

See also:
read_transducer_text

Definition at line 5146 of file hofst.C.

TransducerHandle remove_epsilons ( TransducerHandle  t  ) 

Remove from t transitions whose input and output labels are epsilons.

Create an equivalent transducer that has no transitions whose input and output labels are epsilons.

Definition at line 431 of file hofst.C.

TransducerHandle remove_pair ( TransducerHandle  t,
KeyPair p 
)

Remove transitions that are equal to key pair p.

Definition at line 702 of file hofst.C.

TransducerHandle remove_pairs ( TransducerHandle  t,
KeySet ks 
)

Remove transitions where a key from ks is used on both the input and output sides.

Definition at line 725 of file hofst.C.

TransducerHandle repeat_le_n ( TransducerHandle  t,
int  n 
)

Transducer t repeated at most n times.

Definition at line 1032 of file hofst.C.

TransducerHandle repeat_n ( TransducerHandle  t,
int  n 
)

t catenated n times.

Parameters:
t Transducer to be catenated.
n How many times t is catenated. If n == 0, an epsilon transducer is returned.
Postcondition:
t is not deleted. [actually it cannot be used]

Definition at line 1018 of file hofst.C.

TransducerHandle repeat_plus ( TransducerHandle  t  ) 

Transducer t +.

Transducer that accepts one or more t.

Postcondition:
t is deleted.

Definition at line 1054 of file hofst.C.

TransducerHandle repeat_star ( TransducerHandle  t  ) 

Transducer t *.

Transducer that accepts any number of t.

Postcondition:
t is deleted.

Definition at line 1047 of file hofst.C.

TransducerHandle reverse ( TransducerHandle  t  ) 

Reverse transducer t.

Definition at line 1074 of file hofst.C.

Shuffle t1 and t2.

...

Definition at line 1062 of file hofst.C.

TransducerHandle substitute_key ( TransducerHandle  t,
KeySet ks,
Key  k2 
)

In all transitions, if a key is equal to some key in key set ks, substitute it with key k2.

Definition at line 528 of file hofst.C.

TransducerHandle substitute_key ( TransducerHandle  t,
Key  k1,
Key  k2,
bool  ignore_epsilon_pairs = false 
)

In all transitions, substitute key k1 with key k2.

Parameters:
t Transducer where substitution is made.
k1 The key that is substituted.
k2 The substituting key.
ignore_epsilon_pairs Whether keys in epsilon:epsilon transitions are not substituted.

Definition at line 506 of file hofst.C.

TransducerHandle substitute_with_pair ( TransducerHandle  t,
KeyPair p1,
KeyPair p2 
)

Substitute all transitions equal to p1 with a copy of p2.

Definition at line 551 of file hofst.C.

TransducerHandle substitute_with_transducer ( TransducerHandle  t,
KeyPair p,
TransducerHandle  tr 
)

Substitute all transitions in transducer t equal to p with a copy of transducer tr.

Definition at line 645 of file hofst.C.

t1 minus t2.

t1 minus t2 is the transducer which accepts the strings accepted by t1 that are not accepted by t2. The same that has been said of alignment in function intersect goes for subtraction.

For example, both [a:b] and [a:0 0:b] map the string a to b, but the result of a:b - [a:0 0:b] is nevertheless [a:b] because the alignment is different.

Postcondition:
t1 and t2 are deleted.

Definition at line 342 of file hofst.C.

void write_transducer ( TransducerHandle  t,
const char *  filename,
bool  backwards_compatibility = false 
)

Write transducer t to file filename.

See also:
write_transducer

Definition at line 1825 of file hofst.C.

void write_transducer ( TransducerHandle  t,
ostream &  os = cout,
bool  backwards_compatibility = false 
)

Write Transducer t in binary form to ostream os.

Parameters:
t The transducer that is written.
os The output stream where the transducer is written.
backwards_compatibility Whether the transducer is stored in SFST/OpenFst compatible format.

Definition at line 1810 of file hofst.C.


Generated on Tue Sep 29 11:43:34 2009 for Helsinki Finite-State Transducer Technology (HFST) interface by  doxygen 1.5.8