## Functions | |

TransducerHandle | longest_match_tokenizer (KeySet *keys, KeyTable *kt) |

Create a left to right longest match tokenizer for symbols in key set ks. | |

KeyTable * | recode_key_table (KeyTable *kt, const char *epsilon_replacement) |

Replace the epsilon in kt, with epsilon_replacement. | |

TransducerHandle | longest_match_tokenizer2 (KeyTable *kt) |

Create a left to right longest match tokenizer for symbols in key set ks. | |

void | write_runtime_transducer (TransducerHandle input, KeyTable *key_table, FILE *outstream) |

Write a transducer t with key table kt into file output_file. Write its symbols into the file with name symbol_file_name. | |

KeyVector * | tokenize_string (TransducerHandle tokenizer, const char *string, KeyTable *T) |

Change a string s into identity pair transducer as tokenised by tokeniser. | |

KeyVector * | longest_match_tokenize (TransducerHandle tokenizer, const char *string, KeyTable *kt) |

Use tokenizer to tokenize string. | |

KeyPairVector * | longest_match_tokenize_pair (TransducerHandle tokenizer, const char *string1, const char *string2, KeyTable *kt) |

Use tokenizer to tokenize string1 and string2 and align the tokenized strings to a key pair vector. | |

KeyPairVector * | tokenize_pair_string (TransducerHandle tokenizer, char *pair_string, KeyTable *T) |

Tokenise with tokeniser a string s of individual characters and colon separated pairs into transducer. | |

KeyPairVector * | tokenize_string_pair (TransducerHandle tokenizer, const char *i1, const char *i2, KeyTable *T) |

Change 2 strings to a transducer aligned character by character according to tokenisation by tokeniser. The path(s) of result of composition of of string’s UTF-8 representations against tokeniser are paired up to a new tokeniser from beginning to end. Empty spaces in the end are filled with ε’s. | |

TransducerHandle | repeat_n (TransducerHandle t, int n) |

t catenated n times. | |

TransducerHandle | repeat_le_n (TransducerHandle t, int n) |

Transducer t repeated at most n times. | |

TransducerHandle | create_empty_transducer () |

Create an empty transducer. | |

TransducerHandle | create_epsilon_transducer () |

Create an epsilon transducer. | |

TransducerHandle | define_transducer (KeyPair *Pi) |

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

TransducerHandle | define_transducer (Key k) |

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

TransducerHandle | define_transducer (KeyPairSet *Pi) |

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

TransducerHandle | define_transducer (KeySet *ss) |

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

KeyPairSet * | define_keypair_set (TransducerHandle t) |

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

void | delete_transducer (TransducerHandle t) |

Delete transducer t. | |

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, bool sum_weights) |

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

TransducerHandle | disjunct_as_trie (TransducerHandle t, KeyPairVector *key_string, float weight, bool sum_weights) |

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

TransducerHandle | make_replace_in_context (TransducerHandle t, Repl_Type type, ContextsHandle p, bool optional, KeyPairSet *Pi) |

A replace transducer that performs mapping t in context c. Repl_Type type defines whether left and right contexts are matched at the output or input level. optional defines if the mapping is optional. | |

TransducerHandle | negate (TransducerHandle t, KeyPairSet *Pi) |

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

TransducerHandle | insert_freely (TransducerHandle t, KeyPair *p) |

Freely insert key pair p into t. | |

TransducerHandle | make_rule (TransducerHandle t1, KeyPairSet *mappings, Twol_Type type, TransducerHandle t2, KeyPairSet *Pi) |

A transducer that performs mappings defined in KeyPairSet mappings in context defined by transducers t1 and t2 (t1 precedes and t2 follows). Twol_Type type defines the type of mapping (obligatory/optional/not allowed) in context and elsewhere. Pi defines the alphabet known to the rule. | |

TransducerHandle | make_restriction (TransducerHandle t, Twol_Type type, ContextsHandle p, int direction, KeyPairSet *Pi) |

A restriction transducer that performs the mapping t in all contexts of c. Twol_Type type defines the type of mapping (obligatory/optional/not allowed) in context and elsewhere. direction defines to which direction mapping can be done. | |

