summaryrefslogtreecommitdiff
path: root/decoder/hg_intersect.cc
diff options
context:
space:
mode:
Diffstat (limited to 'decoder/hg_intersect.cc')
-rw-r--r--decoder/hg_intersect.cc8
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;
}
+}
+