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:
authorPhil Williams <philip.williams@mac.com>2015-07-17 16:10:50 +0300
committerPhil Williams <philip.williams@mac.com>2015-07-17 16:11:56 +0300
commitc1142741a159034eee3b1d10453498c09a77beb0 (patch)
tree3370130d0acb224c56994eb5af98929b491d19ac /phrase-extract
parenta64468a9919867174beba71962ada795a4ce12d3 (diff)
relax-parse: write node attributes to output
Diffstat (limited to 'phrase-extract')
-rw-r--r--phrase-extract/relax-parse-main.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/phrase-extract/relax-parse-main.cpp b/phrase-extract/relax-parse-main.cpp
index f7a2a271b..0ce211e2d 100644
--- a/phrase-extract/relax-parse-main.cpp
+++ b/phrase-extract/relax-parse-main.cpp
@@ -120,8 +120,13 @@ void store( SyntaxNodeCollection &tree, const vector< string > &words )
for( size_t i=0; i<nodes.size(); i++ ) {
cout << " <tree span=\"" << nodes[i]->start
<< "-" << nodes[i]->end
- << "\" label=\"" << nodes[i]->label
- << "\"/>";
+ << "\" label=\"" << nodes[i]->label << "\"";
+ for (SyntaxNode::AttributeMap::const_iterator
+ p = nodes[i]->attributes.begin();
+ p != nodes[i]->attributes.end(); ++p) {
+ cout << " " << p->first << "=\"" << p->second << "\"";
+ }
+ cout << "/>";
}
cout << endl;
}