Commit af99061b authored by Robert Ricci's avatar Robert Ricci
Browse files

Fix a bad pclass bug that could cause pnodes with different sets of

features to be lumped togther in one pclass. We were checking to make
sure that the second node passed to pclass_equiv() had all the
features of the first, but not that the first has all the features of
the second.
parent b8610647
......@@ -115,6 +115,20 @@ int pclass_equiv(tb_pgraph &PG, tb_pnode *a,tb_pnode *b)
return 0;
// have to go both ways in case the second node has a feature the first
// doesn't
for (tb_pnode::features_map::iterator it=b->features.begin();
it != b->features.end();++it) {
const crope &b_feature = (*it).first;
const double b_weight = (*it).second;
tb_pnode::features_map::iterator ait;
ait = a->features.find(b_feature);
if (ait == a->features.end()) {
return 0;
// check links - to do this we first create sets of every link in b.
// we then loop through every link in a, find a match in the set, and
// remove it from the set.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment