#include <ChartCell.h>


Public Types | |
| typedef std::map< Word, ChartHypothesisCollection > | MapType |
Public Member Functions | |
| ChartCell (size_t startPos, size_t endPos, ChartManager &manager) | |
| ~ChartCell () | |
| void | ProcessSentence (const ChartTranslationOptionList &transOptList, const ChartCellCollection &allChartCells) |
| const HypoList * | GetSortedHypotheses (const Word &constituentLabel) const |
| Get all hypotheses in the cell that have the specified constituent label. | |
| const HypoList * | GetAllSortedHypotheses () const |
| for n-best list | |
| bool | AddHypothesis (ChartHypothesis *hypo) |
| void | SortHypotheses () |
| call SortHypotheses() in each hypo collection in this cell | |
| void | PruneToSize () |
| const ChartHypothesis * | GetBestHypothesis () const |
| void | CleanupArcList () |
| call CleanupArcList() in each hypo collection in this cell | |
| void | OutputSizes (std::ostream &out) const |
| debug info - size of each hypo collection in this cell | |
| size_t | GetSize () const |
| debug info - total number of hypos in all hypo collection in this cell | |
| bool | operator< (const ChartCell &compare) const |
| transitive comparison used for adding objects into set | |
| void | GetSearchGraph (long translationId, std::ostream &outputSearchGraphStream, const std::map< unsigned, bool > &reachable) const |
| call GetSearchGraph() for each hypo collection | |
Protected Attributes | |
| MapType | m_hypoColl |
| bool | m_nBestIsEnabled |
| ChartManager & | m_manager |
Friends | |
| std::ostream & | operator<< (std::ostream &, const ChartCell &) |
Definition at line 74 of file ChartCell.h.
| typedef std::map<Word, ChartHypothesisCollection> Moses::ChartCell::MapType |
Definition at line 85 of file ChartCell.h.
| Moses::ChartCell::ChartCell | ( | size_t | startPos, | |
| size_t | endPos, | |||
| ChartManager & | manager | |||
| ) |
Constructor
| startPos | endPos range of this cell | |
| manager | pointer back to the manager |
Definition at line 50 of file ChartCell.cpp.
References Moses::StaticData::Instance(), Moses::StaticData::IsNBestEnabled(), and m_nBestIsEnabled.

| Moses::ChartCell::~ChartCell | ( | ) |
Definition at line 57 of file ChartCell.cpp.
| bool Moses::ChartCell::AddHypothesis | ( | ChartHypothesis * | hypo | ) |
Add the given hypothesis to the cell. Returns true if added, false if not. Maybe it already exists in the collection or score falls below threshold etc. This function just calls the correspondind AddHypothesis() in ChartHypothesisCollection
| hypo | Hypothesis to be added |
Definition at line 64 of file ChartCell.cpp.
References Moses::ChartHypothesis::GetTargetLHS(), m_hypoColl, and m_manager.
Referenced by Moses::ChartManager::AddXmlChartOptions(), and ProcessSentence().


| void Moses::ChartCell::CleanupArcList | ( | ) |
call CleanupArcList() in each hypo collection in this cell
Definition at line 142 of file ChartCell.cpp.
References Moses::ChartHypothesisCollection::CleanupArcList(), m_hypoColl, and m_nBestIsEnabled.
Referenced by Moses::ChartManager::ProcessSentence().


| const HypoList * Moses::ChartCell::GetAllSortedHypotheses | ( | ) | const |
for n-best list
Definition at line 180 of file ChartCell.cpp.
References Moses::ChartHypothesisCollection::GetSortedHypotheses(), and m_hypoColl.
Referenced by Moses::ChartManager::CalcNBest().


| const ChartHypothesis * Moses::ChartCell::GetBestHypothesis | ( | ) | const |
Return the highest scoring hypothesis out of all the hypo collection in this cell
Definition at line 121 of file ChartCell.cpp.
References CHECK, m_hypoColl, and NULL.
Referenced by Moses::ChartManager::CalcNBest(), Moses::ChartManager::GetBestHypothesis(), and Moses::ChartManager::GetSearchGraph().

