Moses::PhraseDecoder Class Reference

#include <PhraseDecoder.h>

Collaboration diagram for Moses::PhraseDecoder:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 PhraseDecoder (PhraseDictionaryCompact &phraseDictionary, const std::vector< FactorType > *input, const std::vector< FactorType > *output, size_t numScoreComponent)
 ~PhraseDecoder ()
size_t Load (std::FILE *in)
TargetPhraseVectorPtr CreateTargetPhraseCollection (const Phrase &sourcePhrase, bool topLevel=false, bool eval=true)
TargetPhraseVectorPtr DecodeCollection (TargetPhraseVectorPtr tpv, BitWrapper<> &encodedBitStream, const Phrase &sourcePhrase, bool topLevel, bool eval)
void PruneCache ()

Protected Types

enum  Coding { None, REnc, PREnc }
typedef std::pair< unsigned
char, unsigned char > 
AlignPoint
typedef std::pair< unsigned,
unsigned > 
SrcTrg

Protected Member Functions

unsigned GetSourceSymbolId (std::string &s)
std::string GetTargetSymbol (unsigned id) const
size_t GetREncType (unsigned encodedSymbol)
size_t GetPREncType (unsigned encodedSymbol)
unsigned GetTranslation (unsigned srcIdx, size_t rank)
size_t GetMaxSourcePhraseLength ()
unsigned DecodeREncSymbol1 (unsigned encodedSymbol)
unsigned DecodeREncSymbol2Rank (unsigned encodedSymbol)
unsigned DecodeREncSymbol2Position (unsigned encodedSymbol)
unsigned DecodeREncSymbol3 (unsigned encodedSymbol)
unsigned DecodePREncSymbol1 (unsigned encodedSymbol)
int DecodePREncSymbol2Left (unsigned encodedSymbol)
int DecodePREncSymbol2Right (unsigned encodedSymbol)
unsigned DecodePREncSymbol2Rank (unsigned encodedSymbol)
std::string MakeSourceKey (std::string &)

Protected Attributes

enum Moses::PhraseDecoder::Coding m_coding
size_t m_numScoreComponent
bool m_containsAlignmentInfo
size_t m_maxRank
size_t m_maxPhraseLength
boost::unordered_map
< std::string, unsigned > 
m_sourceSymbolsMap
StringVector< unsigned char,
unsigned, std::allocator > 
m_sourceSymbols
StringVector< unsigned char,
unsigned, std::allocator > 
m_targetSymbols
std::vector< size_t > m_lexicalTableIndex
std::vector< SrcTrgm_lexicalTable
CanonicalHuffman< unsigned > * m_symbolTree
bool m_multipleScoreTrees
std::vector< CanonicalHuffman
< float > * > 
m_scoreTrees
CanonicalHuffman< AlignPoint > * m_alignTree
TargetPhraseCollectionCache m_decodingCache
PhraseDictionaryCompactm_phraseDictionary
const std::vector< FactorType > * m_input
const std::vector< FactorType > * m_output
std::string m_separator

Friends

class PhraseDictionaryCompact


Detailed Description

Definition at line 52 of file PhraseDecoder.h.


Member Typedef Documentation

typedef std::pair<unsigned char, unsigned char> Moses::PhraseDecoder::AlignPoint [protected]

Definition at line 58 of file PhraseDecoder.h.

typedef std::pair<unsigned, unsigned> Moses::PhraseDecoder::SrcTrg [protected]

Definition at line 59 of file PhraseDecoder.h.


Member Enumeration Documentation

enum Moses::PhraseDecoder::Coding [protected]

Enumerator:
None 
REnc 
PREnc 

Definition at line 61 of file PhraseDecoder.h.


Constructor & Destructor Documentation

Moses::PhraseDecoder::PhraseDecoder ( PhraseDictionaryCompact phraseDictionary,
const std::vector< FactorType > *  input,
const std::vector< FactorType > *  output,
size_t  numScoreComponent 
)

Definition at line 32 of file PhraseDecoder.cpp.

Moses::PhraseDecoder::~PhraseDecoder (  ) 

Definition at line 48 of file PhraseDecoder.cpp.

