Skip to content

translation audit tool lack considering ordering of rules #619

Closed

Description

@hjy1210

In overview.yaml, there is a line
- include: "SimpleSpeak_Rules.yaml"
put this line at top or bottom of overview.yaml will have a different behavior in navigating math content.

Translation audit tool do not detect such things.

Activity

  1. TimArborealis commented on Jul 1, 2026

    @TimArborealis
    Collaborator

    I agree that it would be useful if the audit tool would catch differences in the order of the rules.

  2. moved this from Triage to Ready in MathCAT Project Boardon Jul 28, 2026
  3. moritz-gross commented on Aug 6, 2026

    @moritz-gross
    Collaborator

    right now, rule order is not considered at all.

    once we would consider the order, will there also be a need for a an ignore-marker for the auditing tool, e.g. for when there is an extra rule that would shift every following item back by one position?

    how often is there a need to change rule order generally? can you give me some examples so I can get a feel for how that works like in practice?

  4. moritz-gross commented on Aug 6, 2026

    @moritz-gross
    Collaborator

    @NSoiffer what do you think about how to implement such a thing? using a list instead of dict as container and then reporting the first differing index is pretty straightforward, but once you want to consider stuff like detecting extra-items etc., you start getting in the realms of minimum edit distance metrics, a la Levenshtein distance, at least from what it looks like to me

  5. moritz-gross commented on Aug 6, 2026

    @moritz-gross
    Collaborator

    @hjy1210 items of the form - include: xyz are not yet supported, as I focused on rules of the usual name/tag/match/replace/... structure.

    Is - include the only other "rule type" to consider, or are there even more?
    Technically, it is not really a rule in itself, as it only points somewhere else, so I'd need to unfold that recursively in the parser to get the actual rules the include-statement points towards. bothering you again, what do you think @NSoiffer ;)

  6. TimArborealis commented on Aug 11, 2026

    @TimArborealis
    Collaborator

    Speaking for myself, I think an altered order of the rules would be a rather rare case. The most common scenario I can think of is if you would add a new rule to your translation and accidentally place it in the wrong order, which then might affect when it is triggered. There might be exceptions where you'd deliberately want to change the order of the rules, so # audit-ignore would be good to be able to use for order as well. I can't think of any concrete examples, though.

  7. moritz-gross commented on Aug 23, 2026

    @moritz-gross
    Collaborator

    after thinking about this for a bit, I think a pragmatic way to do this is to:

    • only consider rules that are present in the files for both languages, in both cases not marked as # audit-ignore
    • to then check if their order is exactly equal, or if not, at which index they first diverge
    • enable it by default, or disable with a flag like --ignore-rule-order.

    Does this plan sound good? @hjy1210 is this close to what you had in mind?

    this does not cover the include statement that you mentioned though. as it is not a rule like the other objects in the file, this would introduce a lot of complexity, and in 99% of cases it should be at the top of the file anyway I think.

  8. moved this from Ready to In progress in MathCAT Project Boardon Sep 23, 2026
  9. moved this from In progress to In review in MathCAT Project Boardon Sep 23, 2026
  10. moritz-gross commented on Sep 23, 2026

    @moritz-gross
    Collaborator

    should be done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

discussionRequires discussion to decide next stepspythonCoding in PythonrulesPertains to Rules

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions