HFST - Helsinki Finite-State Transducer Technology API  version 3.7.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Static Public Member Functions | Static Protected Member Functions | List of all members
MyTransducerLibraryTransducer Class Reference

A skeleton library class that contains operations for a new transducer type that is added under the HFST interface. More...

#include <MyTransducerLibraryTransducer.h>

Static Public Member Functions

static bool are_equivalent (MyFst *t1, MyFst *t2)
 Whether transducers t1 an t2 are equivalent. More...
 
static MyFst * compose (MyFst *t1, MyFst *t2)
 Create a transducer that accepts string pair string1:string3 iff t1 accepts string pair string1:string2 and t2 accepts string pair string2:string3, where string2 is any string. More...
 
static MyFst * concatenate (MyFst *t1, MyFst *t2)
 Create a transducer that accepts a concatenation of any string pair accepted by t1 and any string pair accepted by t2. More...
 
static MyFst * copy (MyFst *t)
 Create a deep copy of transducer t. More...
 
static MyFst * create_empty_transducer (void)
 Create a transducer that does not recognise any string. More...
 
static MyFst * create_epsilon_transducer (void)
 Create a transducer that recognises the empty string. More...
 
static MyFst * define_transducer (const std::string &symbol)
 Create a transducer that recognises the symbol pair symbol:symbol. More...
 
static MyFst * define_transducer (const std::string &isymbol, const std::string &osymbol)
 Create a transducer that recognises the symbol pair isymbol:osymbol. More...
 
static MyFst * define_transducer (const StringPairVector &spv)
 Create a transducer that recognises the concatenation of symbol pairs in spv. More...
 
static MyFst * define_transducer (const StringPairSet &sps, bool cyclic=false)
 Create a transducer that recognises the union of symbol pairs in sps. If cyclic is true, any number of consecutive symbol pairs is recognised. More...
 
static MyFst * define_transducer (const std::vector< StringPairSet > &spsv)
 Crate a transducer that recognises the concatenation of symbol pair unions in spsv. More...
 
static MyFst * determinize (MyFst *t)
 Create a deterministic transducer equivalent to transducer t. More...
 
static MyFst * disjunct (MyFst *t1, MyFst *t2)
 Create a transducer that accepts any string pair accepted by t1 or t2. More...
 
static MyFst * disjunct (MyFst *t, const StringPairVector &spv)
 Disjunct t with a path transducer spv. More...
 
static MyFst * extract_input_language (MyFst *t)
 Create a transducer that accepts string pair string1:string1 iff transducer t accepts string pair string1:string2. More...
 
static MyFst * extract_output_language (MyFst *t)
 Create a transducer that accepts string pair string2:string2 iff transducer t accepts string pair string1:string2. More...
 
static std::vector< MyFst * > extract_paths (MyFst *t)
 A vector of transducers that each accept one string pair accepted by transducer t. t cannot be cyclic. More...
 
static void extract_paths (MyFst *t, hfst::ExtractStringsCb &callback, int cycles=-1, FdTable< unsigned int > *fd=NULL, bool filter_fd=false)
 TODO: document. More...
 
static FdTable< unsigned int > * get_flag_diacritics (MyFst *t)
 A table of numbers that represent flag diacritics in transducer t. More...
 
static StringPairSet get_symbol_pairs (MyFst *t)
 Get all symbol pairs that occur in transitions of transducer t. More...
 
static std::pair< MyFst
*, MyFst * > 
harmonize (MyFst *t1, MyFst *t2, bool unknown_symbols_in_use=true)
 Return a harmonized copy of transducers t1 and t2. More...
 
static MyFst * insert_freely (MyFst *t, const StringPair &symbol_pair)
 Create a transducer that accepts string pair of [ A:B* s A:B* t A:B* r A:B* i A:B* n A:B* g A:B* 1:2 A:B* ] (where A and B are input and output symbol of symbol_pair) iff transducer t accepts string pair string1:string2. More...
 
static MyFst * intersect (MyFst *t1, MyFst *t2)
 Create a transducer that accepts any string pair accepted by both t1 and t2. More...
 
static MyFst * invert (MyFst *t)
 Create a transducer that accepts string pair string2:string1 iff transducer t accepts string pair string1:string2. More...
 
static bool is_cyclic (MyFst *t)
 Whether transducer t is cyclic. More...
 
static MyFst * minimize (MyFst *t)
 Create a minimal transducer equivalent to transducer t. More...
 
static unsigned int number_of_states (MyFst *t)
 The number of states in transducer t. More...
 
static MyFst * optionalize (MyFst *t)
 Create a transducer that accepts string pairs accepted by transducer t or an empty string. More...
 
