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:
authorEva Hasler <ehasler@saxnot.inf.ed.ac.uk>2012-04-11 16:42:25 +0400
committerEva Hasler <ehasler@saxnot.inf.ed.ac.uk>2012-04-11 16:42:25 +0400
commit9acbecc9ba4b44b9107b95cba5c96c06e3046c09 (patch)
treeab949a3874c2c4a5aabe089e9b83c19d313d386e /scripts
parent74c2cf34177adfb24a5b47c8964a50c5dcbae8c4 (diff)
output all alignments for hierarchical
Diffstat (limited to 'scripts')
-rw-r--r--scripts/training/phrase-extract/score.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/scripts/training/phrase-extract/score.cpp b/scripts/training/phrase-extract/score.cpp
index 198e58ce4..3a15534d1 100644
--- a/scripts/training/phrase-extract/score.cpp
+++ b/scripts/training/phrase-extract/score.cpp
@@ -497,10 +497,11 @@ void outputPhrasePair( vector< PhraseAlignment* > &phrasePair, float totalCount,
// alignment info for non-terminals
if (! inverseFlag) {
if (hierarchicalFlag) {
- // always output alignment if hiero style, but only for non-terms
+ // always output alignment if hiero style, but only for non-terms
+ // (eh: output all alignments, needed for some feature functions)
assert(phraseT.size() == bestAlignment->alignedToT.size() + 1);
for(int j = 0; j < phraseT.size() - 1; j++) {
- if (isNonTerminal(vcbT.getWord( phraseT[j] ))) {
+ //if (isNonTerminal(vcbT.getWord( phraseT[j] ))) {
if (bestAlignment->alignedToT[ j ].size() != 1) {
cerr << "Error: unequal numbers of non-terminals. Make sure the text does not contain words in square brackets (like [xxx])." << endl;
phraseTableFile.flush();
@@ -508,7 +509,7 @@ void outputPhrasePair( vector< PhraseAlignment* > &phrasePair, float totalCount,
}
int sourcePos = *(bestAlignment->alignedToT[ j ].begin());
phraseTableFile << sourcePos << "-" << j << " ";
- }
+ //}
}
} else if (wordAlignmentFlag) {
// alignment info in pb model