Cambridge SMT System
printstrings.main.cpp File Reference

Main file for printstrings tool. More...

Include dependency graph for printstrings.main.cpp:

Go to the source code of this file.

Classes

struct  HypW< Arc >
 Same as Hyp but the printing will convert integer ids to words. More...
 

Typedefs

typedef std::unordered_map< std::size_t, std::string > labelmap_t
 
typedef labelmap_t::iterator labelmap_iterator_t
 

Functions

template<class ArcT >
VectorFst< ArcT > * createIntersectionSpace (std::string const &filename)
 
template<class Arc >
void printWeight (typename Arc::Weight const &weight, std::ostream &os, unsigned precision=myPrecision)
 Templated method that prints an arc weight. By default, reuses the operator<< already defined for each weight. More...
 
template<>
void printWeight< TupleArc32 > (const TupleW32 &weight, std::ostream &os, unsigned precision)
 Template specialization of printWeight for a tropical sparse tuple weight. Uses the global var sparseformat. For the non sparse format, the comma separator is hard coded. More...
 
ucam::fsttools::SentenceIdx RemoveUnprintable (const ucam::fsttools::SentenceIdx &h)
 
template<class Arc >
std::ostream & operator<< (std::ostream &os, const Hyp< Arc > &obj)
 Operator<< overloading to print a hypothesis. More...
 
template<class Arc >
std::ostream & operator<< (std::ostream &os, const HypW< Arc > &obj)
 Operator<< overloading to print a hypothesis. Integer are converted to words using the global variable wmap. More...
 
template<class Arc , class HypT >
int run (ucam::util::RegistryPO const &rg)
 
int main (int argc, const char *argv[])
 

Variables

labelmap_t vmap
 
string vmapfile
 
bool printweight = false
 
bool sparseformat = false
 
bool nohyps = false
 
bool liblinrankformat = false
 
bool dotProduct = false
 
unsigned myPrecision = 6
 

Detailed Description

Main file for printstrings tool.

Date
8-8-2012
Author
Gonzalo Iglesias

Definition in file printstrings.main.cpp.

Typedef Documentation

typedef labelmap_t::iterator labelmap_iterator_t

Definition at line 13 of file printstrings.main.cpp.

typedef std::unordered_map<std::size_t, std::string> labelmap_t

Definition at line 12 of file printstrings.main.cpp.

Function Documentation

template<class ArcT >
VectorFst<ArcT>* createIntersectionSpace ( std::string const &  filename)

Definition at line 31 of file printstrings.main.cpp.

Here is the call graph for this function:

int main ( int  argc,
const char *  argv[] 
)

Definition at line 408 of file printstrings.main.cpp.

Here is the call graph for this function:

template<class Arc >
std::ostream& operator<< ( std::ostream &  os,
const Hyp< Arc > &  obj 
)

Operator<< overloading to print a hypothesis.

Definition at line 184 of file printstrings.main.cpp.

template<class Arc >
std::ostream& operator<< ( std::ostream &  os,
const HypW< Arc > &  obj 
)

Operator<< overloading to print a hypothesis. Integer are converted to words using the global variable wmap.

Definition at line 204 of file printstrings.main.cpp.

template<class Arc >
void printWeight ( typename Arc::Weight const &  weight,
std::ostream &  os,
unsigned  precision = myPrecision 
)

Templated method that prints an arc weight. By default, reuses the operator<< already defined for each weight.

Parameters
weightThe arc weight to be printed
osThe output stream to print to

Definition at line 83 of file printstrings.main.cpp.

template<>
void printWeight< TupleArc32 > ( const TupleW32 weight,
std::ostream &  os,
unsigned  precision 
)

Template specialization of printWeight for a tropical sparse tuple weight. Uses the global var sparseformat. For the non sparse format, the comma separator is hard coded.

Parameters
weightThe arc weight to be printed
sparseformatWhether to print in sparse format or not.
osThe output stream to print to

Definition at line 99 of file printstrings.main.cpp.

Here is the call graph for this function:

ucam::fsttools::SentenceIdx RemoveUnprintable ( const ucam::fsttools::SentenceIdx h)

Definition at line 166 of file printstrings.main.cpp.

Here is the caller graph for this function:

template<class Arc , class HypT >
int run ( ucam::util::RegistryPO const &  rg)

Definition at line 227 of file printstrings.main.cpp.

Here is the call graph for this function:

Variable Documentation

bool dotProduct = false

Definition at line 20 of file printstrings.main.cpp.

bool liblinrankformat = false

Definition at line 19 of file printstrings.main.cpp.

unsigned myPrecision = 6

Definition at line 21 of file printstrings.main.cpp.

bool nohyps = false

Definition at line 18 of file printstrings.main.cpp.

bool printweight = false

Definition at line 16 of file printstrings.main.cpp.

bool sparseformat = false

Definition at line 17 of file printstrings.main.cpp.

labelmap_t vmap

Definition at line 14 of file printstrings.main.cpp.

string vmapfile

Definition at line 15 of file printstrings.main.cpp.