| 304 | |
| 305 | template <typename T, typename U> |
| 306 | std::string parse_tree_to_string ( |
| 307 | const std::vector<parse_tree_element<T> >& tree, |
| 308 | const std::vector<U>& words, |
| 309 | const unsigned long root_idx = 0 |
| 310 | ) |
| 311 | { |
| 312 | if (root_idx >= tree.size()) |
| 313 | return ""; |
| 314 | |
| 315 | std::ostringstream sout; |
| 316 | impl::print_parse_tree_helper<false,false>(tree, words, root_idx, tree[root_idx].tag, sout); |
| 317 | return sout.str(); |
| 318 | } |
| 319 | |
| 320 | // ----------------------------------------------------------------------------------------- |
| 321 | |