TransducerHandle | make_replace (TransducerHandle t, Repl_Type type, bool optional, KeyPairSet *Pi) |

A replace transducer that performs the mapping t everywhere. Repl_Type type defines whether left and right contexts are matched at the output or input level. optional defines if the mapping is optional. | |

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_transitions) |

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

TransducerHandle | determinize (TransducerHandle t) |

Determinize t. | |

TransducerHandle | compose (TransducerHandle t1, TransducerHandle t2, bool destructive) |

Composition of t1 and t2. | |

TransducerHandle | repeat_star (TransducerHandle t) |

Transducer t *. | |

TransducerHandle | repeat_plus (TransducerHandle t) |

Transducer t +. | |

TransducerHandle | shuffle (TransducerHandle t1, TransducerHandle t2) |

Shuffle t1 and t2. | |

TransducerHandle | optionalize (TransducerHandle t) |

Disjunction of t and epsilon. | |

TransducerHandle | concatenate (TransducerHandle t1, TransducerHandle t2) |

Concatenation of t1 and t2. | |

TransducerHandle | reverse (TransducerHandle t) |

Reverse transducer t. | |

TransducerHandle | invert (TransducerHandle t) |

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

TransducerHandle | extract_output_language (TransducerHandle t) |

Extract the output language of t. | |

TransducerHandle | extract_input_language (TransducerHandle t) |

Extract the input language of t. | |

TransducerHandle | add_input_language (TransducerHandle t, KeyPairSet *s) |

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

TransducerHandle | add_output_language (TransducerHandle t, KeyPairSet *s) |

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

TransducerHandle | intersect (TransducerHandle t1, TransducerHandle t2) |

Intersection of t1 and t2. | |

TransducerHandle | subtract (TransducerHandle t1, TransducerHandle t2) |

t1 minus t2. | |

TransducerHandle | disjunct (TransducerHandle t1, TransducerHandle t2) |

Disjunction of t1 and t2. | |

TransducerHandle | read_transducer (istream &is) |

Read transducer in binary form from input stream is. | |

TransducerHandle | read_transducer (istream &is, KeyTable *T) |

Read a transducer in binary form from input stream is and harmonize it according to the key table T. | |

TransducerHandle | read_transducer (const char *filename) |

Read a binary transducer from file filename. | |

TransducerHandle | harmonize_transducer (TransducerHandle t, KeyTable *T_old, KeyTable *T_new) |

Harmonize transducer t that uses key table T_old according to key table T _new. | |

bool | has_symbol_table (istream &is) |

Whether the transducer coming from istream is has a symbol table stored with it. | |

TransducerHandle | read_transducer_number (istream &is) |

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

TransducerHandle | read_transducer_text (istream &is, KeyTable *T, bool sfst) |

Make a transducer as defined in text form in istream is using the key-to-printname relations defined in key table T. The parameter sfst defines whether SFST text format is used, otherwise AT&T format is used. | |

void | write_transducer (TransducerHandle t, ostream &os, bool backwards_compatibility) |

Write Transducer t in binary form to ostream os. | |

void | write_transducer (TransducerHandle t, KeyTable *T, ostream &os, bool backwards_compatibility) |

Write t in binary form to output stream os. Key table T is stored with the transducer. | |

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

Write transducer t to file filename. | |

ContextsHandle | make_context (TransducerHandle t1, TransducerHandle t2) |

ContextsHandle with a context pair of left context t1 and right context t2. | |

ContextsHandle | append_context (ContextsHandle p1, ContextsHandle p2) |

Add contexts c2 to contexts c1 and return the updated c1. | |

void | print_transducer (TransducerHandle t, KeyTable *T, bool weights, ostream &ostr, bool old) |

Print transducer t in text format using the symbols defined in key table T. The parameter print_weights indicates whether weights are included, the output stream ostr indicates where printing is directed. Parameter old indicates whether transducer t should be printed in old SFST text format instead of AT&T format. | |

void | print_transducer_number (TransducerHandle t, bool weights, ostream &ostr) |

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

TransducerHandle | copy (TransducerHandle t) |

A deep copy of t. | |

bool | are_equivalent (TransducerHandle t1, TransducerHandle t2) |