static MyFst * remove_epsilons (MyFst *t)
 Create an epsilon-free transducer equivalent to transducer t. More...
 
static MyFst * remove_from_alphabet (MyFst *t, const std::string &symbol)
 Remove symbol symbol from the alphabet of transducer t. More...
 
static MyFst * repeat_le_n (MyFst *t, unsigned int n)
 Create a transducer that accepts from zero to n consecutive string pairs accepted by transducer t. More...
 
static MyFst * repeat_n (MyFst *t, unsigned int n)
 Create a transducer that accepts n consecutive string pairs accepted by transducer t. More...
 
static MyFst * repeat_plus (MyFst *t)
 Create a transducer that accepts one or more consecutive string pairs accepted by transducer t. More...
 
static MyFst * repeat_star (MyFst *t)
 Create a transducer that accepts any number of consecutive string pairs accepted by transducer t. More...
 
static MyFst * reverse (MyFst *t)
 Create a transducer that accepts string pair 1gnirts:2gnirts iff transducer t accepts string pair string1:string2. More...
 
static MyFst * substitute (MyFst *t, String old_symbol, String new_symbol)
 Create a transducer equivalent to transducer t but where all symbols old_symbol are substituted with new_symbol. More...
 
static MyFst * substitute (MyFst *t, const StringPair &symbol_pair, MyFst *tr)
 Create a transducer equivalent to transducer t but where all symbol pairs symbol_pair are substituted with a copy of transducer tr. More...
 
static MyFst * subtract (MyFst *t1, MyFst *t2)
 Create a transducer that accepts any string pair accepted by t1 but not t2. More...
 

Static Protected Member Functions

static StringSet get_alphabet (MyFst *t)
 Get all symbols that occur in transitions of transducer t. More...
 
static void initialize_alphabet (MyFst *t)
 Add the following number-to-symbol correspondencies to the alphabet of transducer t: 0 : "@_EPSILON_SYMBOL_@" 1 : "@_UNKNOWN_SYMBOL_@" 2 : "@_IDENTITY_SYMBOL_@". More...
 

Detailed Description

A skeleton library class that contains operations for a new transducer type that is added under the HFST interface.

A transducer library that is added under HFST must implement these operations.

Member Function Documentation

bool are_equivalent ( MyFst *  t1,
MyFst *  t2 
)
static

Whether transducers t1 an t2 are equivalent.

MyFst * compose ( MyFst *  t1,
MyFst *  t2 
)
static

Create a transducer that accepts string pair string1:string3 iff t1 accepts string pair string1:string2 and t2 accepts string pair string2:string3, where string2 is any string.

MyFst * concatenate ( MyFst *  t1,
MyFst *  t2 
)
static

Create a transducer that accepts a concatenation of any string pair accepted by t1 and any string pair accepted by t2.

MyFst * copy ( MyFst *  t)
static

Create a deep copy of transducer t.

MyFst * create_empty_transducer ( void  )
static

Create a transducer that does not recognise any string.

MyFst * create_epsilon_transducer ( void  )
static

Create a transducer that recognises the empty string.

MyFst * define_transducer ( const std::string &  symbol)
static

Create a transducer that recognises the symbol pair symbol:symbol.

MyFst * define_transducer ( const std::string &  isymbol,
const std::string &  osymbol 
)
static

Create a transducer that recognises the symbol pair isymbol:osymbol.

MyFst * define_transducer ( const StringPairVector spv)
static

Create a transducer that recognises the concatenation of symbol pairs in spv.

MyFst * define_transducer ( const StringPairSet sps,
bool  cyclic = false 
)
static

Create a transducer that recognises the union of symbol pairs in sps. If cyclic is true, any number of consecutive symbol pairs is recognised.

MyFst * define_transducer ( const std::vector< StringPairSet > &  spsv)
static

Crate a transducer that recognises the concatenation of symbol pair unions in spsv.

MyFst * determinize ( MyFst *  t)
static

Create a deterministic transducer equivalent to transducer t.

MyFst * disjunct ( MyFst *  t1,
MyFst *  t2 
)
static

Create a transducer that accepts any string pair accepted by t1 or t2.

MyFst * disjunct ( MyFst *  t,
const StringPairVector spv 
)
static

Disjunct t with a path transducer spv.

MyFst * extract_input_language ( MyFst *  t)
static

Create a transducer that accepts string pair string1:string1 iff transducer t accepts string pair string1:string2.

MyFst * extract_output_language ( MyFst *  t)
static

Create a transducer that accepts string pair string2:string2 iff transducer t accepts string pair string1:string2.