References m_alignTree, m_scoreTrees, and m_symbolTree.


Member Function Documentation

TargetPhraseVectorPtr Moses::PhraseDecoder::CreateTargetPhraseCollection ( const Phrase sourcePhrase,
bool  topLevel = false,
bool  eval = true 
)

TargetPhraseVectorPtr Moses::PhraseDecoder::DecodeCollection ( TargetPhraseVectorPtr  tpv,
BitWrapper<> &  encodedBitStream,
const Phrase sourcePhrase,
bool  topLevel,
bool  eval 
)

unsigned Moses::PhraseDecoder::DecodePREncSymbol1 ( unsigned  encodedSymbol  )  [inline, protected]

Definition at line 123 of file PhraseDecoder.cpp.

Referenced by DecodeCollection().

Here is the caller graph for this function:

int Moses::PhraseDecoder::DecodePREncSymbol2Left ( unsigned  encodedSymbol  )  [inline, protected]

Definition at line 128 of file PhraseDecoder.cpp.

Referenced by DecodeCollection().

Here is the caller graph for this function:

unsigned Moses::PhraseDecoder::DecodePREncSymbol2Rank ( unsigned  encodedSymbol  )  [inline, protected]

Definition at line 138 of file PhraseDecoder.cpp.

Referenced by DecodeCollection().

Here is the caller graph for this function:

int Moses::PhraseDecoder::DecodePREncSymbol2Right ( unsigned  encodedSymbol  )  [inline, protected]

Definition at line 133 of file PhraseDecoder.cpp.

Referenced by DecodeCollection().

Here is the caller graph for this function:

unsigned Moses::PhraseDecoder::DecodeREncSymbol1 ( unsigned  encodedSymbol  )  [inline, protected]

Definition at line 101 of file PhraseDecoder.cpp.

Referenced by DecodeCollection().

Here is the caller graph for this function:

unsigned Moses::PhraseDecoder::DecodeREncSymbol2Position ( unsigned  encodedSymbol  )  [inline, protected]

Definition at line 111 of file PhraseDecoder.cpp.

Referenced by DecodeCollection().

Here is the caller graph for this function:

unsigned Moses::PhraseDecoder::DecodeREncSymbol2Rank ( unsigned  encodedSymbol  )  [inline, protected]

Definition at line 106 of file PhraseDecoder.cpp.

Referenced by DecodeCollection().

Here is the caller graph for this function:

unsigned Moses::PhraseDecoder::DecodeREncSymbol3 ( unsigned  encodedSymbol  )  [inline, protected]

Definition at line 118 of file PhraseDecoder.cpp.

Referenced by DecodeCollection().

Here is the caller graph for this function:

size_t Moses::PhraseDecoder::GetMaxSourcePhraseLength (  )  [protected]

size_t Moses::PhraseDecoder::GetPREncType ( unsigned  encodedSymbol  )  [inline, protected]

Definition at line 85 of file PhraseDecoder.cpp.

Referenced by DecodeCollection().

Here is the caller graph for this function:

size_t Moses::PhraseDecoder::GetREncType ( unsigned  encodedSymbol  )  [inline, protected]

Definition at line 80 of file PhraseDecoder.cpp.

Referenced by DecodeCollection().

Here is the caller graph for this function:

unsigned Moses::PhraseDecoder::GetSourceSymbolId ( std::string &  s  )  [inline, protected]

Definition at line 61 of file PhraseDecoder.cpp.

References Moses::StringVector< ValueT, PosT, Allocator >::find(), m_sourceSymbols, and m_sourceSymbolsMap.

Referenced by DecodeCollection().

Here is the call graph for this function:

Here is the caller graph for this function:

std::string Moses::PhraseDecoder::GetTargetSymbol ( unsigned  id  )  const [inline, protected]

Definition at line 73 of file PhraseDecoder.cpp.

References m_targetSymbols, and Moses::StringVector< ValueT, PosT, Allocator >::size().

Referenced by DecodeCollection().

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned Moses::PhraseDecoder::GetTranslation ( unsigned  srcIdx,
size_t  rank 
) [inline, protected]

Definition at line 90 of file PhraseDecoder.cpp.

