diff --git a/dlib/optimization/find_max_parse_cky.h b/dlib/optimization/find_max_parse_cky.h index 3fbce6c27..caac6dd65 100644 --- a/dlib/optimization/find_max_parse_cky.h +++ b/dlib/optimization/find_max_parse_cky.h @@ -238,7 +238,7 @@ namespace dlib template void print_parse_tree_helper ( const std::vector >& tree, - const std::vector& items, + const std::vector& words, unsigned long i, std::ostream& out ) @@ -254,19 +254,19 @@ namespace dlib if (tree[i].left < tree.size()) { left_recurse = true; - print_parse_tree_helper(tree, items, tree[i].left, out); + print_parse_tree_helper(tree, words, tree[i].left, out); } else { - if (tree[i].c.begin < items.size()) + if (tree[i].c.begin < words.size()) { - out << items[tree[i].c.begin] << " "; + out << words[tree[i].c.begin] << " "; } else { std::ostringstream sout; sout << "Parse tree refers to element " << tree[i].c.begin - << " of sequence which is only of size " << items.size() << "."; + << " of sequence which is only of size " << words.size() << "."; throw parse_tree_to_string_error(sout.str()); } } @@ -276,19 +276,19 @@ namespace dlib if (left_recurse == true) out << " "; - print_parse_tree_helper(tree, items, tree[i].right, out); + print_parse_tree_helper(tree, words, tree[i].right, out); } else { - if (tree[i].c.k < items.size()) + if (tree[i].c.k < words.size()) { - out << items[tree[i].c.k]; + out << words[tree[i].c.k]; } else { std::ostringstream sout; sout << "Parse tree refers to element " << tree[i].c.k - << " of sequence which is only of size " << items.size() << "."; + << " of sequence which is only of size " << words.size() << "."; throw parse_tree_to_string_error(sout.str()); } } @@ -303,14 +303,14 @@ namespace dlib template std::string parse_tree_to_string ( const std::vector >& tree, - const std::vector& items + const std::vector& words ) { if (tree.size() == 0) return ""; std::ostringstream sout; - impl::print_parse_tree_helper(tree, items, 0, sout); + impl::print_parse_tree_helper(tree, words, 0, sout); return sout.str(); } @@ -319,14 +319,14 @@ namespace dlib template std::string parse_tree_to_string_tagged ( const std::vector >& tree, - const std::vector& items + const std::vector& words ) { if (tree.size() == 0) return ""; std::ostringstream sout; - impl::print_parse_tree_helper(tree, items, 0, sout); + impl::print_parse_tree_helper(tree, words, 0, sout); return sout.str(); } diff --git a/dlib/optimization/find_max_parse_cky_abstract.h b/dlib/optimization/find_max_parse_cky_abstract.h index 1f20b852a..7b2119215 100644 --- a/dlib/optimization/find_max_parse_cky_abstract.h +++ b/dlib/optimization/find_max_parse_cky_abstract.h @@ -136,7 +136,7 @@ namespace dlib template std::string parse_tree_to_string ( const std::vector >& tree, - const std::vector& items + const std::vector& words ); /*! ensures @@ -148,7 +148,7 @@ namespace dlib template std::string parse_tree_to_string_tagged ( const std::vector >& tree, - const std::vector& items + const std::vector& words ); /*! ensures