#include <ChartManager.h>
Public Member Functions | |
ChartManager (ttasksptr const &ttask) | |
~ChartManager () | |
void | Decode () |
decode the sentence. This contains the main laps. Basically, the CKY++ algorithm | |
void | AddXmlChartOptions () |
const ChartHypothesis * | GetBestHypothesis () const |
get best complete translation from the top chart cell. | |
void | CalcNBest (size_t n, std::vector< boost::shared_ptr< ChartKBestExtractor::Derivation > > &nBestList, bool onlyDistinct=false) const |
void | OutputSearchGraphMoses (std::ostream &outputSearchGraphStream) const |
void | OutputSearchGraphAsHypergraph (std::ostream &outputSearchGraphStream) const |
SentenceStats & | GetSentenceStats () const |
debug data collected when decoding sentence | |
const ChartCellCollection & | GetChartCellCollection () const |
void | CalcDecoderStatistics () const |
void | ResetSentenceStats (const InputType &source) |
unsigned | GetNextHypoId () |
contigious hypo id for each input sentence. For debugging purposes | |
const ChartParser & | GetParser () const |
void | OutputBest (OutputCollector *collector) const |
void | OutputNBest (OutputCollector *collector) const |
void | OutputLatticeSamples (OutputCollector *collector) const |
void | OutputAlignment (OutputCollector *collector) const |
void | OutputDetailedTranslationReport (OutputCollector *collector) const |
void | OutputUnknowns (OutputCollector *collector) const |
void | OutputDetailedTreeFragmentsTranslationReport (OutputCollector *collector) const |
void | OutputWordGraph (OutputCollector *collector) const |
void | OutputSearchGraph (OutputCollector *collector) const |
void | OutputSearchGraphSLF () const |
Definition at line 44 of file ChartManager.h.
Moses::ChartManager::ChartManager | ( | ttasksptr const & | ttask | ) |
Definition at line 48 of file ChartManager.cpp.
Moses::ChartManager::~ChartManager | ( | ) |
void Moses::ChartManager::AddXmlChartOptions | ( | ) |
add specific translation options and hypotheses according to the XML override translation scheme. Doesn't seem to do anything about walls and zones.
Definition at line 130 of file ChartManager.cpp.
References Moses::ChartCell::AddHypothesis(), Moses::ChartHypothesis::EvaluateWhenApplied(), Moses::ChartCellCollection::Get(), Moses::ChartTranslationOptions::GetSourceWordsRange(), Moses::InputType::GetXmlChartTranslationOptions(), IFVERBOSE, Moses::BaseManager::m_source, and range.
Referenced by Decode().
void Moses::ChartManager::CalcDecoderStatistics | ( | ) | const [inline, virtual] |
void Moses::ChartManager::CalcNBest | ( | size_t | n, | |
std::vector< boost::shared_ptr< ChartKBestExtractor::Derivation > > & | nBestList, | |||
bool | onlyDistinct = false | |||
) | const |
void Moses::ChartManager::Decode | ( | ) | [virtual] |
decode the sentence. This contains the main laps. Basically, the CKY++ algorithm
Implements Moses::BaseManager.
Definition at line 67 of file ChartManager.cpp.
References AddXmlChartOptions(), Moses::ChartTranslationOptionList::ApplyThreshold(), Moses::ChartCell::CleanupArcList(), Moses::ChartTranslationOptionList::Clear(), Moses::ChartParser::Create(), Moses::ChartCell::Decode(), Moses::ChartTranslationOptionList::EvaluateWithSourceContext(), Moses::ChartCellCollection::Get(), Moses::ChartParser::GetInputPath(), Moses::ChartCell::GetSize(), Moses::InputType::GetSize(), IFVERBOSE, Moses::BaseManager::m_source, Moses::BaseManager::options(), Moses::ChartCell::PruneToSize(), range, ResetSentenceStats(), Moses::ChartCell::SortHypotheses(), and VERBOSE.
const ChartHypothesis * Moses::ChartManager::GetBestHypothesis | ( | ) | const |
get best complete translation from the top chart cell.
Definition at line 156 of file ChartManager.cpp.
References Moses::ChartCellCollection::Get(), Moses::ChartCell::GetBestHypothesis(), Moses::InputType::GetSize(), Moses::BaseManager::m_source, NULL, and range.
Referenced by OutputAlignment(), OutputBest(), OutputDetailedTranslationReport(), and OutputDetailedTreeFragmentsTranslationReport().
const ChartCellCollection& Moses::ChartManager::GetChartCellCollection | ( | ) | const [inline] |
Definition at line 123 of file ChartManager.h.
unsigned Moses::ChartManager::GetNextHypoId | ( | ) | [inline] |
contigious hypo id for each input sentence. For debugging purposes
Definition at line 135 of file ChartManager.h.
const ChartParser& Moses::ChartManager::GetParser | ( | ) | const [inline] |
Definition at line 139 of file ChartManager.h.
Referenced by OutputUnknowns().
SentenceStats& Moses::ChartManager::GetSentenceStats | ( | ) | const [inline] |
debug data collected when decoding sentence
Definition at line 118 of file ChartManager.h.
Referenced by Moses::ChartHypothesisCollection::AddHypothesis(), and Moses::ChartHypothesisCollection::PruneToSize().
void Moses::ChartManager::OutputAlignment | ( | OutputCollector * | collector | ) | const [virtual] |
Implements Moses::BaseManager.
Definition at line 486 of file ChartManager.cpp.
References GetBestHypothesis(), Moses::InputType::GetTranslationId(), Moses::BaseManager::m_source, NULL, and Moses::OutputCollector::Write().
void Moses::ChartManager::OutputBest | ( | OutputCollector * | collector | ) | const [virtual] |
Implements Moses::BaseManager.
Definition at line 306 of file ChartManager.cpp.
References GetBestHypothesis(), Moses::InputType::GetTranslationId(), and Moses::BaseManager::m_source.
void Moses::ChartManager::OutputDetailedTranslationReport | ( | OutputCollector * | collector | ) | const [virtual] |
Implements Moses::BaseManager.
Definition at line 588 of file ChartManager.cpp.
References GetBestHypothesis(), Moses::InputType::GetTranslationId(), and Moses::BaseManager::m_source.
void Moses::ChartManager::OutputDetailedTreeFragmentsTranslationReport | ( | OutputCollector * | collector | ) | const [virtual] |
Implements Moses::BaseManager.
Definition at line 706 of file ChartManager.cpp.
References GetBestHypothesis(), Moses::ChartHypothesis::GetFFState(), Moses::StatefulFeatureFunction::GetStatefulFeatureFunctions(), Moses::InputType::GetTranslationId(), Moses::TreeState::GetTree(), Moses::StaticData::GetTreeStructure(), Moses::StaticData::Instance(), Moses::BaseManager::m_source, NULL, and Moses::OutputCollector::Write().
void Moses::ChartManager::OutputLatticeSamples | ( | OutputCollector * | collector | ) | const [inline, virtual] |
void Moses::ChartManager::OutputNBest | ( | OutputCollector * | collector | ) | const [virtual] |
Implements Moses::BaseManager.
Definition at line 316 of file ChartManager.cpp.
References CalcNBest(), Moses::InputType::GetTranslationId(), IFVERBOSE, Moses::BaseManager::m_source, nbest(), Moses::BaseManager::options(), Moses::PrintUserTime(), and VERBOSE.
void Moses::ChartManager::OutputSearchGraph | ( | OutputCollector * | collector | ) | const [virtual] |
Implements Moses::BaseManager.
Definition at line 769 of file ChartManager.cpp.
References Moses::InputType::GetTranslationId(), Moses::BaseManager::m_source, OutputSearchGraphMoses(), and Moses::OutputCollector::Write().
void Moses::ChartManager::OutputSearchGraphAsHypergraph | ( | std::ostream & | outputSearchGraphStream | ) | const [virtual] |
Output in (modified) Kenneth hypergraph format
Reimplemented from Moses::BaseManager.
Definition at line 293 of file ChartManager.cpp.
References Moses::BaseManager::options().
void Moses::ChartManager::OutputSearchGraphMoses | ( | std::ostream & | outputSearchGraphStream | ) | const |
"Moses" (osg) type format
Definition at line 299 of file ChartManager.cpp.
References Moses::InputType::GetTranslationId(), Moses::BaseManager::m_source, and Moses::BaseManager::options().
Referenced by OutputSearchGraph().
void Moses::ChartManager::OutputSearchGraphSLF | ( | ) | const [inline, virtual] |
void Moses::ChartManager::OutputUnknowns | ( | OutputCollector * | collector | ) | const [virtual] |
Implements Moses::BaseManager.
Definition at line 689 of file ChartManager.cpp.
References GetParser(), Moses::InputType::GetTranslationId(), Moses::ChartParser::GetUnknownSources(), Moses::BaseManager::m_source, and Moses::OutputCollector::Write().
void Moses::ChartManager::OutputWordGraph | ( | OutputCollector * | collector | ) | const [inline, virtual] |
void Moses::ChartManager::ResetSentenceStats | ( | const InputType & | source | ) | [inline] |
Definition at line 130 of file ChartManager.h.
Referenced by Decode().