This commit is contained in:
Hieu Hoang 2014-02-24 20:32:50 +00:00
parent d73799cbda
commit 2f768d836c
3 changed files with 11 additions and 3 deletions

View File

@ -11,10 +11,9 @@
#include <vector> #include <vector>
#include <iostream> #include <iostream>
#include "moses/TypeDef.h" #include "moses/TypeDef.h"
#include "RuleSymbol.h"
#include "NonTerm.h" #include "NonTerm.h"
class ConsistentPhrase : public RuleSymbol class ConsistentPhrase
{ {
public: public:
typedef std::vector<NonTerm> NonTerms; typedef std::vector<NonTerm> NonTerms;

View File

@ -8,7 +8,7 @@
#include <sstream> #include <sstream>
#include "NonTerm.h" #include "NonTerm.h"
#include "Word.h" #include "Word.h"
#include "ConsistentPhrase.h".h" #include "ConsistentPhrase.h"
using namespace std; using namespace std;

View File

@ -10,6 +10,7 @@
#include "AlignedSentence.h" #include "AlignedSentence.h"
#include "ConsistentPhrase.h" #include "ConsistentPhrase.h"
#include "NonTerm.h" #include "NonTerm.h"
#include "Parameter.h"
using namespace std; using namespace std;
@ -146,5 +147,13 @@ void Rule::Output(std::ostream &out) const
void Rule::Prevalidate(const Parameter &params) void Rule::Prevalidate(const Parameter &params)
{ {
if (m_source.size() >= params.maxSymbolsSource) {
m_canRecurse = false;
if (m_source.size() > params.maxSymbolsSource) {
m_isValid = false;
return;
}
}
} }