Whether t1 and t2 are equivalent. | |

bool | is_subset (TransducerHandle t1, TransducerHandle t2) |

Whether t1 is a subset of t2. | |

bool | are_disjoint (TransducerHandle t1, TransducerHandle t2) |

Whether t1 and t2 have an empty intersection. | |

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, KeyVector *str) |

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. | |

TransducerHandle | add_weight (TransducerHandle t, float w) |

Add weight w to transducer t. | |

float | get_weight (TransducerHandle t) |

The total weight of one-path transducer t. | |

char * | transducer_to_pairstring (TransducerHandle t, KeyTable *T, bool spaces, bool epsilons) |

A pairstring representation of one-path transducer t using the symbols defined in key table T. spaces defines whether pairs are separated by spaces. | |

TransducerHandle | pairstring_to_transducer (const char *str, KeyTable *T) |

Create a one-path transducer as defined in pairstring form in str using the symbols defined in key table T. | |

TransducerHandle | find_best_paths (TransducerHandle t, int number_of_forms, bool unique) |

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 number_of_forms, bool unique) |

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

vector< TransducerHandle > | find_all_paths (TransducerHandle t, bool unique) |

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

TransducerHandle | intersecting_composition (TransducerHandle lexicon, vector< TransducerHandle > *rules, KeyTable *kt) |

The intersecting composition of t with the transducers in v. | |

int | read_format (istream &is) |

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

TransducerHandle | substitute_key (TransducerHandle t, Key k1, Key k2, bool ignore_epsilon_pairs) |

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_transducer (TransducerHandle t, KeyPair *s, TransducerHandle tr) |

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

TransducerHandle | substitute_with_pair (TransducerHandle t, KeyPair *s1, KeyPair *s2) |

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

TransducerHandle | remove_pair (TransducerHandle t, KeyPair *p) |

Remove transitions that are equal to key pair p. | |

KeySet * | define_key_set (TransducerHandle t) |

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

TransducerHandle | remove_pairs (TransducerHandle t, KeySet *ss) |

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

TransducerHandle | remove_epsilons (TransducerHandle t) |

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

State | create_state (TransducerHandle t) |

Create a state in transducer t. | |

State | set_final_state (State s, TransducerHandle t, float w) |

Set the state s in transducer t as final with weight w. | |

void | define_transition (TransducerHandle t, State orig, KeyPair *p, State target, float weight) |

Define a transition leaving from state orig in transducer t with key pair p, target state target and weight w. | |

State | get_initial_state (TransducerHandle t) |

Get initial state from transducer t. | |

bool | is_final_state (State s, TransducerHandle t) |

Whether state s in transducer t is final. | |

float | get_final_weight (State s, TransducerHandle t) |

Get the final weight of state s in transducer t. | |

KeyPair * | get_transition_keypair (Transition tr) |

Get the key pair of transition tr. | |

State | get_transition_to (Transition tr) |

Get the goal state of transition tr. | |

float | get_transition_weight (Transition tr) |

Get the weight of transition tr. | |

TransitionIterator | begin_ti (TransducerHandle t, State s) |

A transition iterator over transitions leaving from state s in transducer t. | |

void | next_ti (TransitionIterator &ti) |

Next transition in ti. | |

bool | is_end_ti (TransitionIterator ti) |

Whether transition iterator ti has passed the last transition. | |

Transition | get_ti_transition (TransitionIterator ti) |

Get the transition represented by transition iterator ti. | |

State | set_marked_state (State s, TransducerHandle t) |

Set the state s in transducer t as marked. | |

State | unset_marked_state (State s, TransducerHandle t) |

Unset the state s in transducer t as marked. | |

bool | is_marked (State s, TransducerHandle t) |

Whether state s in transducer t has been marked. |

Functions in the HFST namespace are implemented with SFST.

Unless otherwise specified:

- the functions delete their Transducer argument(s)
- the functions do not change their other arguments

Xerox transducer notations (http://www.xrce.xerox.com/competencies/content-analysis/fsCompiler/fssyntax.html) are used in the examples with the following added notation:

`[.]`

The wildcard symbol. Allows any single key pair defined in the KeyPairSet argument of a function.

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