Tweak the Earley ambiguity algorithm to correctly prefer earlier branches

This commit is contained in:
night199uk 2019-08-19 20:35:27 -07:00 committed by Erez Sh
parent dc94ebc42f
commit dc3c009dca
1 changed files with 1 additions and 1 deletions

View File

@ -122,7 +122,7 @@ class PackedNode(ForestNode):
ambiguously. Hence, we use the sort order to identify
the order in which ambiguous children should be considered.
"""
return self.is_empty, -self.priority, -self.rule.order
return self.is_empty, -self.priority, self.rule.order
def __iter__(self):
return iter([self.left, self.right])