Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBarry Haddow <barry.haddow@gmail.com>2014-08-08 00:20:10 +0400
committerBarry Haddow <barry.haddow@gmail.com>2014-08-08 00:20:10 +0400
commitb5a1f02606f83209e0a1fe771f329cb9eedcef57 (patch)
tree4e71efa21deb703d149d8be2edf844be01b70f2f /moses/ChartManager.h
parentfbe73dd06f89e0b17d9f3ec9e82d5c8f2add7fbd (diff)
Implement hypergraph output for chart moses
Diffstat (limited to 'moses/ChartManager.h')
-rw-r--r--moses/ChartManager.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/moses/ChartManager.h b/moses/ChartManager.h
index 5ff7620fd..b39b078bd 100644
--- a/moses/ChartManager.h
+++ b/moses/ChartManager.h
@@ -38,6 +38,7 @@ namespace Moses
{
class ChartHypothesis;
+class ChartSearchGraphWriter;
/** Holds everything you need to decode 1 sentence with the hierachical/syntax decoder
*/
@@ -55,6 +56,11 @@ private:
ChartTranslationOptionList m_translationOptionList; /**< pre-computed list of translation options for the phrases in this sentence */
+ /* auxilliary functions for SearchGraphs */
+ void FindReachableHypotheses(
+ const ChartHypothesis *hypo, std::map<unsigned,bool> &reachable , size_t* winners, size_t* losers) const;
+ void WriteSearchGraph(const ChartSearchGraphWriter& writer) const;
+
public:
ChartManager(size_t lineNumber, InputType const& source);
~ChartManager();
@@ -63,11 +69,13 @@ public:
const ChartHypothesis *GetBestHypothesis() const;
void CalcNBest(size_t n, std::vector<boost::shared_ptr<ChartKBestExtractor::Derivation> > &nBestList, bool onlyDistinct=false) const;
- void GetSearchGraph(long translationId, std::ostream &outputSearchGraphStream) const;
- void FindReachableHypotheses( const ChartHypothesis *hypo, std::map<unsigned,bool> &reachable ) const; /* auxilliary function for GetSearchGraph */
+ /** "Moses" (osg) type format */
+ void OutputSearchGraphMoses(std::ostream &outputSearchGraphStream) const;
+
/** Output in (modified) Kenneth hypergraph format */
void OutputSearchGraphAsHypergraph(std::ostream &outputSearchGraphStream) const;
+
//! the input sentence being decoded
const InputType& GetSource() const {
return m_source;