From b0c208cdf87bb5745c94d94001422b10ae58f2df Mon Sep 17 00:00:00 2001 From: Matthias Huck Date: Mon, 14 Dec 2015 19:19:51 +0000 Subject: [PATCH] Hiero phrase orientation bug fix --- phrase-extract/extract-rules-main.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/phrase-extract/extract-rules-main.cpp b/phrase-extract/extract-rules-main.cpp index 62dbbbf0e..aa2b1d311 100644 --- a/phrase-extract/extract-rules-main.cpp +++ b/phrase-extract/extract-rules-main.cpp @@ -767,6 +767,15 @@ void ExtractTask::saveHieroPhrase( int startT, int endT, int startS, int endS } } + // phrase orientation (lexicalized reordering model) + if (m_options.phraseOrientation) { + rule.l2rOrientation = m_phraseOrientation.GetOrientationInfo(startS,endS,PhraseOrientation::REO_DIR_L2R); + rule.r2lOrientation = m_phraseOrientation.GetOrientationInfo(startS,endS,PhraseOrientation::REO_DIR_R2L); + // std::cerr << "span " << startS << " " << endS << std::endl; + // std::cerr << "phraseOrientationL2R " << m_phraseOrientation.GetOrientationInfo(startS,endS,PhraseOrientation::REO_DIR_L2R) << std::endl; + // std::cerr << "phraseOrientationR2L " << m_phraseOrientation.GetOrientationInfo(startS,endS,PhraseOrientation::REO_DIR_R2L) << std::endl; + } + addRuleToCollection( rule ); }