diff options
author | Patrick Simianer <simianer@cl.uni-heidelberg.de> | 2012-11-05 15:29:46 +0100 |
---|---|---|
committer | Patrick Simianer <simianer@cl.uni-heidelberg.de> | 2012-11-05 15:29:46 +0100 |
commit | 6f29f345dc06c1a1033475eac1d1340781d1d603 (patch) | |
tree | 6fa4cdd7aefd7d54c9585c2c6274db61bb8b159a /decoder/hg_intersect.cc | |
parent | b510da2e562c695c90d565eb295c749569c59be8 (diff) | |
parent | c615c37501fa8576584a510a9d2bfe2fdd5bace7 (diff) |
merge upstream/master
Diffstat (limited to 'decoder/hg_intersect.cc')
-rw-r--r-- | decoder/hg_intersect.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/decoder/hg_intersect.cc b/decoder/hg_intersect.cc index 6e3bfee6..ad5b701a 100644 --- a/decoder/hg_intersect.cc +++ b/decoder/hg_intersect.cc @@ -79,7 +79,9 @@ static bool FastLinearIntersect(const Lattice& target, Hypergraph* hg) { return (cov.size() == target.size()); } -bool HG::Intersect(const Lattice& target, Hypergraph* hg) { +namespace HG { + +bool Intersect(const Lattice& target, Hypergraph* hg) { // there are a number of faster algorithms available for restricted // classes of hypergraph and/or target. if (hg->IsLinearChain() && target.IsSentence()) @@ -101,7 +103,7 @@ bool HG::Intersect(const Lattice& target, Hypergraph* hg) { // grammar, create the labels here const string kSEP = "_"; for (unsigned i = 0; i < nnodes; ++i) { - const char* pstr = "CAT"; + string pstr = "CAT"; if (hg->nodes_[i].cat_ < 0) pstr = TD::Convert(-hg->nodes_[i].cat_); cats[i] = TD::Convert(pstr + kSEP + lexical_cast<string>(i)) * -1; @@ -160,3 +162,5 @@ bool HG::Intersect(const Lattice& target, Hypergraph* hg) { return true; } +} + |