diff --git a/moses/TranslationModel/UG/mm/ug_tsa_tree_iterator.h b/moses/TranslationModel/UG/mm/ug_tsa_tree_iterator.h index 2cee05dd8..3b710c631 100644 --- a/moses/TranslationModel/UG/mm/ug_tsa_tree_iterator.h +++ b/moses/TranslationModel/UG/mm/ug_tsa_tree_iterator.h @@ -59,6 +59,7 @@ namespace ugdiss // TSA_tree_iterator(TSA_tree_iterator const& other); TSA_tree_iterator(TSA const* s); + TSA_tree_iterator(TSA const* r, id_type const* s, size_t const len); // TSA_tree_iterator(TSA const* s, Token const& t); TSA_tree_iterator(TSA const* s, Token const* kstart, @@ -312,6 +313,17 @@ namespace ugdiss : root(s) {}; + template + TSA_tree_iterator:: + TSA_tree_iterator + (TSA const* r, + id_type const* s, + size_t const len) + : root(r) + { + for (id_type const* e = s + len; s < e && extend(*s); ++s); + }; + // --------------------------------------------------------------------------- #if 0