diff options
author | redpony <redpony@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-06-29 17:21:28 +0000 |
---|---|---|
committer | redpony <redpony@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-06-29 17:21:28 +0000 |
commit | 1a1f3094010bd85acbfefe64743ebde04f0b41a4 (patch) | |
tree | 18a740aac72eee3eef70d3b3788b8bca121424ad /decoder | |
parent | 321b5cfe9ce2a84e62cdd185b55cbac5c133b549 (diff) |
isolate warning messages
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@56 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'decoder')
-rw-r--r-- | decoder/Makefile.am | 1 | ||||
-rw-r--r-- | decoder/dict.cc | 11 | ||||
-rw-r--r-- | decoder/dict.h | 8 |
3 files changed, 13 insertions, 7 deletions
diff --git a/decoder/Makefile.am b/decoder/Makefile.am index 44d6adc8..fd4589e4 100644 --- a/decoder/Makefile.am +++ b/decoder/Makefile.am @@ -47,6 +47,7 @@ libcdec_a_SOURCES = \ rule_lexer.cc \ fst_translator.cc \ csplit.cc \ + dict.cc \ translator.cc \ scfg_translator.cc \ hg.cc \ diff --git a/decoder/dict.cc b/decoder/dict.cc new file mode 100644 index 00000000..485fa348 --- /dev/null +++ b/decoder/dict.cc @@ -0,0 +1,11 @@ +#include "dict.h" + +#include <string> +#include <vector> +#include <boost/regex.hpp> +#include <boost/algorithm/string/regex.hpp> + +void Dict::AsVector(const WordID& id, std::vector<std::string>* results) const { + boost::algorithm::split_regex(*results, Convert(id), boost::regex("\\|\\|\\|")); +} + diff --git a/decoder/dict.h b/decoder/dict.h index 39baf6ed..1c8ebb67 100644 --- a/decoder/dict.h +++ b/decoder/dict.h @@ -8,8 +8,6 @@ #include <vector> #include <boost/functional/hash.hpp> -#include <boost/regex.hpp> -#include <boost/algorithm/string/regex.hpp> #include "wordid.h" @@ -51,11 +49,7 @@ class Dict { return words_[id-1]; } - inline std::vector<std::string> AsVector(const WordID& id) const { - std::vector<std::string> result; - boost::algorithm::split_regex(result, Convert(id), boost::regex("\\|\\|\\|")); - return result; - } + void AsVector(const WordID& id, std::vector<std::string>* results) const; void clear() { words_.clear(); d_.clear(); } |