Skip to content

Fix Russian speech rules and expand tests - #767

Merged
NSoiffer merged 5 commits into
daisy:rufrom
Kostenkov-2021:ru
Sep 22, 2026
Merged

NSoiffer merged 5 commits into
daisy:rufrom
Kostenkov-2021:ru

Conversation

@Kostenkov-2021

Copy link
Copy Markdown
Contributor

To clarify the Russian mathematical terminology, the names of letters, the reading of rare symbols, integrals and geometric objects.

Correct the matching of service words, numerical forms of units of measurement, and phrases for reviewing matrices and tables. Add compatibility with 19 character groups and fix MathJax arrow matches.

Extend SimpleSpeak and ClearSpeak checks in the following modes Terse, Medium, and Verbose, including designed alphabets, MathType symbols, chemical designations, and capital letter settings.

Update
markers of confirmed transfers to T, OT, and SPELL.

To clarify the Russian mathematical terminology, the names of letters,
the reading of rare symbols, integrals and geometric objects.

Correct the matching of service words, numerical forms of units
of measurement, and phrases for reviewing matrices and tables. Add compatibility
with 19 character groups and fix MathJax arrow matches.

Extend SimpleSpeak and ClearSpeak checks in the following modes
Terse, Medium, and Verbose, including designed alphabets,
MathType symbols, chemical designations, and capital letter settings.

Update
markers of confirmed transfers to T, OT, and SPELL.
To keep the MathType U+F220–U+F236 table unconfirmed:
a reliable character match has not yet been established.
Correct the Russian unicode-full rule entry by changing the key from `spell` to `SPELL`. This aligns the mapping with the expected rule format and preserves the Greek-letter pronunciation for the affected Unicode range.
Refactor several functions to use tuple assignments and pattern matching for clearer, immutable bindings: canonicalize.rs (first/last child), chemistry.rs (prescripts/postscripts), and tts.rs (before/after lengths). Also update Russian navigation tests in navigate.rs (expected speech strings and a clarifying comment) to reflect the changed phrasing/cue for fractions inside square roots. These are purely refactors and test expectation updates to match the new output wording.
@moritz-gross moritz-gross added rules Pertains to Rules translation Language translation of math/code labels Sep 16, 2026
@moritz-gross

Copy link
Copy Markdown
Collaborator

this PR has multiple changes in the core Rust code, in addition to changes on the Russian localization: canonicalize.rs seems to shorten the program flow using tuple assignments, and chemistry.rs and tts.rs look similar.

Can you open those changes in a new PR, and keep this PR focused on files within Rules/Languages/ru ?
Also, this new Rust-focused PR should then be targeted at daisy:main instead. From what I could tell, the changes seem reasonable, so I'd like to approve them separately.

I'm pretty sure there is a way to do this with fancy git moves, but personally I'd just copy-paste the changes I want, most likely.

Replace tuple-based temporary returns with explicit variable bindings for clarity and to avoid borrow/lifetime issues. Changes:
- canonicalize.rs: declare first_child/last_child before branch and then convert to elements; simplifies fence-detection logic.
- chemistry.rs: assign prescripts/postscripts to named slices instead of returning a tuple.
- tts.rs: compute before_len/after_len via separate assignments inside match instead of returning a tuple.
No behavioral changes intended; purely refactors for readability and safety.
This change refreshes the Russian user and helper documentation, expanding the translator guidance and improving the structure of the setup, navigation, and settings sections. It also standardizes the MathCAT branding in the Russian titles and wording.
@NSoiffer

Copy link
Copy Markdown
Collaborator

Thanks for cleaning up the PR.

@NSoiffer
NSoiffer merged commit 88b17a6 into daisy:ru Sep 22, 2026
6 of 8 checks passed
@github-project-automation github-project-automation Bot moved this from Triage to Done in MathCAT Project Board Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rules Pertains to Rules translation Language translation of math/code

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants