Skip to content

Update match pattern and translation rules for "curl" in calculus.yaml#432

Merged
NSoiffer merged 1 commit into
daisy:mainfrom
moritz-gross:de-calculus-curl
Dec 30, 2025
Merged

Update match pattern and translation rules for "curl" in calculus.yaml#432
NSoiffer merged 1 commit into
daisy:mainfrom
moritz-gross:de-calculus-curl

Conversation

@moritz-gross
Copy link
Copy Markdown
Collaborator

@moritz-gross moritz-gross commented Dec 27, 2025

This is my first minor PR to get started with the rules for German.

My thoughts:

  • Why does en/SharedRules/calculus.yaml have the condition match: "count(*) = 1", while the one for German so far uses "." ? I think it makes sense to only match when there is exactly one child, in both languages.
  • Rotation is a noun, therefore should be written in uppercase (this is pretty strict, basically the only time you don't do this if you are casually texting or something like that, but never in a formal publication)
  • The English case supports "$Verbosity!='Terse'", while the German one does not. Generally, this should be supported as much as possible, right?
  • The # phrase should always be an example for the language in use, so is this just a copy-paste error?

@NSoiffer
Copy link
Copy Markdown
Collaborator

Answering questions in order:

Why does en/SharedRules/calculus.yaml have the condition match: "count(*) = 1"...

That's being defensive, but it very likely won't matter in practice. MathCAT will only ever generate "curl" (and "div", etc) with one child. However, they can be created with MathML 4 via intent="curl($arg)" and someone could write intent="curl($arg1, arg2)". However both rules only speak the first child (- x: "*[1]"), so the first is more correct.

I've been moving toward a simpler system for "simple" rules like this. They are defined as one-liners in definitions.yaml. In fact, it appears that "curl" is already added for English and German and that I missed removing it from calculus.yaml. This yet another area where more clean up is needed: #381mentions it. I've not pushed on it much because I'm still cleaning up and thinking about some navigation bugs/non-ideal speech related to this change. But it needs to get done sometime...

Rotation is a noun, therefore should be written in uppercase...

I've avoided using capital letters for fear the speech engines would distinguish their speech in some way. NVDA and JAWS both have options for how capital letters should be spoken while navigating. But your change made me go back and try using them for when speaking words, not letters during navigation and at least in my tests with NVDA, they don't get spoken any differently. So it is OK to use capitals. Proper capitalization won't affect the speech and so isn't noticeable in that sense, but if you copy/paste the speech (an option in NVDA and maybe JAWS), I can see how it would be better for it to be proper German. It took a few tries before I was convinced that the speech wasn't affected, hence the delay in approving this.

The English case supports "$Verbosity!='Terse'", while the German one does not. Generally, this should be supported as much as possible, right?

Yes, as long as it makes sense. There are some languages where the translators never added "the" or never added "of". There may be cases where in English, there isn't a verbose form for something but in other languages there is. What gets said, and what happens for each option, is something that I leave to the translator to decide.

The # phrase should always be an example for the language in use, so is this just a copy-paste error?

I added phrases in the hope that having some context would improve google's translation. It hasn't helped anywhere near as much as I had hoped. But maybe it will help for DeepL? The way it works is that instead of sending like 'curl' to google and getting back a translation, the script sends "the 'curl of' a field" and then looks at the result and picks out the translated word inside the '...'. Sadly, sometime what comes back doesn't have single quotes. That is one of the things that has made automating the translations harder.

@NSoiffer NSoiffer merged commit 29239f1 into daisy:main Dec 30, 2025
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants