Fix chart decoding so that it allows inputtype=0

This commit is contained in:
Hieu Hoang 2012-05-18 11:02:51 +01:00
parent cd5d84f800
commit 31f725a2b6
3 changed files with 13 additions and 3 deletions

View File

@ -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;

View File

@ -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;
}
}

View File

@ -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();
};