diff options
author | Phil Williams <philip.williams@mac.com> | 2015-07-17 16:10:50 +0300 |
---|---|---|
committer | Phil Williams <philip.williams@mac.com> | 2015-07-17 16:11:56 +0300 |
commit | c1142741a159034eee3b1d10453498c09a77beb0 (patch) | |
tree | 3370130d0acb224c56994eb5af98929b491d19ac /phrase-extract | |
parent | a64468a9919867174beba71962ada795a4ce12d3 (diff) |
relax-parse: write node attributes to output
Diffstat (limited to 'phrase-extract')
-rw-r--r-- | phrase-extract/relax-parse-main.cpp | 9 |
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; } |