PCN Namespace Reference


Typedefs

typedef std::pair< std::pair
< std::string, std::vector
< float > >, size_t > 
CNAlt
typedef std::vector< CNAltCNCol
typedef std::vector< CNColCN

Functions

char get (const std::string &in, int c)
void eatws (const std::string &in, int &c)
std::string getEscapedString (const std::string &in, int &c)
float getFloat (const std::string &in, int &c)
int getInt (const std::string &in, int &c)
CNAlt getCNAlt (const std::string &in, int &c)
CNCol getCNCol (const std::string &in, int &c)
CN parsePCN (const std::string &in)

Variables

const std::string chars = "'\\"
const char & quote = chars[0]
const char & slash = chars[1]

Detailed Description

A couple of utilities to read .pcn files. A python-compatible format for encoding confusion networks and word lattices.


Typedef Documentation

typedef std::vector<CNCol> PCN::CN

Definition at line 38 of file PCNTools.h.

typedef std::pair<std::pair<std::string, std::vector<float> >, size_t> PCN::CNAlt

Definition at line 36 of file PCNTools.h.

typedef std::vector<CNAlt> PCN::CNCol

Definition at line 37 of file PCNTools.h.


Function Documentation

void PCN::eatws ( const std::string &  in,
int &  c 
) [inline]

Definition at line 21 of file PCNTools.cpp.

Referenced by getCNAlt(), getCNCol(), getEscapedString(), getFloat(), getInt(), and parsePCN().

Here is the caller graph for this function:

char PCN::get ( const std::string &  in,
int  c 
) [inline]

Definition at line 14 of file PCNTools.cpp.

CNAlt PCN::getCNAlt ( const std::string &  in,
int &  c 
)

Definition at line 73 of file PCNTools.cpp.

References eatws(), getEscapedString(), and getFloat().

Referenced by getCNCol().

Here is the call graph for this function:

Here is the caller graph for this function:

CNCol PCN::getCNCol ( const std::string &  in,
int &  c 
)

Definition at line 111 of file PCNTools.cpp.

References eatws(), and getCNAlt().

Referenced by parsePCN().

Here is the call graph for this function:

Here is the caller graph for this function:

std::string PCN::getEscapedString ( const std::string &  in,
int &  c 
)

Definition at line 29 of file PCNTools.cpp.

References eatws(), quote, and slash.

Referenced by getCNAlt().

Here is the call graph for this function:

Here is the caller graph for this function:

float PCN::getFloat ( const std::string &  in,
int &  c 
)

Definition at line 49 of file PCNTools.cpp.

References eatws().

Referenced by getCNAlt().

Here is the call graph for this function:

Here is the caller graph for this function:

int PCN::getInt ( const std::string &  in,
int &  c 
)

Definition at line 61 of file PCNTools.cpp.

References eatws().

Here is the call graph for this function:

CN PCN::parsePCN ( const std::string &  in  ) 

Given a string ((('foo',0.1,1),('bar',0.9,2)),...) representation of a word lattice in PCN format, return a CN object representing the lattice

Definition at line 140 of file PCNTools.cpp.

References eatws(), and getCNCol().

Referenced by Moses::WordLattice::Read().

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

const std::string PCN::chars = "'\\"

Definition at line 9 of file PCNTools.cpp.

const char& PCN::quote = chars[0]

Definition at line 10 of file PCNTools.cpp.

Referenced by getEscapedString().

const char& PCN::slash = chars[1]

Definition at line 11 of file PCNTools.cpp.

Referenced by getEscapedString().


Generated on Tue Feb 7 19:04:11 2012 for Moses by  doxygen 1.5.9