MosesChartCmd::IOWrapper Class Reference

#include <IOWrapper.h>

Collaboration diagram for MosesChartCmd::IOWrapper:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 IOWrapper (const std::vector< Moses::FactorType > &inputFactorOrder, const std::vector< Moses::FactorType > &outputFactorOrder, const Moses::FactorMask &inputFactorUsed, size_t nBestSize, const std::string &nBestFilePath, const std::string &inputFilePath="")
 ~IOWrapper ()
Moses::InputTypeGetInput (Moses::InputType *inputType)
void OutputBestHypo (const Moses::ChartHypothesis *hypo, long translationId)
void OutputBestHypo (search::Applied applied, long translationId)
void OutputBestHypo (const std::vector< const Moses::Factor * > &mbrBestHypo, long translationId)
void OutputBestNone (long translationId)
void OutputNBestList (const Moses::ChartTrellisPathList &nBestList, long translationId)
void OutputNBestList (const std::vector< search::Applied > &nbest, long translationId)
void OutputDetailedTranslationReport (const Moses::ChartHypothesis *hypo, const Moses::Sentence &sentence, long translationId)
void Backtrack (const Moses::ChartHypothesis *hypo)
void ResetTranslationId ()
Moses::OutputCollectorGetSearchGraphOutputCollector ()
void OutputAlignment (size_t translationId, const Moses::ChartHypothesis *hypo)

Static Public Member Functions

static void FixPrecision (std::ostream &, size_t size=3)

Protected Types

typedef std::vector< std::pair
< Moses::Word,
Moses::WordsRange > > 
ApplicationContext
typedef std::set< std::pair
< size_t, size_t > > 
Alignments

Protected Member Functions

size_t OutputAlignmentNBest (Alignments &retAlign, const Moses::ChartTrellisNode &node, size_t startTarget)
size_t OutputAlignment (Alignments &retAlign, const Moses::ChartHypothesis *hypo, size_t startTarget)
void OutputAlignment (std::vector< std::set< size_t > > &retAlignmentsS2T, const Moses::AlignmentInfo &ai)
void OutputTranslationOptions (std::ostream &out, ApplicationContext &applicationContext, const Moses::ChartHypothesis *hypo, const Moses::Sentence &sentence, long translationId)
void ReconstructApplicationContext (const Moses::ChartHypothesis &hypo, const Moses::Sentence &sentence, ApplicationContext &context)
void WriteApplicationContext (std::ostream &out, const ApplicationContext &context)
void OutputAllFeatureScores (const Moses::ScoreComponentCollection &features, std::ostream &out)
void OutputFeatureScores (std::ostream &out, const Moses::ScoreComponentCollection &features, const Moses::FeatureFunction *ff, std::string &lastName)

Protected Attributes

long m_translationId
const std::vector
< Moses::FactorType > & 
m_inputFactorOrder
const std::vector
< Moses::FactorType > & 
m_outputFactorOrder
const Moses::FactorMaskm_inputFactorUsed
std::ostream * m_outputSearchGraphStream
std::ostream * m_detailedTranslationReportingStream
std::ostream * m_alignmentInfoStream
std::string m_inputFilePath
std::istream * m_inputStream
Moses::OutputCollectorm_detailOutputCollector
Moses::OutputCollectorm_nBestOutputCollector
Moses::OutputCollectorm_searchGraphOutputCollector
Moses::OutputCollectorm_singleBestOutputCollector
Moses::OutputCollectorm_alignmentInfoCollector


Detailed Description

Helper class that holds misc variables to write data out to command line.

Definition at line 61 of file IOWrapper.h.


Member Typedef Documentation

typedef std::set< std::pair<size_t, size_t> > MosesChartCmd::IOWrapper::Alignments [protected]

Definition at line 82 of file IOWrapper.h.

typedef std::vector<std::pair<Moses::Word, Moses::WordsRange> > MosesChartCmd::IOWrapper::ApplicationContext [protected]

Definition at line 64 of file IOWrapper.h.


