Cambridge SMT System
fstutils.gtest.cpp File Reference

Unit testing: String printing from lattice, multiepsilon composition, composition with failure transitions, generic weight mappers, multiple union of fsts, etc. More...

Include dependency graph for fstutils.gtest.cpp:

Go to the source code of this file.

Classes

struct  googletesting::RemoveWeight
 

Namespaces

 googletesting
 test-specific classes and functions
 

Functions

 TEST (fstutils, printstrings)
 
 TEST (fstutils, multiepsiloncomposition)
 
 TEST (fstutils, phicompose)
 Testing composition with failure transition phi. More...
 
 TEST (fstutils, applylmonthefly)
 Trivial testing simple language model application with kenlm. More...
 
 TEST (fstutils, genericweightautomapper)
 Test the generic weight automapper, with a trivial modification of the weights, i.e. remove weight. More...
 
 TEST (fstutils, genericweightmapper)
 Test the generic weight mapper, with a trivial modification of the weights, i.e. remove weight. More...
 
 TEST (fstutils, multiunionrational)
 
 TEST (fstutils, multiunionreplace)
 
 TEST (fstutils, extractngrams)
 
 TEST (fstutils, string2fst)
 
 TEST (fstutils, relabelutil)
 
int main (int argc, char **argv)
 

Detailed Description

Unit testing: String printing from lattice, multiepsilon composition, composition with failure transitions, generic weight mappers, multiple union of fsts, etc.

Date
8-8-2012
Author
Gonzalo Iglesias

Definition in file fstutils.gtest.cpp.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 450 of file fstutils.gtest.cpp.

TEST ( fstutils  ,
printstrings   
)

Definition at line 49 of file fstutils.gtest.cpp.

Here is the call graph for this function:

TEST ( fstutils  ,
multiepsiloncomposition   
)

Testing multiepsilon composition. You can use a matcher to say that in your world several labels should be treated as epsilons in this particular composition This should be equivalent to removing epsilons on the right side and composing

Don't add actual epsilons

Definition at line 88 of file fstutils.gtest.cpp.

TEST ( fstutils  ,
phicompose   
)

Testing composition with failure transition phi.

Definition at line 131 of file fstutils.gtest.cpp.

Here is the call graph for this function:

TEST ( fstutils  ,
applylmonthefly   
)

Trivial testing simple language model application with kenlm.

Definition at line 159 of file fstutils.gtest.cpp.

Here is the call graph for this function:

TEST ( fstutils  ,
genericweightautomapper   
)

Test the generic weight automapper, with a trivial modification of the weights, i.e. remove weight.

Definition at line 230 of file fstutils.gtest.cpp.

TEST ( fstutils  ,
genericweightmapper   
)

Test the generic weight mapper, with a trivial modification of the weights, i.e. remove weight.

Definition at line 246 of file fstutils.gtest.cpp.

Here is the call graph for this function:

TEST ( fstutils  ,
multiunionrational   
)

Now add another fst, and do the union

Create union of full fsts

Note that fst in a has been modified (union). Therefore the result of the unioon is modified too.

Not deterministic, cannot use Equivalent directly, but the following check will suffice

Definition at line 263 of file fstutils.gtest.cpp.

Here is the call graph for this function:

TEST ( fstutils  ,
multiunionreplace   
)

Exactly the same test

Now add another fst, and do the union

Create union of full fsts

Note that fst in a has been modified (union). Therefore the result of the unioon is modified too.

Not deterministic, cannot use Equivalent directly, but the following check will suffice

Definition at line 313 of file fstutils.gtest.cpp.

Here is the call graph for this function:

TEST ( fstutils  ,
extractngrams   
)

Definition at line 364 of file fstutils.gtest.cpp.

TEST ( fstutils  ,
string2fst   
)

Definition at line 392 of file fstutils.gtest.cpp.

TEST ( fstutils  ,
relabelutil   
)

Now lets replace a couple of symbols in the openfst way –

Definition at line 414 of file fstutils.gtest.cpp.

Here is the call graph for this function: