diff options
author | hieuhoang1972 <hieuhoang1972@1f5c12ca-751b-0410-a591-d2e778427230> | 2010-10-22 14:37:19 +0400 |
---|---|---|
committer | hieuhoang1972 <hieuhoang1972@1f5c12ca-751b-0410-a591-d2e778427230> | 2010-10-22 14:37:19 +0400 |
commit | 564a9ad37176214f1b6700f7bac85fb484b5b159 (patch) | |
tree | 1cb40a9674833d5f29038dc2c6ff5a01af223163 /misc | |
parent | ace33d16dde47c458fc7411bb8e35db0cc9289c6 (diff) |
word alignment info in binary pt, code provided by Christof Pintaske
git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@3637 1f5c12ca-751b-0410-a591-d2e778427230
Diffstat (limited to 'misc')
-rw-r--r-- | misc/queryPhraseTable.cpp | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/misc/queryPhraseTable.cpp b/misc/queryPhraseTable.cpp index 6e74d22a8..ef95a1fba 100644 --- a/misc/queryPhraseTable.cpp +++ b/misc/queryPhraseTable.cpp @@ -46,10 +46,10 @@ int main(int argc, char **argv) { srcphrase = Moses::Tokenize<std::string>(line); std::vector<Moses::StringTgtCand> tgtcands; - std::vector<Moses::StringWordAlignmentCand> src_wa, tgt_wa; + std::vector<std::string> wordAlignment; if(useAlignments) - ptree.GetTargetCandidates(srcphrase, tgtcands, src_wa, tgt_wa); + ptree.GetTargetCandidates(srcphrase, tgtcands, wordAlignment); else ptree.GetTargetCandidates(srcphrase, tgtcands); @@ -60,19 +60,7 @@ int main(int argc, char **argv) { std::cout << " |||"; if(useAlignments) { - for(uint j = 0; j < src_wa[i].second.size(); j++) - if(src_wa[i].second[j] == "-1") - std::cout << " ()"; - else - std::cout << " (" << src_wa[i].second[j] << ")"; - std::cout << " |||"; - - for(uint j = 0; j < tgt_wa[i].second.size(); j++) - if(tgt_wa[i].second[j] == "-1") - std::cout << " ()"; - else - std::cout << " (" << tgt_wa[i].second[j] << ")"; - std::cout << " |||"; + std::cout << " " << wordAlignment[i] << " |||"; } for(uint j = 0; j < tgtcands[i].second.size(); j++) |