Constructor & Destructor Documentation

MosesChartCmd::IOWrapper::IOWrapper ( const std::vector< Moses::FactorType > &  inputFactorOrder,
const std::vector< Moses::FactorType > &  outputFactorOrder,
const Moses::FactorMask inputFactorUsed,
size_t  nBestSize,
const std::string &  nBestFilePath,
const std::string &  inputFilePath = "" 
)

MosesChartCmd::IOWrapper::~IOWrapper (  ) 


Member Function Documentation

void MosesChartCmd::IOWrapper::Backtrack ( const Moses::ChartHypothesis hypo  ) 

Definition at line 204 of file IOWrapper.cpp.

References Moses::ChartHypothesis::GetId(), Moses::ChartHypothesis::GetPrevHypos(), and VERBOSE.

Referenced by OutputBestHypo().

Here is the call graph for this function:

Here is the caller graph for this function:

void MosesChartCmd::IOWrapper::FixPrecision ( std::ostream &  stream,
size_t  size = 3 
) [static]

Definition at line 560 of file IOWrapper.cpp.

Referenced by OutputBestHypo(), and OutputNBestList().

Here is the caller graph for this function:

InputType * MosesChartCmd::IOWrapper::GetInput ( Moses::InputType inputType  ) 

Definition at line 146 of file IOWrapper.cpp.

References Moses::InputType::GetTranslationId(), m_inputFactorOrder, m_inputStream, m_translationId, NULL, Moses::InputType::Read(), and Moses::InputType::SetTranslationId().

Referenced by ReadInput().

Here is the call graph for this function:

Here is the caller graph for this function:

Moses::OutputCollector* MosesChartCmd::IOWrapper::GetSearchGraphOutputCollector (  )  [inline]

Definition at line 121 of file IOWrapper.h.

References m_searchGraphOutputCollector.

Referenced by TranslationTask::Run().

Here is the caller graph for this function:

void MosesChartCmd::IOWrapper::OutputAlignment ( size_t  translationId,
const Moses::ChartHypothesis hypo 
)

Definition at line 666 of file IOWrapper.cpp.

References m_alignmentInfoCollector, OutputAlignment(), and Moses::OutputCollector::Write().

Here is the call graph for this function:

void MosesChartCmd::IOWrapper::OutputAlignment ( std::vector< std::set< size_t > > &  retAlignmentsS2T,
const Moses::AlignmentInfo ai 
) [protected]

size_t MosesChartCmd::IOWrapper::OutputAlignment ( Alignments retAlign,
const Moses::ChartHypothesis hypo,
size_t  startTarget 
) [protected]

size_t MosesChartCmd::IOWrapper::OutputAlignmentNBest ( Alignments retAlign,
const Moses::ChartTrellisNode node,
size_t  startTarget 
) [protected]

void MosesChartCmd::IOWrapper::OutputAllFeatureScores ( const Moses::ScoreComponentCollection features,
std::ostream &  out 
) [protected]

Definition at line 404 of file IOWrapper.cpp.

References Moses::FeatureFunction::GetScoreProducerDescription(), Moses::FeatureFunction::IsTuneable(), and OutputFeatureScores().

Referenced by OutputNBestList().

Here is the call graph for this function:

Here is the caller graph for this function:

void MosesChartCmd::IOWrapper::OutputBestHypo ( const std::vector< const Moses::Factor * > &  mbrBestHypo,
long  translationId 
)

Definition at line 217 of file IOWrapper.cpp.

References CHECK.

void MosesChartCmd::IOWrapper::OutputBestHypo ( search::Applied  applied,
long  translationId 
)

void MosesChartCmd::IOWrapper::OutputBestHypo ( const Moses::ChartHypothesis hypo,
long  translationId 
)

void MosesChartCmd::IOWrapper::OutputBestNone ( long  translationId  ) 

Definition at line 394 of file IOWrapper.cpp.

References m_singleBestOutputCollector, and Moses::OutputCollector::Write().

Referenced by TranslationTask::Run().

