Skip to content

Ru - Add braille label marks and tests#616

Open
Kostenkov-2021 wants to merge 80 commits into
daisy:rufrom
Kostenkov-2021:ru
Open

Ru - Add braille label marks and tests#616
Kostenkov-2021 wants to merge 80 commits into
daisy:rufrom
Kostenkov-2021:ru

Conversation

@Kostenkov-2021

Copy link
Copy Markdown
Contributor

Introduce comprehensive Russian braille label handling: new label/mark rules (exact-over/under, upper/lower-right, repeated/no-indicator, left-labels) and mmultiscripts prescript/postscript logic in Rules/Braille/Russian/Russian_Rules.yaml. Add Unicode braille mappings and new definition maps (RussianLabelMarks, RussianExactOverLabelMarksWithoutIndicator, RussianUpperRightLabelMarksWithoutIndicator) in definitions.yaml and unicode.yaml, and change '%' mapping. Expand tests (tests/braille/Russian/russian.rs) with cases for percent/special marks, labeled table rows, mmultiscripts variants, digit sequences, infinity index, complex sup fractions and many label-mark expectations.

moritz-gross and others added 30 commits May 30, 2026 18:10
… update unit tests to include 2x3 and 3x4 augmented matrix scenarios. (daisy#555)
Fixes daisy#528.

Includes the tests in the PR.
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.
…CE 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).
  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.
… into audit-tool-compare-any-language

# Conflicts:
#	PythonScripts/audit_translations/renderer.py
* initial addition of core concept names

* defnitions and tests, with a few failing

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

Add source language option to translation audit tool
…-version

use "ruamel.yaml>=0.19.1" in uv.lock and pyproject.toml
* 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 次方根 的讀法,基底 -> 基、底

* 向量 -> 射線

* 基 -> 基底,底 -> 基底
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.
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.
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.
Introduce comprehensive Russian braille label handling: new label/mark rules (exact-over/under, upper/lower-right, repeated/no-indicator, left-labels) and mmultiscripts prescript/postscript logic in Rules/Braille/Russian/Russian_Rules.yaml. Add Unicode braille mappings and new definition maps (RussianLabelMarks, RussianExactOverLabelMarksWithoutIndicator, RussianUpperRightLabelMarksWithoutIndicator) in definitions.yaml and unicode.yaml, and change '%' mapping. Expand tests (tests/braille/Russian/russian.rs) with cases for percent/special marks, labeled table rows, mmultiscripts variants, digit sequences, infinity index, complex sup fractions and many label-mark expectations.
Add braille rules for rendering periodic (repeating) decimals like 0,4(71) and mixed numbers with simple/arithmetic fractions in Russian. Includes regex cleanup to remove redundant number indicators in periodic decimal portions and comprehensive test coverage.
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.
Move the special-case braille for the union operator out of the global unicode map and into the Russian rule that handles geometric prefix usage, and tighten the rule match to only trigger when preceded by a number. Update unicode.yaml to a consistent union mapping. Add unit tests covering set relations (∈, ∉, ⊂, ⊄, ∩, ∪), empty set, and quantifiers (∀, ∃) plus geometry/operator cases to validate the new behavior.

Files changed: Rules/Braille/Russian/Russian_Rules.yaml, Rules/Braille/Russian/unicode.yaml, tests/braille/Russian/russian.rs
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 support for chemical equations in Russian Braille, including:
- Single-letter element group notation with prefix marker ⠸
- Reaction arrow handling for mover, munder, and munderover (above, below, above-and-below)
- Improved chemical element rendering with InChemElementGroup context variable

Includes comprehensive test cases for various chemical formula patterns and reaction arrow configurations.
Update Russian braille symbol map and extend tests. Rules/Braille/Russian/unicode.yaml: add mappings for №, §, …, ↵, ⏎ and ⍰. tests/braille/Russian/russian.rs: add source_general_math_text_rules unit (covers №, §, ellipsis, return symbols and mixed expressions) and a roman-numeral Latin-indicator test. Ensures MathCAT produces expected braille outputs for these symbols and cases.
Adds support for column arithmetic formatting with dedicated rules for operators and continuation numbers. Improves fraction rendering for negative denominators and decimal numbers. Enhances trigonometric function handling with power notation and mixed subscript/superscript support. Adds comprehensive tests covering column arithmetic, thin fractions, indexes, and various mathematical constructs.
Replace push_str() and insert_str() calls with more efficient push() and insert() methods when operating on single Braille characters. This is more idiomatic Rust and avoids unnecessary string allocation overhead.
Convert many Russian speech entries from t: to T: (marking translations as verified) across SharedRules (calculus, geometry, linear-algebra, overview, etc.). Add new RU rules: power-indexed-by, unit-terse, a currency placeholder, and several navigation parity/placeholder rules (into-or-out-of-*, zoom-in-*, move-next/prev-character, and related none/mprescripts entries). Normalize some tag values (none without quotes). Most new navigation/currency rules use match: false() to preserve existing runtime behavior while providing parity with English rules.
Add braille transcription rules for Russian geometry notation with over/under accents:
- geometry-line-double-arrow: handles double-arrow symbols (↔⟷) in mover
- lower-vector-arrow: handles vector arrows (→⟶⇀⃗) in munder
- lower-geometry-line-double-arrow: handles double-arrow symbols in munder
- lower-vector-bar: handles bar accents (¯‾_ ̄) in munder

Includes corresponding test cases for measurements, physical quantities, and geometry notation.
Add braille rules for vector notation (arrow, bar, and double-arrow postfix operators) and long-division formatting in Russian. Includes support for system braces and new test cases covering vector notation in geometry, long-division examples, and less common mathematical symbols.
Enhance mmultiscripts rule to handle postscripts (subscripts/superscripts after base element) in addition to prescripts. Add new character mappings for '?' and '←' symbols as label marks in Russian Braille. Includes comprehensive test coverage for the new functionality.
Simplify the Russian braille representation for the percent sign (%) by removing the middle dot, and add support for the per mille sign (‰) with its braille representation. Updates corresponding test cases.
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
Clean up redundant '&' borrows in formatting and logging calls. Updated src/prefs.rs and src/shim_filesystem.rs to pass values directly (e.g. using self.error, path.display(), pref_to_string(...)) instead of creating unnecessary double-references like &&String. This is a small code-style/linting cleanup with no intended behavior change.
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

6 participants