std::vector< MyFst * > extract_paths ( MyFst *  t)
static

A vector of transducers that each accept one string pair accepted by transducer t. t cannot be cyclic.

void extract_paths ( MyFst *  t,
hfst::ExtractStringsCb &  callback,
int  cycles = -1,
FdTable< unsigned int > *  fd = NULL,
bool  filter_fd = false 
)
static

TODO: document.

StringSet get_alphabet ( MyFst *  t)
staticprotected

Get all symbols that occur in transitions of transducer t.

FdTable< unsigned int > * get_flag_diacritics ( MyFst *  t)
static

A table of numbers that represent flag diacritics in transducer t.

StringPairSet get_symbol_pairs ( MyFst *  t)
static

Get all symbol pairs that occur in transitions of transducer t.

std::pair< MyFst *, MyFst * > harmonize ( MyFst *  t1,
MyFst *  t2,
bool  unknown_symbols_in_use = true 
)
static

Return a harmonized copy of transducers t1 and t2.

First, all string symbols that are found in t2's alphabet but not in t1's alphabet are added to the alphabet of t1 to the next free positions (numbers). Then a copy of t2 is created where the string-to-number mappings are the same as in t1.

Next all unknown and identity symbols of t1 and t2 are expanded according to the alphabets of the transducers, i.e. an unknown or identity symbol in t2 is expanded to a set of all symbols known to t1 but unknown to t2 and vice versa.

Unknown and identity symbols are explained in more detail in (Ref.).

A false value of unknown_symbols_in_use may be used for optimization as no unknown or identity expanding is needed in that case.

void initialize_alphabet ( MyFst *  t)
staticprotected

Add the following number-to-symbol correspondencies to the alphabet of transducer t: 0 : "@_EPSILON_SYMBOL_@" 1 : "@_UNKNOWN_SYMBOL_@" 2 : "@_IDENTITY_SYMBOL_@".

MyFst * insert_freely ( MyFst *  t,
const StringPair symbol_pair 
)
static

Create a transducer that accepts string pair of [ A:B* s A:B* t A:B* r A:B* i A:B* n A:B* g A:B* 1:2 A:B* ] (where A and B are input and output symbol of symbol_pair) iff transducer t accepts string pair string1:string2.

MyFst * intersect ( MyFst *  t1,
MyFst *  t2 
)
static

Create a transducer that accepts any string pair accepted by both t1 and t2.

MyFst * invert ( MyFst *  t)
static

Create a transducer that accepts string pair string2:string1 iff transducer t accepts string pair string1:string2.

bool is_cyclic ( MyFst *  t)
static

Whether transducer t is cyclic.

MyFst * minimize ( MyFst *  t)
static

Create a minimal transducer equivalent to transducer t.

unsigned int number_of_states ( MyFst *  t)
static

The number of states in transducer t.

MyFst * optionalize ( MyFst *  t)
static

Create a transducer that accepts string pairs accepted by transducer t or an empty string.

MyFst * remove_epsilons ( MyFst *  t)
static

Create an epsilon-free transducer equivalent to transducer t.

MyFst * remove_from_alphabet ( MyFst *  t,
const std::string &  symbol 
)
static

Remove symbol symbol from the alphabet of transducer t.

MyFst * repeat_le_n ( MyFst *  t,
unsigned int  n 
)
static

Create a transducer that accepts from zero to n consecutive string pairs accepted by transducer t.

MyFst * repeat_n ( MyFst *  t,
unsigned int  n 
)
static

Create a transducer that accepts n consecutive string pairs accepted by transducer t.

MyFst * repeat_plus ( MyFst *  t)
static

Create a transducer that accepts one or more consecutive string pairs accepted by transducer t.

MyFst * repeat_star ( MyFst *  t)
static

Create a transducer that accepts any number of consecutive string pairs accepted by transducer t.

MyFst * reverse ( MyFst *  t)
static

Create a transducer that accepts string pair 1gnirts:2gnirts iff transducer t accepts string pair string1:string2.

MyFst * substitute ( MyFst *  t,
String  old_symbol,
String  new_symbol 
)
static

Create a transducer equivalent to transducer t but where all symbols old_symbol are substituted with new_symbol.

MyFst * substitute ( MyFst *  t,
const StringPair symbol_pair,
MyFst *  tr 
)
static

Create a transducer equivalent to transducer t but where all symbol pairs symbol_pair are substituted with a copy of transducer tr.

MyFst * subtract ( MyFst *  t1,
MyFst *  t2 
)
static

Create a transducer that accepts any string pair accepted by t1 but not t2.


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