Skip to content

Ru - Improve wording of Russian docs - #661

Merged
NSoiffer merged 46 commits into
daisy:rufrom
Kostenkov-2021:ru
Aug 11, 2026
Merged

Ru - Improve wording of Russian docs#661
NSoiffer merged 46 commits into
daisy:rufrom
Kostenkov-2021:ru

Conversation

@Kostenkov-2021

Copy link
Copy Markdown
Contributor

Replace "Трудности в обучении" with "Когнитивные нарушения" in docs/ru/User_guide_for_MathCAT_ru.md to use a more precise and respectful term for users who need shorter spoken output.

NSoiffer and others added 30 commits August 3, 2026 22:53
…was overly broad, so I removed scripted letters and numbers. That rule made its way into other braille codes, so I removed them everywhere. All tests pass.
…(for accented letters) so that the pattern for them looks like:

```
 - "Ñ": [t: "CA⠘⠻L⠝"]             # 0x00D1
```

Added a few tests.
fix plural forms of physical units in German
This commit adds fixes to Russian Braille. Now the test with parentheses is passed. Also there are devision and multiplication signs have been modified according to the Russian braille specs.
Fix YAML replace syntax and extend Russian braille rules: add chemical-formula-operator-bond and prefix-geometry-ops rules, broaden function-name matching (include tg/ctg variants) and add separator markers. Update unicode mappings (degree sign, invisible characters, conditional ∪ mapping, parallel/arrow glyphs) and adjust several function/operator braille outputs. Add/expand tests to cover functions, geometry, matrices and chemical formulas to validate the changes.
Add Russian (ru) to the list of supported speech languages and update Russian documentation and translation guidance.

- docs/User_guide_for_MathCAT_en.md, docs/index.md: add Russian (ru) to supported languages lists.
- docs/ru/User_guide_for_MathCAT_ru.md: include Russian in language options, reorder entries and apply minor wording fixes.
- docs/ru/helpers.md: clarify wording, update examples and test instructions to reference ru instead of fr, and improve translation guidance and examples (including test and cargo commands).
- docs/ru/index.md: reorder supported languages and polish phrasing.

