From 2f768d836cbc7444b4149f9ae6782c25160052cf Mon Sep 17 00:00:00 2001 From: Hieu Hoang Date: Mon, 24 Feb 2014 20:32:50 +0000 Subject: [PATCH] syntax --- .../other-builds/extract-mixed-syntax/ConsistentPhrase.h | 3 +-- contrib/other-builds/extract-mixed-syntax/NonTerm.cpp | 2 +- contrib/other-builds/extract-mixed-syntax/Rule.cpp | 9 +++++++++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/contrib/other-builds/extract-mixed-syntax/ConsistentPhrase.h b/contrib/other-builds/extract-mixed-syntax/ConsistentPhrase.h index 1dab928b1..2708b4a04 100644 --- a/contrib/other-builds/extract-mixed-syntax/ConsistentPhrase.h +++ b/contrib/other-builds/extract-mixed-syntax/ConsistentPhrase.h @@ -11,10 +11,9 @@ #include #include #include "moses/TypeDef.h" -#include "RuleSymbol.h" #include "NonTerm.h" -class ConsistentPhrase : public RuleSymbol +class ConsistentPhrase { public: typedef std::vector NonTerms; diff --git a/contrib/other-builds/extract-mixed-syntax/NonTerm.cpp b/contrib/other-builds/extract-mixed-syntax/NonTerm.cpp index 194b1bb44..91603cc17 100644 --- a/contrib/other-builds/extract-mixed-syntax/NonTerm.cpp +++ b/contrib/other-builds/extract-mixed-syntax/NonTerm.cpp @@ -8,7 +8,7 @@ #include #include "NonTerm.h" #include "Word.h" -#include "ConsistentPhrase.h".h" +#include "ConsistentPhrase.h" using namespace std; diff --git a/contrib/other-builds/extract-mixed-syntax/Rule.cpp b/contrib/other-builds/extract-mixed-syntax/Rule.cpp index a631cbb1a..ea4269c14 100644 --- a/contrib/other-builds/extract-mixed-syntax/Rule.cpp +++ b/contrib/other-builds/extract-mixed-syntax/Rule.cpp @@ -10,6 +10,7 @@ #include "AlignedSentence.h" #include "ConsistentPhrase.h" #include "NonTerm.h" +#include "Parameter.h" using namespace std; @@ -146,5 +147,13 @@ void Rule::Output(std::ostream &out) const void Rule::Prevalidate(const Parameter ¶ms) { + if (m_source.size() >= params.maxSymbolsSource) { + m_canRecurse = false; + if (m_source.size() > params.maxSymbolsSource) { + m_isValid = false; + return; + } + } + }