Here is the call graph for this function:

Here is the caller graph for this function:

void MosesChartCmd::IOWrapper::OutputDetailedTranslationReport ( const Moses::ChartHypothesis hypo,
const Moses::Sentence sentence,
long  translationId 
)

Definition at line 316 of file IOWrapper.cpp.

References CHECK, m_detailOutputCollector, NULL, OutputTranslationOptions(), and Moses::OutputCollector::Write().

Referenced by TranslationTask::Run().

Here is the call graph for this function:

Here is the caller graph for this function:

void MosesChartCmd::IOWrapper::OutputFeatureScores ( std::ostream &  out,
const Moses::ScoreComponentCollection features,
const Moses::FeatureFunction ff,
std::string &  lastName 
) [protected]

void MosesChartCmd::IOWrapper::OutputNBestList ( const std::vector< search::Applied > &  nbest,
long  translationId 
)

void MosesChartCmd::IOWrapper::OutputNBestList ( const Moses::ChartTrellisPathList nBestList,
long  translationId 
)

void MosesChartCmd::IOWrapper::OutputTranslationOptions ( std::ostream &  out,
ApplicationContext applicationContext,
const Moses::ChartHypothesis hypo,
const Moses::Sentence sentence,
long  translationId 
) [protected]

void MosesChartCmd::IOWrapper::ReconstructApplicationContext ( const Moses::ChartHypothesis hypo,
const Moses::Sentence sentence,
ApplicationContext context 
) [protected]

Definition at line 248 of file IOWrapper.cpp.

References end, Moses::ChartHypothesis::GetCurrSourceRange(), Moses::WordsRange::GetEndPos(), Moses::ChartHypothesis::GetPrevHypos(), Moses::WordsRange::GetStartPos(), and Moses::Sentence::GetWord().

Referenced by OutputTranslationOptions().

Here is the call graph for this function:

Here is the caller graph for this function:

void MosesChartCmd::IOWrapper::ResetTranslationId (  ) 

Definition at line 141 of file IOWrapper.cpp.

References m_translationId.

Referenced by GetIOWrapper().

Here is the caller graph for this function:

void MosesChartCmd::IOWrapper::WriteApplicationContext ( std::ostream &  out,
const ApplicationContext context 
) [protected]

Definition at line 279 of file IOWrapper.cpp.

Referenced by OutputTranslationOptions().

Here is the caller graph for this function:


Member Data Documentation

Definition at line 80 of file IOWrapper.h.

Referenced by OutputAlignment(), and ~IOWrapper().

Definition at line 73 of file IOWrapper.h.

Referenced by ~IOWrapper().

Definition at line 72 of file IOWrapper.h.

Referenced by ~IOWrapper().

Definition at line 76 of file IOWrapper.h.

Referenced by OutputDetailedTranslationReport(), and ~IOWrapper().

Definition at line 68 of file IOWrapper.h.

Referenced by GetInput().

Definition at line 70 of file IOWrapper.h.

Definition at line 74 of file IOWrapper.h.

Referenced by ~IOWrapper().

std::istream* MosesChartCmd::IOWrapper::m_inputStream [protected]

Definition at line 75 of file IOWrapper.h.

Referenced by GetInput(), and ~IOWrapper().

Definition at line 77 of file IOWrapper.h.

Referenced by OutputNBestList(), and ~IOWrapper().

Definition at line 69 of file IOWrapper.h.

Referenced by OutputNBestList().

Definition at line 71 of file IOWrapper.h.

Referenced by ~IOWrapper().

Definition at line 78 of file IOWrapper.h.

Referenced by GetSearchGraphOutputCollector(), and ~IOWrapper().

Definition at line 79 of file IOWrapper.h.

Referenced by OutputBestHypo(), OutputBestNone(), and ~IOWrapper().

Definition at line 66 of file IOWrapper.h.

Referenced by GetInput(), and ResetTranslationId().


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

Generated on Thu Jun 4 00:32:56 2015 for Moses by  doxygen 1.5.9