Moses::ChartCell Class Reference

#include <ChartCell.h>

Inheritance diagram for Moses::ChartCell:

Inheritance graph
[legend]
Collaboration diagram for Moses::ChartCell:

Collaboration graph
[legend]

List of all members.

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 HypoListGetSortedHypotheses (const Word &constituentLabel) const
 Get all hypotheses in the cell that have the specified constituent label.
const HypoListGetAllSortedHypotheses () const
 for n-best list
bool AddHypothesis (ChartHypothesis *hypo)
void SortHypotheses ()
 call SortHypotheses() in each hypo collection in this cell
void PruneToSize ()
const ChartHypothesisGetBestHypothesis () 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
ChartManagerm_manager

Friends

std::ostream & operator<< (std::ostream &, const ChartCell &)


Detailed Description

1 cell in chart decoder. Doesn't directly hold hypotheses. Each cell contain a map of ChartHypothesisCollection that have different constituent labels

Definition at line 74 of file ChartCell.h.


Member Typedef Documentation

Definition at line 85 of file ChartCell.h.


Constructor & Destructor Documentation

Moses::ChartCell::ChartCell ( size_t  startPos,
size_t  endPos,
ChartManager manager 
)

Constructor

Parameters:
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.

Here is the call graph for this function:

Moses::ChartCell::~ChartCell (  ) 

Definition at line 57 of file ChartCell.cpp.


Member Function Documentation

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

Parameters:
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().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Here is the call graph for this function:

void Moses::ChartCell::ProcessSentence ( const ChartTranslationOptionList transOptList,
const ChartCellCollection allChartCells 
)

Decoding at span level: fill chart cell with hypotheses (implementation of cube pruning)

Parameters:
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().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  out,
const ChartCell cell 
) [friend]

Definition at line 203 of file ChartCell.cpp.


Member Data Documentation

Definition at line 92 of file ChartCell.h.

Referenced by AddHypothesis(), ProcessSentence(), and PruneToSize().

flag to determine whether to keep track of old arcs

Definition at line 91 of file ChartCell.h.

Referenced by ChartCell(), and CleanupArcList().


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

Generated on Sat Nov 1 00:31:05 2014 for Moses by  doxygen 1.5.9