mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2025-01-01 00:12:27 +03:00
syntax
This commit is contained in:
parent
d73799cbda
commit
2f768d836c
@ -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;
|
||||||
|
@ -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;
|
||||||
|
|
||||||
|
@ -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 ¶ms)
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user