Cambridge SMT System
|
Unit testing: String printing from lattice, multiepsilon composition, composition with failure transitions, generic weight mappers, multiple union of fsts, etc. More...
#include <openfst.h>
#include <googletesting.h>
#include "main.custom_assert.hpp"
#include "main.logger.hpp"
#include "lm/model.hh"
#include "lexicographic-tropical-tropical-incls.h"
#include "lexicographic-tropical-tropical-funcs.h"
#include "fstutils.hpp"
#include "fstutils.ftcompose.hpp"
#include "fstutils.multiepsiloncompose.hpp"
#include "fstutils.extractngrams.hpp"
#include "fstutils.applylmonthefly.hpp"
#include "fstutils.mapper.hpp"
#include "fstutils.multiunion.hpp"
#include "fstio.hpp"
#include <idbridge.hpp>
#include <hifst_enumerate_vocab.hpp>
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) |
Unit testing: String printing from lattice, multiepsilon composition, composition with failure transitions, generic weight mappers, multiple union of fsts, etc.
Definition in file fstutils.gtest.cpp.
int main | ( | int | argc, |
char ** | argv | ||
) |
Definition at line 450 of file fstutils.gtest.cpp.
TEST | ( | fstutils | , |
printstrings | |||
) |
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.
TEST | ( | fstutils | , |
applylmonthefly | |||
) |
Trivial testing simple language model application with kenlm.
Definition at line 159 of file fstutils.gtest.cpp.
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.
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.
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.
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.