summaryrefslogtreecommitdiff
path: root/decoder/fdict.cc
diff options
context:
space:
mode:
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;