These edits enable and document Russian support and improve clarity for translators and developers working on the Russian localization.
Replace hardcoded function-name branches in Russian_Rules.yaml with a DefinitionValue lookup that pulls from a new RussianFunctionBraille mapping. Add RussianFunctionBraille entries to definitions.yaml (private-use codepoints U+E100–U+E10E) and map those codepoints to braille strings in unicode.yaml. Add a test covering tan/cot rendering. This centralizes function braille representations and simplifies the rule logic.
This commit adds Russian documentation for users, developers and translators.
Introduce three new mover rules in Rules/Braille/Russian/Russian_Rules.yaml: vector-arrow, vector-bar, and geometry-arc. Each rule detects specific accent characters (arrows: → ⟶ ⇀ ⃗; bars: ¯ ‾ _  ̄; arcs: ⌒ ⏜ ︵) and emits the appropriate braille indicators, using a different form when the base has more than one character. Add corresponding tests in tests/braille/Russian/russian.rs to cover single- and multi-character movers and combined expressions.
Extend Russian braille rules to support additional math functions and large operator limits. Added new rules for large-op-limits, operator/functions (including special handling for div), and div-specific replacements in Rules/Braille/Russian/*. Updated Russian definitions and unicode mappings to include sinh/cosh/tanh/coth, arg/sgn/det/rank/rg, Re/Im, grad/rot/div, gcd/lcm and related braille codes. Updated global Rules/definitions.yaml to recognize new function names. Fixed braille cleanup in src/braille.rs to normalize div encoding. Added unit tests exercising the new function mappings and large operator limits.
Introduce handling for system left-brace matrices in the Russian braille rules: add InSystemLeftBrace variable, a system-left-brace-opener rule and a system-left-brace-table rule to detect brace-enclosed mtable as a system. Update row-start logic to emit appropriate braille tokens when InSystemLeftBrace is set. Add tests exercising curly-brace matrices, piecewise function (brace with conditions), and vertical-bar matrices to verify the new behavior.
Add handling for nested fractions and signed integers inside script positions and adjust grouping behavior for scripts in Russian braille rules. Changes introduce a nested-fraction rule for mfrac and new signed-integer-number / signed-integer rules for msub/munder and msup/mover, plus a small grouping test (⠐) when scripts contain grouped mrow with '+' or a fraction. Also add a comprehensive regression test (script_grouping_regressions) covering many sup/sub cases to ensure correct braille output. Files updated: Rules/Braille/Russian/Russian_Rules.yaml and tests/braille/Russian/russian.rs.
…aisy#589)

* Refine matrix rule handling by adding support for augmented matrices; update unit tests to include 2x3 and 3x4 augmented matrix scenarios. (daisy#555)

* remove logging statement

* removed uneeded eprintlin!()

* Alternative fix to PR daisy#540.
Fixes daisy#528.

Includes the tests in the PR.

* Add Russian translation

* Fix daisy#585 -- SSML was being escaped.

I earlier added code to prevent a SSML injection attack by escaping HTML. It was done at the wrong point and escape legal SSML. I have moved the check and conversion down to the leaves.

I was very surprised there were no useful tests with SSML. All the main tests set `TTS=None`. I added a test that catches bad escaping. I also added some tests to check for leaf-based SSML attacks and also attribute-based ones.

* bump beta number

* The range for MATHEMATICAL SANS-SERIF DIGITs had MATHEMATICAL MONOSPACE DIGITs as the match part of translate, so if one of the sans-serif digits were used, you ended up in a loop (no match, to it returned itself).

* comment out some debug statements

* Add 02DA (˚) to list of circle-like chars -- I thought I had done this already, so it might in some other branch

* Add source language option to translation audit tool

  Allow audit-translations to compare a target language against any source
  language via --source, defaulting to English for existing workflows. Update
  CLI output, docs, and tests for dynamic source/target labels, including
  Swedish/Norwegian comparison coverage.

  Normalize Rich ANSI output in tests so golden and string assertions remain
  stable when terminal color is forced.

* fix ruff

* fix ruff

* fix ruff

* Core concept names additions and tests -- issue 381 (daisy#592)

* initial addition of core concept names

* defnitions and tests, with a few failing

* minus, plus, volume fixes. Other defined, not appearing in site

* fix clippy warnings

* use "ruamel.yaml>=0.19.1" in uv.lock and pyproject.toml

* handle canonicalize failure in containerized environments (daisy#574)

* add 1 week dependency cooldown for uv (daisy#599)

* fix rules for digits in german (daisy#596)

* update navigation rules for traditional chinese (daisy#588)

* copy english version of navigate.yaml from NVDA2026.1 and translate

* 更新 definitions.yaml 與 navigate.yaml

* update unicode-full.yaml

* 區分完全/已完全放大/縮小

* 移至->移到, 表->表格, 數學式->數學, 退出->離開, 不能->無法, 當前->目前。
overview line 47, SimpleSpeak_Rules.yaml line 39, "根號"->""。mroot.rs 對應修改

* 移到上一格 -> 往上一格,移到下一格 -> 往下一格, 佔位符 -> 書籤,設定佔位符 -> 設定書籤,已是最上層 -> 不在別的式子裡面,上一層是 -> 在後面式子裡面,字元模式 開n 次方根 的讀法,基底 -> 基、底

* 向量 -> 射線

* 基 -> 基底,底 -> 基底

* Internally in definitions.yaml, MathCAT uses "nofix", but that's not
a MathML airity property. Remove it.

* don't say "indexed by", say "sub"

* add some terse and verbose forms of speech

* fix typo

* Added an html file with all the test exprs so that translators have examples to test.

* Fix remaining erros after `definitions.yaml` was updated -- needed to add `function:`

* fix clippy warning

* minor cleanup: remove ASCIIMath-fi reference

* Refactor braille.rs to a BrailleCode trait + registry

Replace the four scattered string-match dispatch sites (cleanup,
get_braille_chars, NeedsToBeGrouped, and highlight knobs) with a single
get_braille_code() registry and a BrailleCode trait implemented per code.
Extract the duplicated UEB/Vietnam/Finnish/Swedish indicator-replacement
closures into one apply_indicator_replacements helper plus a UserTypeforms
struct. Behavior is unchanged (all tests/braille pass); adding a new code
now means one registry entry + one impl block.

Co-authored-by: Cursor <cursoragent@cursor.com>

* improved counting for (likey) 8 bit codes when figuring out braille position

* make sure this is part of repo

* add BrailleDocs to repo (stop ignoring)

* updated data, does not include ASCII letters/digits

* First version of Russian Braille

This commit adds first druft version for Russian Braille.

* typo in example

* Russian Braille fixes

This commit adds fixes to Russian Braille. Now the test with parentheses is passed. Also there are devision and multiplication signs have been modified according to the Russian braille specs.

* Braille - Latin and Greek letters fixes

This commit adds a layer of Latin and Greek alphabets for Russian mathematical Braille.
* In unicode.yaml Latin and Greek letters now go through the internal markers of the alphabetic mode.
• In braille.rs russian_cleanup turns these markers into real signs:
◦ Latin lowercase: ⠠
◦ Latin uppercase: ⠨
◦ Greek lowercase: ⠰
◦ Greek uppercase: ⠸
Added tests to russian.rs to x+A+y+B, the Latin letter after the number.

* Braille - Roots, powers and scripts

This commit adds Roots, powers and scripts according to the Russian math Braille specs.

* Update Russian Braille rules and mappings

Fix YAML replace syntax and extend Russian braille rules: add chemical-formula-operator-bond and prefix-geometry-ops rules, broaden function-name matching (include tg/ctg variants) and add separator markers. Update unicode mappings (degree sign, invisible characters, conditional ∪ mapping, parallel/arrow glyphs) and adjust several function/operator braille outputs. Add/expand tests to cover functions, geometry, matrices and chemical formulas to validate the changes.

* Add Russian language to docs

Add Russian (ru) to the list of supported speech languages and update Russian documentation and translation guidance.

- docs/User_guide_for_MathCAT_en.md, docs/index.md: add Russian (ru) to supported languages lists.
- docs/ru/User_guide_for_MathCAT_ru.md: include Russian in language options, reorder entries and apply minor wording fixes.
- docs/ru/helpers.md: clarify wording, update examples and test instructions to reference ru instead of fr, and improve translation guidance and examples (including test and cargo commands).
- docs/ru/index.md: reorder supported languages and polish phrasing.

These edits enable and document Russian support and improve clarity for translators and developers working on the Russian localization.

* Refactor Russian function braille mapping

Replace hardcoded function-name branches in Russian_Rules.yaml with a DefinitionValue lookup that pulls from a new RussianFunctionBraille mapping. Add RussianFunctionBraille entries to definitions.yaml (private-use codepoints U+E100–U+E10E) and map those codepoints to braille strings in unicode.yaml. Add a test covering tan/cot rendering. This centralizes function braille representations and simplifies the rule logic.

* Refine Russian wording in translators guide

Clarify and naturalize Russian phrasing in the translators guide: add explicit "на русском языке" to SimpleSpeak examples; change exponent wording to "в квадрате" with example "икс в квадрате"; make fraction wording more natural ("числитель разделить на знаменатель" and example "метр за секунду"); fix "английском" → "английском языке"; and update Braille tooling phrasing to "просмотрщиком Брайля" and "дисплее Брайля" for consistency.

* Add alphabet indicators in russian_cleanup

Insert a preprocessing step that injects braille alphabet indicators before running REPLACE_INDICATORS. A new helper add_russian_alphabet_indicators scans the raw braille and emits specific indicators for 'l' (Latin lowercase), 'u' (Latin uppercase), 'g' (Greek lowercase) and 'v' (Greek uppercase), avoiding repeated indicators by tracking the current alphabet mode. The helper also resets the mode on 'C', 'N', and '#'. This keeps the existing indicator replacement and space-collapsing logic intact while preventing redundant alphabet indicators.

* Russian braille: add GOST symbols and decimals

Add GOST-style number and symbol support for Russian braille: introduce a decimal-comma rule that emits BrailleChars for integer and fractional parts with a decimal indicator, using PUA digit placeholders. Extend unicode mappings with bracket/brace/slash/backslash/pipe characters, Celsius, context-sensitive prime (′/″) handling, PUA digit-to-braille mappings, and a few arrow/connective symbols. Update tests to cover decimal numbers, fractions, set notation, Celsius, and logical arrows, and adjust expected output for geometry primes to reflect the new context-aware prime handling.

* Add vector/bar/arc mover rules and tests

Introduce three new mover rules in Rules/Braille/Russian/Russian_Rules.yaml: vector-arrow, vector-bar, and geometry-arc. Each rule detects specific accent characters (arrows: → ⟶ ⇀ ⃗; bars: ¯ ‾ _  ̄; arcs: ⌒ ⏜ ︵) and emits the appropriate braille indicators, using a different form when the base has more than one character. Add corresponding tests in tests/braille/Russian/russian.rs to cover single- and multi-character movers and combined expressions.

* Add Russian braille math functions and limits

Extend Russian braille rules to support additional math functions and large operator limits. Added new rules for large-op-limits, operator/functions (including special handling for div), and div-specific replacements in Rules/Braille/Russian/*. Updated Russian definitions and unicode mappings to include sinh/cosh/tanh/coth, arg/sgn/det/rank/rg, Re/Im, grad/rot/div, gcd/lcm and related braille codes. Updated global Rules/definitions.yaml to recognize new function names. Fixed braille cleanup in src/braille.rs to normalize div encoding. Added unit tests exercising the new function mappings and large operator limits.

* Support system left brace in Russian braille

Introduce handling for system left-brace matrices in the Russian braille rules: add InSystemLeftBrace variable, a system-left-brace-opener rule and a system-left-brace-table rule to detect brace-enclosed mtable as a system. Update row-start logic to emit appropriate braille tokens when InSystemLeftBrace is set. Add tests exercising curly-brace matrices, piecewise function (brace with conditions), and vertical-bar matrices to verify the new behavior.

* Add Russian chemistry braille rules and tests

Extend Russian braille rules to handle chemical notation: add rules for equilibrium-arrow, reaction operators, repeated charges, charges, and charge-with-subscript mappings (chemical-reaction-operator, chemistry-mhchem-equilibrium-arrow, chemistry-repeated-charge, chemistry-charge, chemistry-charge-with-subscript). Update Rules/Braille/Russian/Russian_Rules.yaml to map arrows, +/-, superscripts/subscripts and reaction operators to appropriate braille sequences. Add tests in tests/braille/Russian/russian.rs (source_chemical_reactions_and_charges) covering reaction arrows, charges, subscripts/superscripts and combined examples.

---------

Co-authored-by: Moritz Groß <hi@mgross.dev>
Co-authored-by: nsoiffer <soiffer@alum.mit.edu>
Co-authored-by: Tuomas Pyorre <82783219+ttpyorre@users.noreply.github.com>
Co-authored-by: V3nky <venkatesh6114@gmail.com>
Co-authored-by: Hon-Jang Yang <hjy1210@users.noreply.github.com>
Co-authored-by: nsoiffer <neil.soiffer@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Add three new braille encoding rules for geometry operators (∠, △, ∪) in Russian:
- canonical-prefix-geometry-op: handles geometry operators in canonical form
- geometry-prefix-after-canonical-multiplier: handles operators after canonical multipliers
- geometry-prefix-after-multiplier: handles operators after regular multipliers

Includes corresponding test cases for angles, triangles, unions, perpendicular, and similar symbols.
Refactor Russian braille cleanup to properly handle typeform indicators (bold, italic) and mathvariant attributes. Introduces a dedicated typeform indicator function that manages indicator placement according to Russian Braille ГОСТ Р 58511 standard, separating typeform handling from alphabet indicators. Adds support for automatic typeform indicators based on mathvariant attributes, ensuring proper indicator pairing around content blocks. Updates unicode-full.yaml rules to reflect new typeform codes and adds comprehensive tests for various mathvariant combinations.
Add mathvariant inheritance from parent elements to children that lack their own mathvariant attribute. This ensures consistent styling throughout nested elements. Includes tests for bold text propagation through mstyle and mrow containers, and verifies that explicit child mathvariants override inherited values.
- Remove unnecessary borrows in format! and display calls
- Change string slices to arrays in trim_end_matches calls
- Replace expect(&format!(...)) with unwrap_or_else(|_| panic!(...))
- Add clippy allow attributes to suppress false positives in tests
- Add missing newline at end of build.rs
Remove redundant `&` reference operators from arguments passed to format! macros and similar functions. These values are automatically borrowed by the format machinery, so explicit borrows are unnecessary and reduce readability.
Add normalization of Unicode mathematical alphanumeric symbols (Plane 1 digits) to ASCII digits for number nodes containing decimal points. Skip canonicalize_plane1 processing for already-normalized nodes to prevent double processing.
Remove unnecessary `&` borrows in format arguments and replace `.to_string()` with direct display. Simplify byte array literals to byte string literals for readability and idiomatic Rust style.
Drop implicit propagation of the mathvariant attribute from canonicalization (removed propagate_inherited_mathvariant call and helper functions) and update Russian braille tests to set mathvariant explicitly on elements (replace mstyle with mrow and move attributes to mi). Changes in src/canonicalize.rs and tests/braille/Russian/russian.rs. This makes mathvariant handling explicit in tests and avoids mutating child nodes during canonicalization.
Delete the conditional normalization of mathematical digit characters for <mn> text and remove the normalize_math_digits helper from src/canonicalize.rs. Previously the code converted several Unicode math-digit codepoints to ASCII when a decimal point was present.
Update expected spoken/braille test outputs across multiple language test files to match updated speech rules (punctuation handling, table phrasing, and unit/roman-numeral rendering). Removed several #[ignore] annotations for the previously skipped "ignore_period_and_space" tests. Minor tidy in pl/definitions.rs to avoid unnecessary format! usage and fix EOF newline. Affected files include tests/Languages/* for en, fi, fr, hu, nb, pl, sv, vi, and zh/tw.
Update to version 0.7.6-beta.8 with the following changes:

- Migrate to no-unsafe variants of sxd-document and sxd-xpath
- Add 'no-unsafe' feature flag for unsafe-free builds
- Update dependencies: strum, regex, bitflags, env_logger
- Add tempfile dev-dependency
- Improve build.rs: add rerun-if-changed directives earlier and fix indentation
- Exclude BrailleDocs from package
Replace sxd_document/sxd_xpath usages with no-unsafe variants and adapt string types. Key changes in src/braille.rs, src/canonicalize.rs, and src/chemistry.rs: introduce NameStr (feature-gated), use as_str!/as_qname! helpers, convert many attribute_value calls to .as_deref(), update XPath error constructions, and store operator chars as NameStr with PhantomData in OperatorPair. Refactor chemistry tests to helper-based Result flow and use sxd_document_no_unsafe::parser. These edits make the code compatible with the "no-unsafe" pathway and fix lifetime/string mismatches across the codebase.
Replace sxd_document/sxd_xpath with sxd_document_no_unsafe and sxd_xpath_no_unsafe and update imports (including parser). Adjust attribute handling and lifetimes: use as_str!, attribute_value(...).as_deref().unwrap_or_default(), and similar changes to avoid unsafe string lifetimes. Refactor tests to return Result, use ? and panic-catching, and update assertions (e.g. is_empty). Re-enable sample MathML in main, tweak timing_test (disable heavy loops, change loop count). Misc small fixes to satisfy the new APIs and lifetime semantics.
Switch project XML/XPath handling to sxd_document_no_unsafe / sxd_xpath_no_unsafe and adapt code to use as_str!/as_qname! helpers. Update speech and pretty-print logic to use the new context and node APIs, tighten unicode handling, and add debug checks. Refactor TTS APIs so command value accessors return Result and TTS string builders propagate errors. Update tests and prefs helpers (temporary rules dir helper, prefs test flow). Misc: small capacity tweaks and wording fixes in error messages. Files changed: src/prefs.rs, src/pretty_print.rs, src/speech.rs, src/tts.rs.
Replace "Трудности в обучении" with "Когнитивные нарушения" in docs/ru/User_guide_for_MathCAT_ru.md to use a more precise and respectful term for users who need shorter spoken output.
Introduce three Russian GOST-58511 typeform/layout braille rules (small-font, letter-spacing, insertion) to Rules/Braille/Russian/Russian_Rules.yaml with their corresponding braille markers. Expand and reorganize tests in tests/braille/Russian/russian.rs: add coverage for the new typeform indicators, interaction cases, menclose/table/braces, and other edge cases; rename several tests to reflect sectioned/aggregated variants. Also adjust expected braille outputs for a few existing tests (sqrt and geometry matrix cases) to match the new rules/formatting.
@NSoiffer
NSoiffer merged commit 1c79a85 into daisy:ru Aug 11, 2026
6 of 8 checks passed
@github-project-automation github-project-automation Bot moved this from Triage to Done in MathCAT Project Board Aug 11, 2026
@NSoiffer

Copy link
Copy Markdown
Collaborator

I'm not sure what commands you are using for git, but you should only be commiting your changes, not all the others. Except for possibily src/braille.rs, all of your PR commits should be restricted to Russian rules and tests.

FYI: the ru branch is updated to main (but more updates to main are coming).

Kostenkov-2021 added a commit to Kostenkov-2021/MathCAT that referenced this pull request Aug 13, 2026
* update acknowledgment for Russian braille

* update version number because added Russian braille

* UEB has a rule for some pseudo-script chars. The match for that rule was overly broad, so I removed scripted letters and numbers. That rule made its way into other braille codes, so I removed them everywhere. All tests pass.

* Added new UEB chars. Many of these are accented letters. I added 'A' (for accented letters) so that the pattern for them looks like:
```
 - "Ñ": [t: "CA⠘⠻L⠝"]             # 0x00D1
```

Added a few tests.

* Translate German absolute-value ending

* Fix German unit plurals

* Fix German pluralization for "ruthe" and add regression test

* Correct German translations for "ruthe" to "rute" and update regression test

* Expand German unit definitions and add regression test for pluralization

* fix some symbols

* fix german set grammar

* typo in example

* Russian Braille fixes

This commit adds fixes to Russian Braille. Now the test with parentheses is passed. Also there are devision and multiplication signs have been modified according to the Russian braille specs.

* Update Russian Braille rules and mappings

Fix YAML replace syntax and extend Russian braille rules: add chemical-formula-operator-bond and prefix-geometry-ops rules, broaden function-name matching (include tg/ctg variants) and add separator markers. Update unicode mappings (degree sign, invisible characters, conditional ∪ mapping, parallel/arrow glyphs) and adjust several function/operator braille outputs. Add/expand tests to cover functions, geometry, matrices and chemical formulas to validate the changes.

* Add Russian language to docs

Add Russian (ru) to the list of supported speech languages and update Russian documentation and translation guidance.

- docs/User_guide_for_MathCAT_en.md, docs/index.md: add Russian (ru) to supported languages lists.
- docs/ru/User_guide_for_MathCAT_ru.md: include Russian in language options, reorder entries and apply minor wording fixes.
- docs/ru/helpers.md: clarify wording, update examples and test instructions to reference ru instead of fr, and improve translation guidance and examples (including test and cargo commands).
- docs/ru/index.md: reorder supported languages and polish phrasing.

These edits enable and document Russian support and improve clarity for translators and developers working on the Russian localization.

* Refactor Russian function braille mapping

Replace hardcoded function-name branches in Russian_Rules.yaml with a DefinitionValue lookup that pulls from a new RussianFunctionBraille mapping. Add RussianFunctionBraille entries to definitions.yaml (private-use codepoints U+E100–U+E10E) and map those codepoints to braille strings in unicode.yaml. Add a test covering tan/cot rendering. This centralizes function braille representations and simplifies the rule logic.

* Addition of Russian documentation

This commit adds Russian documentation for users, developers and translators.

* typo in example

* Add vector/bar/arc mover rules and tests

Introduce three new mover rules in Rules/Braille/Russian/Russian_Rules.yaml: vector-arrow, vector-bar, and geometry-arc. Each rule detects specific accent characters (arrows: → ⟶ ⇀ ⃗; bars: ¯ ‾ _  ̄; arcs: ⌒ ⏜ ︵) and emits the appropriate braille indicators, using a different form when the base has more than one character. Add corresponding tests in tests/braille/Russian/russian.rs to cover single- and multi-character movers and combined expressions.

* Add Russian braille math functions and limits

Extend Russian braille rules to support additional math functions and large operator limits. Added new rules for large-op-limits, operator/functions (including special handling for div), and div-specific replacements in Rules/Braille/Russian/*. Updated Russian definitions and unicode mappings to include sinh/cosh/tanh/coth, arg/sgn/det/rank/rg, Re/Im, grad/rot/div, gcd/lcm and related braille codes. Updated global Rules/definitions.yaml to recognize new function names. Fixed braille cleanup in src/braille.rs to normalize div encoding. Added unit tests exercising the new function mappings and large operator limits.

* Support system left brace in Russian braille

Introduce handling for system left-brace matrices in the Russian braille rules: add InSystemLeftBrace variable, a system-left-brace-opener rule and a system-left-brace-table rule to detect brace-enclosed mtable as a system. Update row-start logic to emit appropriate braille tokens when InSystemLeftBrace is set. Add tests exercising curly-brace matrices, piecewise function (brace with conditions), and vertical-bar matrices to verify the new behavior.

* Add signed-integer and nested-fraction rules

Add handling for nested fractions and signed integers inside script positions and adjust grouping behavior for scripts in Russian braille rules. Changes introduce a nested-fraction rule for mfrac and new signed-integer-number / signed-integer rules for msub/munder and msup/mover, plus a small grouping test (⠐) when scripts contain grouped mrow with '+' or a fraction. Also add a comprehensive regression test (script_grouping_regressions) covering many sup/sub cases to ensure correct braille output. Files updated: Rules/Braille/Russian/Russian_Rules.yaml and tests/braille/Russian/russian.rs.

* Enhance Russian Braille support with mathematical symbols and rules (daisy#589)

* Refine matrix rule handling by adding support for augmented matrices; update unit tests to include 2x3 and 3x4 augmented matrix scenarios. (daisy#555)

* remove logging statement

* removed uneeded eprintlin!()

* Alternative fix to PR daisy#540.
Fixes daisy#528.

Includes the tests in the PR.

* Add Russian translation

* Fix daisy#585 -- SSML was being escaped.

I earlier added code to prevent a SSML injection attack by escaping HTML. It was done at the wrong point and escape legal SSML. I have moved the check and conversion down to the leaves.

I was very surprised there were no useful tests with SSML. All the main tests set `TTS=None`. I added a test that catches bad escaping. I also added some tests to check for leaf-based SSML attacks and also attribute-based ones.

* bump beta number

* The range for MATHEMATICAL SANS-SERIF DIGITs had MATHEMATICAL MONOSPACE DIGITs as the match part of translate, so if one of the sans-serif digits were used, you ended up in a loop (no match, to it returned itself).

* comment out some debug statements

* Add 02DA (˚) to list of circle-like chars -- I thought I had done this already, so it might in some other branch

* Add source language option to translation audit tool

  Allow audit-translations to compare a target language against any source
  language via --source, defaulting to English for existing workflows. Update
  CLI output, docs, and tests for dynamic source/target labels, including
  Swedish/Norwegian comparison coverage.

  Normalize Rich ANSI output in tests so golden and string assertions remain
  stable when terminal color is forced.

* fix ruff

* fix ruff

* fix ruff

* Core concept names additions and tests -- issue 381 (daisy#592)

* initial addition of core concept names

* defnitions and tests, with a few failing

* minus, plus, volume fixes. Other defined, not appearing in site

* fix clippy warnings

* use "ruamel.yaml>=0.19.1" in uv.lock and pyproject.toml

* handle canonicalize failure in containerized environments (daisy#574)

* add 1 week dependency cooldown for uv (daisy#599)

* fix rules for digits in german (daisy#596)

* update navigation rules for traditional chinese (daisy#588)

* copy english version of navigate.yaml from NVDA2026.1 and translate

* 更新 definitions.yaml 與 navigate.yaml

* update unicode-full.yaml

* 區分完全/已完全放大/縮小

* 移至->移到, 表->表格, 數學式->數學, 退出->離開, 不能->無法, 當前->目前。
overview line 47, SimpleSpeak_Rules.yaml line 39, "根號"->""。mroot.rs 對應修改

* 移到上一格 -> 往上一格,移到下一格 -> 往下一格, 佔位符 -> 書籤,設定佔位符 -> 設定書籤,已是最上層 -> 不在別的式子裡面,上一層是 -> 在後面式子裡面,字元模式 開n 次方根 的讀法,基底 -> 基、底

* 向量 -> 射線

* 基 -> 基底,底 -> 基底

* Internally in definitions.yaml, MathCAT uses "nofix", but that's not
a MathML airity property. Remove it.

* don't say "indexed by", say "sub"

* add some terse and verbose forms of speech

* fix typo

* Added an html file with all the test exprs so that translators have examples to test.

* Fix remaining erros after `definitions.yaml` was updated -- needed to add `function:`

* fix clippy warning

* minor cleanup: remove ASCIIMath-fi reference

* Refactor braille.rs to a BrailleCode trait + registry

Replace the four scattered string-match dispatch sites (cleanup,
get_braille_chars, NeedsToBeGrouped, and highlight knobs) with a single
get_braille_code() registry and a BrailleCode trait implemented per code.
Extract the duplicated UEB/Vietnam/Finnish/Swedish indicator-replacement
closures into one apply_indicator_replacements helper plus a UserTypeforms
struct. Behavior is unchanged (all tests/braille pass); adding a new code
now means one registry entry + one impl block.

Co-authored-by: Cursor <cursoragent@cursor.com>

* improved counting for (likey) 8 bit codes when figuring out braille position

* make sure this is part of repo

* add BrailleDocs to repo (stop ignoring)

* updated data, does not include ASCII letters/digits

* First version of Russian Braille

This commit adds first druft version for Russian Braille.

* typo in example

* Russian Braille fixes

This commit adds fixes to Russian Braille. Now the test with parentheses is passed. Also there are devision and multiplication signs have been modified according to the Russian braille specs.

* Braille - Latin and Greek letters fixes

This commit adds a layer of Latin and Greek alphabets for Russian mathematical Braille.
* In unicode.yaml Latin and Greek letters now go through the internal markers of the alphabetic mode.
• In braille.rs russian_cleanup turns these markers into real signs:
◦ Latin lowercase: ⠠
◦ Latin uppercase: ⠨
◦ Greek lowercase: ⠰
◦ Greek uppercase: ⠸
Added tests to russian.rs to x+A+y+B, the Latin letter after the number.

* Braille - Roots, powers and scripts

This commit adds Roots, powers and scripts according to the Russian math Braille specs.

* Update Russian Braille rules and mappings

Fix YAML replace syntax and extend Russian braille rules: add chemical-formula-operator-bond and prefix-geometry-ops rules, broaden function-name matching (include tg/ctg variants) and add separator markers. Update unicode mappings (degree sign, invisible characters, conditional ∪ mapping, parallel/arrow glyphs) and adjust several function/operator braille outputs. Add/expand tests to cover functions, geometry, matrices and chemical formulas to validate the changes.

* Add Russian language to docs

Add Russian (ru) to the list of supported speech languages and update Russian documentation and translation guidance.

- docs/User_guide_for_MathCAT_en.md, docs/index.md: add Russian (ru) to supported languages lists.
- docs/ru/User_guide_for_MathCAT_ru.md: include Russian in language options, reorder entries and apply minor wording fixes.
- docs/ru/helpers.md: clarify wording, update examples and test instructions to reference ru instead of fr, and improve translation guidance and examples (including test and cargo commands).
- docs/ru/index.md: reorder supported languages and polish phrasing.

These edits enable and document Russian support and improve clarity for translators and developers working on the Russian localization.

* Refactor Russian function braille mapping

Replace hardcoded function-name branches in Russian_Rules.yaml with a DefinitionValue lookup that pulls from a new RussianFunctionBraille mapping. Add RussianFunctionBraille entries to definitions.yaml (private-use codepoints U+E100–U+E10E) and map those codepoints to braille strings in unicode.yaml. Add a test covering tan/cot rendering. This centralizes function braille representations and simplifies the rule logic.

* Refine Russian wording in translators guide

Clarify and naturalize Russian phrasing in the translators guide: add explicit "на русском языке" to SimpleSpeak examples; change exponent wording to "в квадрате" with example "икс в квадрате"; make fraction wording more natural ("числитель разделить на знаменатель" and example "метр за секунду"); fix "английском" → "английском языке"; and update Braille tooling phrasing to "просмотрщиком Брайля" and "дисплее Брайля" for consistency.

* Add alphabet indicators in russian_cleanup

Insert a preprocessing step that injects braille alphabet indicators before running REPLACE_INDICATORS. A new helper add_russian_alphabet_indicators scans the raw braille and emits specific indicators for 'l' (Latin lowercase), 'u' (Latin uppercase), 'g' (Greek lowercase) and 'v' (Greek uppercase), avoiding repeated indicators by tracking the current alphabet mode. The helper also resets the mode on 'C', 'N', and '#'. This keeps the existing indicator replacement and space-collapsing logic intact while preventing redundant alphabet indicators.

* Russian braille: add GOST symbols and decimals

Add GOST-style number and symbol support for Russian braille: introduce a decimal-comma rule that emits BrailleChars for integer and fractional parts with a decimal indicator, using PUA digit placeholders. Extend unicode mappings with bracket/brace/slash/backslash/pipe characters, Celsius, context-sensitive prime (′/″) handling, PUA digit-to-braille mappings, and a few arrow/connective symbols. Update tests to cover decimal numbers, fractions, set notation, Celsius, and logical arrows, and adjust expected output for geometry primes to reflect the new context-aware prime handling.

* Add vector/bar/arc mover rules and tests

Introduce three new mover rules in Rules/Braille/Russian/Russian_Rules.yaml: vector-arrow, vector-bar, and geometry-arc. Each rule detects specific accent characters (arrows: → ⟶ ⇀ ⃗; bars: ¯ ‾ _  ̄; arcs: ⌒ ⏜ ︵) and emits the appropriate braille indicators, using a different form when the base has more than one character. Add corresponding tests in tests/braille/Russian/russian.rs to cover single- and multi-character movers and combined expressions.

* Add Russian braille math functions and limits

Extend Russian braille rules to support additional math functions and large operator limits. Added new rules for large-op-limits, operator/functions (including special handling for div), and div-specific replacements in Rules/Braille/Russian/*. Updated Russian definitions and unicode mappings to include sinh/cosh/tanh/coth, arg/sgn/det/rank/rg, Re/Im, grad/rot/div, gcd/lcm and related braille codes. Updated global Rules/definitions.yaml to recognize new function names. Fixed braille cleanup in src/braille.rs to normalize div encoding. Added unit tests exercising the new function mappings and large operator limits.

* Support system left brace in Russian braille

Introduce handling for system left-brace matrices in the Russian braille rules: add InSystemLeftBrace variable, a system-left-brace-opener rule and a system-left-brace-table rule to detect brace-enclosed mtable as a system. Update row-start logic to emit appropriate braille tokens when InSystemLeftBrace is set. Add tests exercising curly-brace matrices, piecewise function (brace with conditions), and vertical-bar matrices to verify the new behavior.

* Add Russian chemistry braille rules and tests

Extend Russian braille rules to handle chemical notation: add rules for equilibrium-arrow, reaction operators, repeated charges, charges, and charge-with-subscript mappings (chemical-reaction-operator, chemistry-mhchem-equilibrium-arrow, chemistry-repeated-charge, chemistry-charge, chemistry-charge-with-subscript). Update Rules/Braille/Russian/Russian_Rules.yaml to map arrows, +/-, superscripts/subscripts and reaction operators to appropriate braille sequences. Add tests in tests/braille/Russian/russian.rs (source_chemical_reactions_and_charges) covering reaction arrows, charges, subscripts/superscripts and combined examples.

---------

Co-authored-by: Moritz Groß <hi@mgross.dev>
Co-authored-by: nsoiffer <soiffer@alum.mit.edu>
Co-authored-by: Tuomas Pyorre <82783219+ttpyorre@users.noreply.github.com>
Co-authored-by: V3nky <venkatesh6114@gmail.com>
Co-authored-by: Hon-Jang Yang <hjy1210@users.noreply.github.com>
Co-authored-by: nsoiffer <neil.soiffer@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>

* Add Russian braille rules for geometry operators

Add three new braille encoding rules for geometry operators (∠, △, ∪) in Russian:
- canonical-prefix-geometry-op: handles geometry operators in canonical form
- geometry-prefix-after-canonical-multiplier: handles operators after canonical multipliers
- geometry-prefix-after-multiplier: handles operators after regular multipliers

Includes corresponding test cases for angles, triangles, unions, perpendicular, and similar symbols.

* Improve Russian braille typeform and mathvariant handling

Refactor Russian braille cleanup to properly handle typeform indicators (bold, italic) and mathvariant attributes. Introduces a dedicated typeform indicator function that manages indicator placement according to Russian Braille ГОСТ Р 58511 standard, separating typeform handling from alphabet indicators. Adds support for automatic typeform indicators based on mathvariant attributes, ensuring proper indicator pairing around content blocks. Updates unicode-full.yaml rules to reflect new typeform codes and adds comprehensive tests for various mathvariant combinations.

* Propagate mathvariant attribute to children

Add mathvariant inheritance from parent elements to children that lack their own mathvariant attribute. This ensures consistent styling throughout nested elements. Includes tests for bold text propagation through mstyle and mrow containers, and verifies that explicit child mathvariants override inherited values.

* Fix clippy warnings and improve code style

- Remove unnecessary borrows in format! and display calls
- Change string slices to arrays in trim_end_matches calls
- Replace expect(&format!(...)) with unwrap_or_else(|_| panic!(...))
- Add clippy allow attributes to suppress false positives in tests
- Add missing newline at end of build.rs

* Remove unnecessary borrows in format macros

Remove redundant `&` reference operators from arguments passed to format! macros and similar functions. These values are automatically borrowed by the format machinery, so explicit borrows are unnecessary and reduce readability.

* Normalize Unicode math digits in decimal numbers

Add normalization of Unicode mathematical alphanumeric symbols (Plane 1 digits) to ASCII digits for number nodes containing decimal points. Skip canonicalize_plane1 processing for already-normalized nodes to prevent double processing.

* Remove unnecessary references and .to_string() calls

Remove unnecessary `&` borrows in format arguments and replace `.to_string()` with direct display. Simplify byte array literals to byte string literals for readability and idiomatic Rust style.

* Remove mathvariant propagation and update tests

Drop implicit propagation of the mathvariant attribute from canonicalization (removed propagate_inherited_mathvariant call and helper functions) and update Russian braille tests to set mathvariant explicitly on elements (replace mstyle with mrow and move attributes to mi). Changes in src/canonicalize.rs and tests/braille/Russian/russian.rs. This makes mathvariant handling explicit in tests and avoids mutating child nodes during canonicalization.

* Remove math digit normalization for mn nodes

Delete the conditional normalization of mathematical digit characters for <mn> text and remove the normalize_math_digits helper from src/canonicalize.rs. Previously the code converted several Unicode math-digit codepoints to ASCII when a decimal point was present.

* Adjust test expectations and unignore tests

Update expected spoken/braille test outputs across multiple language test files to match updated speech rules (punctuation handling, table phrasing, and unit/roman-numeral rendering). Removed several #[ignore] annotations for the previously skipped "ignore_period_and_space" tests. Minor tidy in pl/definitions.rs to avoid unnecessary format! usage and fix EOF newline. Affected files include tests/Languages/* for en, fi, fr, hu, nb, pl, sv, vi, and zh/tw.

* Bump to 0.7.6-beta.8 and update dependencies

Update to version 0.7.6-beta.8 with the following changes:

- Migrate to no-unsafe variants of sxd-document and sxd-xpath
- Add 'no-unsafe' feature flag for unsafe-free builds
- Update dependencies: strum, regex, bitflags, env_logger
- Add tempfile dev-dependency
- Improve build.rs: add rerun-if-changed directives earlier and fix indentation
- Exclude BrailleDocs from package

* Switch to sxd_document_no_unsafe and NameStr

Replace sxd_document/sxd_xpath usages with no-unsafe variants and adapt string types. Key changes in src/braille.rs, src/canonicalize.rs, and src/chemistry.rs: introduce NameStr (feature-gated), use as_str!/as_qname! helpers, convert many attribute_value calls to .as_deref(), update XPath error constructions, and store operator chars as NameStr with PhantomData in OperatorPair. Refactor chemistry tests to helper-based Result flow and use sxd_document_no_unsafe::parser. These edits make the code compatible with the "no-unsafe" pathway and fix lifetime/string mismatches across the codebase.

* Use no-unsafe sxd crates; adapt code & tests

Replace sxd_document/sxd_xpath with sxd_document_no_unsafe and sxd_xpath_no_unsafe and update imports (including parser). Adjust attribute handling and lifetimes: use as_str!, attribute_value(...).as_deref().unwrap_or_default(), and similar changes to avoid unsafe string lifetimes. Refactor tests to return Result, use ? and panic-catching, and update assertions (e.g. is_empty). Re-enable sample MathML in main, tweak timing_test (disable heavy loops, change loop count). Misc small fixes to satisfy the new APIs and lifetime semantics.

* Use no-unsafe sxd libs; refactor TTS & parsing

Switch project XML/XPath handling to sxd_document_no_unsafe / sxd_xpath_no_unsafe and adapt code to use as_str!/as_qname! helpers. Update speech and pretty-print logic to use the new context and node APIs, tighten unicode handling, and add debug checks. Refactor TTS APIs so command value accessors return Result and TTS string builders propagate errors. Update tests and prefs helpers (temporary rules dir helper, prefs test flow). Misc: small capacity tweaks and wording fixes in error messages. Files changed: src/prefs.rs, src/pretty_print.rs, src/speech.rs, src/tts.rs.

* Improve wording in RU user guide

Replace "Трудности в обучении" with "Когнитивные нарушения" in docs/ru/User_guide_for_MathCAT_ru.md to use a more precise and respectful term for users who need shorter spoken output.

* Add Russian GOST-58511 typeform braille rules and tests

Introduce three Russian GOST-58511 typeform/layout braille rules (small-font, letter-spacing, insertion) to Rules/Braille/Russian/Russian_Rules.yaml with their corresponding braille markers. Expand and reorganize tests in tests/braille/Russian/russian.rs: add coverage for the new typeform indicators, interaction cases, menclose/table/braces, and other edge cases; rename several tests to reflect sectioned/aggregated variants. Also adjust expected braille outputs for a few existing tests (sqrt and geometry matrix cases) to match the new rules/formatting.

---------

Co-authored-by: nsoiffer <soiffer@alum.mit.edu>
Co-authored-by: mgros <hi@mgross.dev>
Co-authored-by: Tuomas Pyorre <82783219+ttpyorre@users.noreply.github.com>
Co-authored-by: V3nky <venkatesh6114@gmail.com>
Co-authored-by: Hon-Jang Yang <hjy1210@users.noreply.github.com>
Co-authored-by: nsoiffer <neil.soiffer@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants