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
commitaaac9f8ee73ba59b72609af9a78b167312a6dac7 (patch)
tree1273c65f43c124eac220a298acbe7af951b0a83e /decoder/fdict.cc
parente2ef62dc50b9795fc801f97aba7bac8c80bb7c54 (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;