From fa91c76321460773e0de7fc077db5a3c919eb89b Mon Sep 17 00:00:00 2001 From: "philblunsom@gmail.com" Date: Tue, 29 Jun 2010 17:06:03 +0000 Subject: Added different executable for working with context models, changed input/output processing. git-svn-id: https://ws10smt.googlecode.com/svn/trunk@54 ec762483-ff6d-05da-a07a-a48fb63a330f --- decoder/dict.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'decoder') diff --git a/decoder/dict.h b/decoder/dict.h index bc3a904a..39baf6ed 100644 --- a/decoder/dict.h +++ b/decoder/dict.h @@ -8,6 +8,8 @@ #include #include +#include +#include #include "wordid.h" @@ -36,7 +38,7 @@ class Dict { std::string word= ""; for (std::vector::const_iterator it=words.begin(); it != words.end(); ++it) { - if (it != words.begin()) word += "__"; + if (it != words.begin()) word += "|||"; word += *it; } @@ -49,6 +51,12 @@ class Dict { return words_[id-1]; } + inline std::vector AsVector(const WordID& id) const { + std::vector result; + boost::algorithm::split_regex(result, Convert(id), boost::regex("\\|\\|\\|")); + return result; + } + void clear() { words_.clear(); d_.clear(); } private: -- cgit v1.2.3