We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
To reproduce, add this test case to test_mappings.py:
test_mappings.py
def test_rule_ordering_with_indices(self): """a{1}b{3} should be shorter than abc""" rules = [{"in": "a{1}b{2}", "out": "x{1}x{2}"}, {"in": "abc", "out": "y"}] mapping = Mapping(rules=rules, rule_ordering="apply-longest-first") transducer = Transducer(mapping) self.assertEqual(transducer("abc").output_string, "y")
it will fail, saying:
FAIL: test_rule_ordering_with_indices (__main__.MappingTest) a{1}b{3} should be shorter than abc ---------------------------------------------------------------------- Traceback (most recent call last): File "./test_mappings.py", line 186, in test_rule_ordering_with_indices self.assertEqual(transducer("abc").output_string, "y") AssertionError: 'xxc' != 'y' - xxc + y
The text was updated successfully, but these errors were encountered:
fix: sort rules without explicit indices
314220a
fixes: #299
c6f146b
fixes: #299 Co-authored-by: @joanise
d1d5082
fixes: #299 Co-authored-by: Eric Joanis <eric.joanis@nrc-cnrc.gc.ca>
d1aa6dd
Successfully merging a pull request may close this issue.
To reproduce, add this test case to
test_mappings.py
:it will fail, saying:
The text was updated successfully, but these errors were encountered: