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 Decode (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
void WriteSearchGraph (const ChartSearchGraphWriter &writer, const std::map< unsigned, bool > &reachable) const
 call WriteSearchGraph() 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 75 of file ChartCell.h.


Member Typedef Documentation

Definition at line 86 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 m_nBestIsEnabled, and Moses::BaseManager::options().

Here is the call graph for this function:

Moses::ChartCell::~ChartCell (  ) 

Definition at line 56 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 corresponding AddHypothesis() in ChartHypothesisCollection

Parameters:
hypo Hypothesis to be added

Definition at line 63 of file ChartCell.cpp.

References Moses::ChartHypothesis::GetTargetLHS(), m, m_hypoColl, m_manager, and Moses::BaseManager::options().

Referenced by Moses::ChartManager::AddXmlChartOptions(), and Decode().

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 149 of file ChartCell.cpp.

References Moses::ChartHypothesisCollection::CleanupArcList(), m_hypoColl, and m_nBestIsEnabled.

Referenced by Moses::ChartManager::Decode().

Here is the call graph for this function:

Here is the caller graph for this function:

void Moses::ChartCell::Decode ( 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 90 of file ChartCell.cpp.

References Moses::RuleCubeQueue::Add(), AddHypothesis(), Moses::ChartTranslationOptionList::Get(), Moses::ChartTranslationOptionList::GetSize(), Moses::RuleCubeQueue::IsEmpty(), m_manager, Moses::BaseManager::options(), and Moses::RuleCubeQueue::Pop().

Referenced by Moses::ChartManager::Decode().

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 187 of file ChartCell.cpp.

References Moses::ChartHypothesisCollection::GetSortedHypotheses(), and m_hypoColl.

Here is the call 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 128 of file ChartCell.cpp.

References Moses::ChartHypothesis::GetFutureScore(), m_hypoColl, and NULL.

Referenced by Moses::ChartManager::GetBestHypothesis().

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 174 of file ChartCell.cpp.

References Moses::ChartHypothesisCollection::GetSize(), and m_hypoColl.

Referenced by Moses::ChartManager::Decode().

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 103 of file ChartCell.h.

References m_hypoColl, and NULL.

void Moses::ChartCell::OutputSizes ( std::ostream &  out  )  const

debug info - size of each hypo collection in this cell

Definition at line 162 of file ChartCell.cpp.

References Moses::ChartHypothesisCollection::GetSize(), and m_hypoColl.

Here is the call graph for this function:

void Moses::ChartCell::PruneToSize (  ) 

Prune each collection in this cell to a particular size

Definition at line 76 of file ChartCell.cpp.

References m_hypoColl, m_manager, and Moses::ChartHypothesisCollection::PruneToSize().

Referenced by Moses::ChartManager::Decode().

Here is the call graph for this function:

Here is the caller graph for this function:

void Moses::ChartCell::SortHypotheses (  ) 

void Moses::ChartCell::WriteSearchGraph ( const ChartSearchGraphWriter writer,
const std::map< unsigned, bool > &  reachable 
) const

call WriteSearchGraph() for each hypo collection

Definition at line 201 of file ChartCell.cpp.

References m_hypoColl, and Moses::ChartHypothesisCollection::WriteSearchGraph().

Here is the call graph for this function:


Friends And Related Function Documentation

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

Definition at line 210 of file ChartCell.cpp.


Member Data Documentation

Definition at line 93 of file ChartCell.h.

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

flag to determine whether to keep track of old arcs

Definition at line 92 of file ChartCell.h.

Referenced by ChartCell(), and CleanupArcList().


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

Generated on Mon Aug 29 00:32:01 2016 for Moses by  doxygen 1.5.9