-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
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
Rule collection order of rules: add internal rule priority to rule collections #82
Comments
Hi, I think this is because only one rule per collection can be applied to any given span of text. So the TSEK rule takes precedence in the collection, so it is applied to the TSEK sentence, but in the ABCD sentence the TSEK rule does not match, so the other rule can be applied. Rules are not applied consequentially, only rule collections are (i.e. the order of the rules in the rule collection is not significant). So if you want to modify the output of rule application with another rule, you need to create another rule collection, and place it after the first rule collection in the rule collection list. |
Hello Tommi I got lucky then but please not that neither the collections, nor the rules in them can be moved up or down as far as I can see. As always, I know I'm "pedantic", but these problems do come up and where rules are in the wrong order, how to we manage without moving them? |
Hi, I don't recall exactly what the mechanism was for deciding which rule takes precedence (from a quick look at the code, the longest match should always take precedence, but that's not happening here). At the moment I think it's always safest to have rules that affect the whole sentence in a separate collection, and more specific rules that apply to smaller parts of the sentence in separate collections. |
Hello Tommi
I'm normally confused why something doesn't work as I expect but this time I'm confused why it does work !!!
I have two rules in pre-edit, one is to convert all uppercase words to lowercase,
and the other one is to try to protect acronyms like "TSEK" from being converted to "tsek".
And this seems to work but I don't understand why.
If "TSEK" is converted to "tsek" then my rule to preserve "TSEK" should not work as it is not set up to deal with "tsek"
And if "TSEK" is initially preserved as "TSEK", then the conversion rule should subsequently apply and I would expect to see "tsek" at the end.
But the rules work well together (ABCD = control test)
Why is this please?
Thanks
The text was updated successfully, but these errors were encountered: