Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHieu Hoang <hieu@hoang.co.uk>2014-03-07 18:17:50 +0400
committerHieu Hoang <hieu@hoang.co.uk>2014-03-07 18:17:50 +0400
commitec21f3c49cbf5148239b6d4ffd3991a1f0e3be71 (patch)
tree10df51c3007273179a0708e5731b0c3b905febeb /contrib/other-builds/extract-mixed-syntax
parente003b75a5b40a7b87a3c3c4601daf3226a344502 (diff)
bug in adjacent non-term
Diffstat (limited to 'contrib/other-builds/extract-mixed-syntax')
-rw-r--r--contrib/other-builds/extract-mixed-syntax/AlignedSentenceSyntax.cpp3
-rw-r--r--contrib/other-builds/extract-mixed-syntax/Main.cpp2
-rw-r--r--contrib/other-builds/extract-mixed-syntax/Rule.cpp4
3 files changed, 4 insertions, 5 deletions
diff --git a/contrib/other-builds/extract-mixed-syntax/AlignedSentenceSyntax.cpp b/contrib/other-builds/extract-mixed-syntax/AlignedSentenceSyntax.cpp
index baada3d9a..719a18e40 100644
--- a/contrib/other-builds/extract-mixed-syntax/AlignedSentenceSyntax.cpp
+++ b/contrib/other-builds/extract-mixed-syntax/AlignedSentenceSyntax.cpp
@@ -78,7 +78,6 @@ void AlignedSentenceSyntax::XMLParse(Phrase &output, SyntaxTree &tree, const pug
for (pugi::xml_node childNode = parentNode.first_child(); childNode; childNode = childNode.next_sibling())
{
string nodeName = childNode.name();
- cerr << "nodeName=" << nodeName << endl;
// span label
string label;
@@ -87,7 +86,6 @@ void AlignedSentenceSyntax::XMLParse(Phrase &output, SyntaxTree &tree, const pug
if (!nodeName.empty()) {
pugi::xml_attribute attribute = childNode.attribute("label");
label = attribute.as_string();
- cerr << "label=" << label << endl;
// recursively call this function. For proper recursive trees
XMLParse(output, tree, childNode);
@@ -97,7 +95,6 @@ void AlignedSentenceSyntax::XMLParse(Phrase &output, SyntaxTree &tree, const pug
// fill phrase vector
string text = childNode.value();
- cerr << "text=" << text << endl;
Escape(text);
//cerr << childNum << " " << label << "=" << text << endl;
diff --git a/contrib/other-builds/extract-mixed-syntax/Main.cpp b/contrib/other-builds/extract-mixed-syntax/Main.cpp
index 8fa7530f8..105224c3d 100644
--- a/contrib/other-builds/extract-mixed-syntax/Main.cpp
+++ b/contrib/other-builds/extract-mixed-syntax/Main.cpp
@@ -119,7 +119,7 @@ int main(int argc, char** argv)
}
alignedSentence->Create(params);
- cerr << alignedSentence->Debug();
+ //cerr << alignedSentence->Debug();
Rules rules(*alignedSentence);
rules.Extend(params);
diff --git a/contrib/other-builds/extract-mixed-syntax/Rule.cpp b/contrib/other-builds/extract-mixed-syntax/Rule.cpp
index b8fa7e385..1bf2b86f0 100644
--- a/contrib/other-builds/extract-mixed-syntax/Rule.cpp
+++ b/contrib/other-builds/extract-mixed-syntax/Rule.cpp
@@ -171,6 +171,8 @@ void Rule::Output(std::ostream &out, bool forward) const
void Rule::Prevalidate(const Parameter &params)
{
+ const ConsistentPhrase &cp = m_lhs.GetConsistentPhrase();
+
// check number of source symbols in rule
if (m_source.GetSize() > params.maxSymbolsSource) {
m_isValid = false;
@@ -235,7 +237,7 @@ void Rule::Prevalidate(const Parameter &params)
else {
// Hieu's mixed syntax
if (lastNonTerm.IsHiero(Moses::Input, params)
- || secondLastNonTerm.IsHiero(Moses::Input, params)) {
+ && secondLastNonTerm.IsHiero(Moses::Input, params)) {
m_isValid = false;
m_canRecurse = false;
return;