diff options
author | graehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-08-11 03:24:52 +0000 |
---|---|---|
committer | graehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-08-11 03:24:52 +0000 |
commit | 192aa50db953cf4adc4cca34ed1cdfa45511aeeb (patch) | |
tree | 6e9218e2fb5f4057b3aea9c06c2c3d75929dc6e9 | |
parent | 37cb42aaa0a043fa8cf27a36846dcac7c6180e62 (diff) |
prettier --nt-span=1 binarized labels
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@522 ec762483-ff6d-05da-a07a-a48fb63a330f
-rwxr-xr-x | decoder/cfg.cc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/decoder/cfg.cc b/decoder/cfg.cc index 3ee3a94b..81a17355 100755 --- a/decoder/cfg.cc +++ b/decoder/cfg.cc @@ -13,9 +13,16 @@ namespace { CFG::BinRhs nullrhs(std::numeric_limits<int>::min(),std::numeric_limits<int>::min()); } + WordID CFG::BinName(BinRhs const& b) { - return TD::Convert(lexical_cast<string>(b.first)+"+"+lexical_cast<string>(b.second)); + ostringstream o; +#define BinNameOWORD(w) do { int n=w; if (n>0) o << TD::Convert(n); else { o << 'V' << -n; } } while(0) + BinNameOWORD(b.first); + o<<'+'; + BinNameOWORD(b.second); +#undef BinNameOWORD + return TD::Convert(o.str()); } void CFG::Binarize(CFGBinarize const& b) { |