diff --git a/contrib/other-builds/extract-mixed-syntax/Rule.cpp b/contrib/other-builds/extract-mixed-syntax/Rule.cpp index c1ef3e9bf..9e266e909 100644 --- a/contrib/other-builds/extract-mixed-syntax/Rule.cpp +++ b/contrib/other-builds/extract-mixed-syntax/Rule.cpp @@ -172,6 +172,27 @@ void Rule::CreateSymbols(const Global &global, bool &isValid, const SentenceAlig //cerr << "m_target=" << m_target.GetSize() << ":" << m_target << endl; } } + + + if (isValid) { + isValid = false; + for (size_t i = 0; i < m_source.GetSize(); ++i) { + const Symbol &symbol = m_source.GetSymbol(i); + if (symbol.IsTerminal()) { + isValid = true; + } + } + } + + if (isValid) { + isValid = false; + for (size_t i = 0; i < m_target.GetSize(); ++i) { + const Symbol &symbol = m_target.GetSymbol(i); + if (symbol.IsTerminal()) { + isValid = true; + } + } + } } bool Rule::MoreDefaultNonTermThanTerm() const diff --git a/contrib/other-builds/extract-mixed-syntax/Symbol.h b/contrib/other-builds/extract-mixed-syntax/Symbol.h index b79a705b2..1af003b5e 100644 --- a/contrib/other-builds/extract-mixed-syntax/Symbol.h +++ b/contrib/other-builds/extract-mixed-syntax/Symbol.h @@ -32,5 +32,6 @@ public: , bool isSourceSyntax, bool isTargetSyntax); int Compare(const Symbol &other) const; - + bool IsTerminal() const + { return m_isTerminal; } };