diff options
author | Hieu Hoang <fishandfrolick@gmail.com> | 2012-05-18 14:02:51 +0400 |
---|---|---|
committer | Hieu Hoang <fishandfrolick@gmail.com> | 2012-05-18 14:02:51 +0400 |
commit | 31f725a2b67496a380864ababd5e7e17db5e6c4c (patch) | |
tree | ba4a96a19711fa90d36483afc646a125bb70486c /moses | |
parent | cd5d84f800fe32a6165b76ea3e319ccbfcffe1e0 (diff) |
Fix chart decoding so that it allows inputtype=0
Diffstat (limited to 'moses')
-rw-r--r-- | moses/src/ChartManager.cpp | 3 | ||||
-rw-r--r-- | moses/src/InputType.cpp | 8 | ||||
-rw-r--r-- | moses/src/InputType.h | 5 |
3 files changed, 13 insertions, 3 deletions
diff --git a/moses/src/ChartManager.cpp b/moses/src/ChartManager.cpp index 79a181952..3a4db4d9a 100644 --- a/moses/src/ChartManager.cpp +++ b/moses/src/ChartManager.cpp @@ -126,8 +126,7 @@ void ChartManager::ProcessSentence() } void ChartManager::AddXmlChartOptions() { - TreeInput const &source = dynamic_cast<TreeInput const&>(m_source); - const std::vector <ChartTranslationOption*> xmlChartOptionsList = source.GetXmlChartTranslationOptions(); + const std::vector <ChartTranslationOption*> xmlChartOptionsList = m_source.GetXmlChartTranslationOptions(); IFVERBOSE(2) { cerr << "AddXmlChartOptions " << xmlChartOptionsList.size() << endl; } if (xmlChartOptionsList.size() == 0) return; diff --git a/moses/src/InputType.cpp b/moses/src/InputType.cpp index 77857bdaf..d67e343f1 100644 --- a/moses/src/InputType.cpp +++ b/moses/src/InputType.cpp @@ -23,6 +23,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA #include <cstdlib> #include "InputType.h" +#include "ChartTranslationOption.h" namespace Moses { @@ -60,6 +61,13 @@ bool InputType::CanIGetFromAToB(size_t /*start*/, size_t /*end*/) const return true; } +std::vector <ChartTranslationOption*> InputType::GetXmlChartTranslationOptions() const +{ + // default. return nothing + std::vector <ChartTranslationOption*> ret; + return ret; +} + } diff --git a/moses/src/InputType.h b/moses/src/InputType.h index ca710c408..8a29ca279 100644 --- a/moses/src/InputType.h +++ b/moses/src/InputType.h @@ -38,7 +38,8 @@ class Factor; class PhraseDictionary; class TranslationOptionCollection; class TranslationSystem; - +class ChartTranslationOption; + //! base class for sentences and confusion networks class InputType { @@ -130,6 +131,8 @@ public: virtual const NonTerminalSet &GetLabelSet(size_t startPos, size_t endPos) const = 0; + virtual std::vector <ChartTranslationOption*> GetXmlChartTranslationOptions() const; + TO_STRING(); }; |