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:
Diffstat (limited to 'moses-chart/src/ChartTranslationOption.h')
-rw-r--r--moses-chart/src/ChartTranslationOption.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/moses-chart/src/ChartTranslationOption.h b/moses-chart/src/ChartTranslationOption.h
new file mode 100644
index 000000000..14650f017
--- /dev/null
+++ b/moses-chart/src/ChartTranslationOption.h
@@ -0,0 +1,47 @@
+#pragma once
+
+#include <iostream>
+#include <vector>
+#include "../../moses/src/TargetPhrase.h"
+#include "../../moses/src/WordsRange.h"
+#include "../../moses/src/InputType.h"
+#include "../../moses/src/ChartRule.h"
+
+namespace MosesChart
+{
+
+class TranslationOption
+{
+ friend std::ostream& operator<<(std::ostream& out, const TranslationOption &transOpt);
+
+protected:
+ const Moses::ChartRule &m_rule; /*< output phrase when using this translation option */
+ const Moses::WordsRange &m_wordsRange;
+public:
+ TranslationOption(const Moses::WordsRange &wordsRange
+ , const Moses::ChartRule &chartRule);
+
+ ~TranslationOption();
+
+ const Moses::ChartRule &GetChartRule() const
+ { return m_rule; }
+ const Moses::WordsRange &GetSourceWordsRange() const
+ { return m_wordsRange; }
+
+ /** return estimate of total cost of this option */
+ inline size_t GetArity() const
+ {
+ return m_rule.GetTargetPhrase().GetArity();
+ }
+
+ /** return estimate of total cost of this option */
+ inline float GetTotalScore() const
+ {
+ return m_rule.GetTargetPhrase().GetFutureScore();
+ }
+
+ bool operator<(const TranslationOption &compare) const;
+
+};
+
+}