diff options
Diffstat (limited to 'decoder/tdict.cc')
-rw-r--r-- | decoder/tdict.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/decoder/tdict.cc b/decoder/tdict.cc index 6794bc79..7b56d259 100644 --- a/decoder/tdict.cc +++ b/decoder/tdict.cc @@ -85,6 +85,17 @@ std::string TD::GetString(const std::vector<WordID>& str) { return o.str(); } +std::string TD::GetString(WordID const* i,WordID const* e) { + ostringstream o; + bool sp=false; + for (;i<e;++i,sp=true) { + if (sp) + o << ' '; + o << TD::Convert(*i); + } + return o.str(); +} + int TD::AppendString(const WordID& w, int pos, int bufsize, char* buffer) { const char* word = TD::Convert(w); |