References m_lexicalTable, and m_lexicalTableIndex.

Referenced by DecodeCollection().

Here is the caller graph for this function:

size_t Moses::PhraseDecoder::Load ( std::FILE *  in  ) 

std::string Moses::PhraseDecoder::MakeSourceKey ( std::string &  source  )  [protected]

Definition at line 188 of file PhraseDecoder.cpp.

References m_separator.

Referenced by CreateTargetPhraseCollection().

Here is the caller graph for this function:

void Moses::PhraseDecoder::PruneCache (  ) 

Definition at line 457 of file PhraseDecoder.cpp.

References m_decodingCache, and Moses::TargetPhraseCollectionCache::Prune().

Referenced by Moses::PhraseDictionaryCompact::CleanUpAfterSentenceProcessing().

Here is the call graph for this function:

Here is the caller graph for this function:


Friends And Related Function Documentation

friend class PhraseDictionaryCompact [friend]

Definition at line 56 of file PhraseDecoder.h.


Member Data Documentation

Definition at line 80 of file PhraseDecoder.h.

Referenced by DecodeCollection(), Load(), and ~PhraseDecoder().

Definition at line 64 of file PhraseDecoder.h.

Referenced by DecodeCollection(), and Load().

Definition at line 82 of file PhraseDecoder.h.

Referenced by CreateTargetPhraseCollection(), DecodeCollection(), and PruneCache().

const std::vector<FactorType>* Moses::PhraseDecoder::m_input [protected]

Definition at line 88 of file PhraseDecoder.h.

Referenced by CreateTargetPhraseCollection(), and DecodeCollection().

std::vector<SrcTrg> Moses::PhraseDecoder::m_lexicalTable [protected]

Definition at line 73 of file PhraseDecoder.h.

Referenced by GetTranslation(), and Load().

std::vector<size_t> Moses::PhraseDecoder::m_lexicalTableIndex [protected]

Definition at line 72 of file PhraseDecoder.h.

Referenced by GetTranslation(), and Load().

Definition at line 66 of file PhraseDecoder.h.

Referenced by GetMaxSourcePhraseLength(), and Load().

size_t Moses::PhraseDecoder::m_maxRank [protected]

Definition at line 65 of file PhraseDecoder.h.

Referenced by DecodeCollection(), and Load().

Definition at line 77 of file PhraseDecoder.h.

Referenced by DecodeCollection(), and Load().

Definition at line 63 of file PhraseDecoder.h.

Referenced by DecodeCollection(), and Load().

const std::vector<FactorType>* Moses::PhraseDecoder::m_output [protected]

Definition at line 89 of file PhraseDecoder.h.

Referenced by DecodeCollection().

Definition at line 84 of file PhraseDecoder.h.

Referenced by CreateTargetPhraseCollection(), and DecodeCollection().

std::vector<CanonicalHuffman<float>*> Moses::PhraseDecoder::m_scoreTrees [protected]

Definition at line 78 of file PhraseDecoder.h.

Referenced by DecodeCollection(), Load(), and ~PhraseDecoder().

std::string Moses::PhraseDecoder::m_separator [protected]

Definition at line 91 of file PhraseDecoder.h.

Referenced by MakeSourceKey().

StringVector<unsigned char, unsigned, std::allocator> Moses::PhraseDecoder::m_sourceSymbols [protected]

Definition at line 69 of file PhraseDecoder.h.

Referenced by GetSourceSymbolId(), and Load().

boost::unordered_map<std::string, unsigned> Moses::PhraseDecoder::m_sourceSymbolsMap [protected]

Definition at line 68 of file PhraseDecoder.h.

Referenced by GetSourceSymbolId().

Definition at line 75 of file PhraseDecoder.h.

Referenced by DecodeCollection(), Load(), and ~PhraseDecoder().

StringVector<unsigned char, unsigned, std::allocator> Moses::PhraseDecoder::m_targetSymbols [protected]

Definition at line 70 of file PhraseDecoder.h.

Referenced by GetTargetSymbol(), and Load().


The documentation for this class was generated from the following files:

Generated on Thu Jul 6 00:33:38 2017 for Moses by  doxygen 1.5.9