Try to keep the query and reference levels equal.

This commit is contained in:
Ryan Curtin
2015-03-12 15:42:45 -04:00
parent 3dc8249ce7
commit 595ae211e2
@@ -67,7 +67,9 @@ DualTreeTraverser<RuleType>::Traverse(
numBaseCases += referenceNode.Count();
}
}
else if ((!queryNode.IsLeaf()) && referenceNode.IsLeaf())
else if (((!queryNode.IsLeaf()) && referenceNode.IsLeaf()) ||
(queryNode.NumDescendants() > 3 * referenceNode.NumDescendants() &&
!queryNode.IsLeaf() && !referenceNode.IsLeaf()))
{
// We have to recurse down the query node. In this case the recursion order
// does not matter.