| void Moses::ChartCell::GetSearchGraph | ( | long | translationId, | |
| std::ostream & | outputSearchGraphStream, | |||
| const std::map< unsigned, bool > & | reachable | |||
| ) | const |
call GetSearchGraph() for each hypo collection
Definition at line 194 of file ChartCell.cpp.
References Moses::ChartHypothesisCollection::GetSearchGraph(), and m_hypoColl.
Referenced by Moses::ChartManager::GetSearchGraph().


| size_t Moses::ChartCell::GetSize | ( | ) | const |
debug info - total number of hypos in all hypo collection in this cell
Definition at line 167 of file ChartCell.cpp.
References Moses::ChartHypothesisCollection::GetSize(), and m_hypoColl.
Referenced by Moses::ChartManager::ProcessSentence().


| const HypoList* Moses::ChartCell::GetSortedHypotheses | ( | const Word & | constituentLabel | ) | const [inline] |
Get all hypotheses in the cell that have the specified constituent label.
Definition at line 102 of file ChartCell.h.
References m_hypoColl, and NULL.
| bool Moses::ChartCell::operator< | ( | const ChartCell & | compare | ) | const [inline] |
transitive comparison used for adding objects into set
Definition at line 123 of file ChartCell.h.
References Moses::ChartCellBase::m_coverage.
| void Moses::ChartCell::OutputSizes | ( | std::ostream & | out | ) | const |
debug info - size of each hypo collection in this cell
Definition at line 155 of file ChartCell.cpp.
References Moses::ChartHypothesisCollection::GetSize(), and m_hypoColl.

| void Moses::ChartCell::ProcessSentence | ( | const ChartTranslationOptionList & | transOptList, | |
| const ChartCellCollection & | allChartCells | |||
| ) |
Decoding at span level: fill chart cell with hypotheses (implementation of cube pruning)
| transOptList | list of applicable rules to create hypotheses for the cell | |
| allChartCells | entire chart - needed to look up underlying hypotheses |
Definition at line 85 of file ChartCell.cpp.
References Moses::RuleCubeQueue::Add(), AddHypothesis(), Moses::ChartTranslationOptionList::Get(), Moses::StaticData::GetCubePruningPopLimit(), Moses::ChartTranslationOptionList::GetSize(), Moses::StaticData::Instance(), Moses::RuleCubeQueue::IsEmpty(), m_manager, and Moses::RuleCubeQueue::Pop().
Referenced by Moses::ChartManager::ProcessSentence().


| void Moses::ChartCell::PruneToSize | ( | ) |
Prune each collection in this cell to a particular size
Definition at line 71 of file ChartCell.cpp.
References m_hypoColl, m_manager, and Moses::ChartHypothesisCollection::PruneToSize().
Referenced by Moses::ChartManager::ProcessSentence().


| void Moses::ChartCell::SortHypotheses | ( | ) |
call SortHypotheses() in each hypo collection in this cell
Definition at line 109 of file ChartCell.cpp.
References Moses::ChartCellLabelSet::AddConstituent(), CHECK, Moses::ChartCellLabelSet::Empty(), Moses::ChartHypothesisCollection::GetSortedHypotheses(), m_hypoColl, Moses::ChartCellBase::m_targetLabelSet, and Moses::ChartHypothesisCollection::SortHypotheses().
Referenced by Moses::ChartManager::ProcessSentence().


| std::ostream& operator<< | ( | std::ostream & | out, | |
| const ChartCell & | cell | |||
| ) | [friend] |
Definition at line 203 of file ChartCell.cpp.
MapType Moses::ChartCell::m_hypoColl [protected] |
Definition at line 89 of file ChartCell.h.
Referenced by AddHypothesis(), CleanupArcList(), GetAllSortedHypotheses(), GetBestHypothesis(), GetSearchGraph(), GetSize(), GetSortedHypotheses(), Moses::operator<<(), OutputSizes(), PruneToSize(), and SortHypotheses().
ChartManager& Moses::ChartCell::m_manager [protected] |
Definition at line 92 of file ChartCell.h.
Referenced by AddHypothesis(), ProcessSentence(), and PruneToSize().
bool Moses::ChartCell::m_nBestIsEnabled [protected] |
flag to determine whether to keep track of old arcs
Definition at line 91 of file ChartCell.h.
Referenced by ChartCell(), and CleanupArcList().
1.5.9