summaryrefslogtreecommitdiff
path: root/decoder/fdict.cc
diff options
context:
space:
mode:
authorgraehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-08-07 02:24:51 +0000
committergraehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-08-07 02:24:51 +0000
commitf86133971c2bf97ac53873e28adf05c863c72b49 (patch)
tree009c510b1cfa9b55fded88fa792be094f7cb8324 /decoder/fdict.cc
parentf9d54fd08e217c7bca19f7c821a64d8ae9d81a2a (diff)
propagation of feature name+debug from factory, return correct features array for fsa ffs
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@486 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'decoder/fdict.cc')
-rw-r--r--decoder/fdict.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/decoder/fdict.cc b/decoder/fdict.cc
index 65187685..baa0b552 100644
--- a/decoder/fdict.cc
+++ b/decoder/fdict.cc
@@ -2,12 +2,26 @@
#include "stdlib.h"
//for malloc (need on cygwin); todo <cstdlib> and std::malloc
#include <string>
+#include <sstream>
using namespace std;
Dict FD::dict_;
bool FD::frozen_ = false;
+std::string FD::Convert(std::vector<WordID> const& v) {
+ return Convert(&*v.begin(),&*v.end());
+}
+
+std::string FD::Convert(WordID const *b,WordID const* e) {
+ ostringstream o;
+ for (WordID const* i=b;i<e;++i) {
+ if (i>b) o << ' ';
+ o << FD::Convert(*i);
+ }
+ return o.str();
+}
+
static int HexPairValue(const char * code) {
int value = 0;
const char * pch = code;