Cambridge SMT System
fstutils.hpp File Reference

Utilites to extract vocabulary, pseudo-determinize lattices and build substring transducers. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  fst::hypcost
 Struct for priority queue comparison. More...
 
class  fst::CompareHyp
 Class used by priority queue to compare two hypotheses and decide which one wins. More...
 
class  fst::RelabelUtil< Arc >
 Utility functor for relabeling one or more lattices. Note that you can chain commands. See Unit test in fstutils.gtest.cpp for an example. More...
 

Namespaces

 fst
 

Macros

#define UNIT_COST_POSITIVE   1
 
#define UNIT_COST_NEGATIVE   -1
 

Functions

float fst::ZPosInfinity ()
 Just a wrapper to maintain compatibility with OpenFST 1.3.1, last version using kPosInfinity constant. More...
 
template<class Arc >
void fst::extractSourceVocabulary (const fst::VectorFst< Arc > &myfst, unordered_set< std::string > *vcb)
 Extract source (left-side) vocabulary from an fst. More...
 
template<class Arc >
void fst::extractSourceVocabulary (const fst::VectorFst< Arc > &myfst, unordered_set< unsigned > *vcb, unsigned offset=0)
 Extract source (left-side) vocabulary (integers) from an fst. More...
 
template<class Arc >
void fst::extractTargetVocabulary (const fst::VectorFst< Arc > &myfst, unordered_set< std::string > *vcb)
 Extract target (right-side) vocabulary from an fst. More...
 
template<class Arc >
void fst::buildSubstringTransducer (fst::VectorFst< Arc > *myfst)
 Builds substring version of an fst. This is a destructive implementation. More...
 
template<class Arc >
fst::VectorFst< Arc > * fst::EncodeDeterminizeMinimizeDecode (fst::VectorFst< Arc > *myfst)
 Encodes, determinizes, minimizes and decodes an fst. More...
 
template<class Arc >
void fst::EncodeDeterminizeMinimizeDecode (fst::Fst< Arc > const &myfst, fst::VectorFst< Arc > *out)
 
template<class Arc , class CharTypeT , class StringTypeT >
std::basic_string< CharTypeT > fst::FstGetBestHypothesis (const fst::VectorFst< Arc > &latfst)
 Takes the 1-best of an fst and converts to string. More...
 
template<class Arc , class CharTypeT >
void fst::FstGetBestHypothesis (const fst::VectorFst< Arc > &latfst, std::vector< CharTypeT > &hyp)
 
template<class Arc >
void fst::FstGetBestStringHypothesis (const fst::VectorFst< Arc > &latfst, std::string &hyp)
 
template<class Arc >
void fst::printstrings (const fst::VectorFst< Arc > &pcostslat, std::ostream *hyps, unsigned s=0)
 Trivial function that outputs all the hypothesis in the lattice with its cost. More...
 
template<class Arc >
void fst::printstrings (const fst::VectorFst< Arc > &fst, unordered_map< std::string, float > &finalhyps, bool input=true)
 Prints input/output strings - weight from a lattice as a hash. More...
 
unsigned fst::ShortestPathLength (const fst::VectorFst< fst::StdArc > *fst)
 
template<class Arc >
fst::VectorFst< Arc > * fst::PushWeightsToFinal (const fst::VectorFst< Arc > *fst)
 
fst::VectorFst< fst::LogArc > * fst::StdToLog (const fst::VectorFst< fst::StdArc > *fst)
 
fst::VectorFst< fst::StdArc > * fst::LogToStd (const fst::VectorFst< fst::LogArc > *fst)
 
fst::VectorFst< fst::StdArc > * fst::FstScaleWeights (fst::VectorFst< fst::StdArc > *fst, const double scale)
 
template<class Arc >
void fst::GetMinAndMaxHypothesisLength (const fst::VectorFst< Arc > *fst, unsigned &jMin, unsigned &jMax)
 
fst::StdArc::Label fst::GetFirstUnusedLabelId (const fst::VectorFst< fst::StdArc > *fst)
 
void fst::SetFinalStateCost (fst::MutableFst< fst::StdArc > *fst, const fst::StdArc::Weight cost)
 
template<class Arc >
void fst::string2fst (const std::string &sidxwords, fst::VectorFst< Arc > *fst, const std::string &tidxwords="", typename Arc::Weight finalweight=Arc::Weight::One())
 Convenience method that creates an fsa/fst from one/two string(s) of numbers. More...
 

Detailed Description

Utilites to extract vocabulary, pseudo-determinize lattices and build substring transducers.

Date
14-8-2012
Author
Gonzalo Iglesias

Definition in file fstutils.hpp.

Macro Definition Documentation

#define UNIT_COST_NEGATIVE   -1

Definition at line 411 of file fstutils.hpp.

#define UNIT_COST_POSITIVE   1

Definition at line 410 of file fstutils.hpp.