Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
0e9dbca
Refine matrix rule handling by adding support for augmented matrices;…
moritz-gross May 31, 2026
9ba3b3d
remove logging statement
NSoiffer May 31, 2026
9dc9d89
removed uneeded eprintlin!()
NSoiffer Jun 1, 2026
7044d40
Alternative fix to PR #540.
NSoiffer Jun 1, 2026
cec6805
Merge branch 'main' of https://github.com/daisy/MathCAT
NSoiffer Jun 1, 2026
a8f58d1
Merge branch 'ru'
NSoiffer Jun 1, 2026
278dcf5
Add Russian translation
NSoiffer Jun 1, 2026
4740065
Fix #585 -- SSML was being escaped.
NSoiffer Jun 2, 2026
63a688b
bump beta number
NSoiffer Jun 3, 2026
f595f8d
The range for MATHEMATICAL SANS-SERIF DIGITs had MATHEMATICAL MONOSPA…
NSoiffer Jun 3, 2026
cf0fb14
comment out some debug statements
NSoiffer Jun 3, 2026
0c2c668
Add 02DA (˚) to list of circle-like chars -- I thought I had done thi…
NSoiffer Jun 3, 2026
dec778f
Add source language option to translation audit tool
moritz-gross Jun 5, 2026
7ee775a
fix ruff
moritz-gross Jun 5, 2026
d86d7e5
fix ruff
moritz-gross Jun 5, 2026
454d0a9
Merge remote-tracking branch 'origin/audit-tool-compare-any-language'…
moritz-gross Jun 5, 2026
e0180a3
fix ruff
moritz-gross Jun 5, 2026
cd48925
Core concept names additions and tests -- issue 381 (#592)
ttpyorre Jun 8, 2026
80438d6
fix clippy warnings
NSoiffer Jun 8, 2026
78dfa58
Merge pull request #593 from moritz-gross/audit-tool-compare-any-lang…
moritz-gross Jun 8, 2026
f3796a9
use "ruamel.yaml>=0.19.1" in uv.lock and pyproject.toml
moritz-gross Jun 8, 2026
6f95dad
Merge pull request #595 from moritz-gross/fix/update-ruamal.yaml-version
moritz-gross Jun 8, 2026
fc0a327
handle canonicalize failure in containerized environments (#574)
venkatesh6114 Jun 11, 2026
6cfd4a1
add 1 week dependency cooldown for uv (#599)
moritz-gross Jun 12, 2026
dc9e535
fix rules for digits in german (#596)
moritz-gross Jun 12, 2026
fc4bf93
update navigation rules for traditional chinese (#588)
hjy1210 Jun 12, 2026
939be4a
Internally in definitions.yaml, MathCAT uses "nofix", but that's not
Jun 12, 2026
282ff43
Merge branch 'main' of https://github.com/daisy/MathCAT
Jun 12, 2026
6dd4f6c
don't say "indexed by", say "sub"
Jun 12, 2026
82a1cb4
add some terse and verbose forms of speech
Jun 13, 2026
33b88ec
fix typo
Jun 13, 2026
d96d6cd
Added an html file with all the test exprs so that translators have e…
NSoiffer Jun 14, 2026
12bcca9
Fix remaining erros after `definitions.yaml` was updated -- needed to…
NSoiffer Jun 14, 2026
2769905
fix clippy warning
NSoiffer Jun 14, 2026
7cd9d01
minor cleanup: remove ASCIIMath-fi reference
NSoiffer Jun 14, 2026
8ed33a1
Refactor braille.rs to a BrailleCode trait + registry
NSoiffer Jun 16, 2026
09c161a
improved counting for (likey) 8 bit codes when figuring out braille p…
NSoiffer Jun 16, 2026
1d6896f
make sure this is part of repo
NSoiffer Jun 22, 2026
49a23a8
add BrailleDocs to repo (stop ignoring)
NSoiffer Jun 22, 2026
8d0ae2c
updated data, does not include ASCII letters/digits
NSoiffer Jun 22, 2026
0728f54
First version of Russian Braille
Kostenkov-2021 Jun 1, 2026
8dbff73
typo in example
NSoiffer Jun 1, 2026
6c166d7
Russian Braille fixes
Kostenkov-2021 Jun 3, 2026
7fb107f
Braille - Latin and Greek letters fixes
Kostenkov-2021 Jun 3, 2026
5d8b293
Braille - Roots, powers and scripts
Kostenkov-2021 Jun 3, 2026
cfba39a
Update Russian Braille rules and mappings
Kostenkov-2021 Jun 3, 2026
3c84414
Add Russian language to docs
Kostenkov-2021 Jun 11, 2026
15b35ec
Refactor Russian function braille mapping
Kostenkov-2021 Jun 12, 2026
162af7d
Refine Russian wording in translators guide
Kostenkov-2021 Jun 24, 2026
c2c48a6
Merge branch 'ru' of https://github.com/Kostenkov-2021/MathCAT into ru
Kostenkov-2021 Jun 25, 2026
db01386
Add alphabet indicators in russian_cleanup
Kostenkov-2021 Jun 25, 2026
8b4331d
Russian braille: add GOST symbols and decimals
Kostenkov-2021 Jun 25, 2026
29a7588
Add vector/bar/arc mover rules and tests
Kostenkov-2021 Jun 25, 2026
1f5eaad
Add Russian braille math functions and limits
Kostenkov-2021 Jun 25, 2026
103b3f0
Support system left brace in Russian braille
Kostenkov-2021 Jun 25, 2026
847257a
Add Russian chemistry braille rules and tests
Kostenkov-2021 Jun 25, 2026
ade84d4
Merge branch 'daisy:ru' into ru
Kostenkov-2021 Jun 25, 2026
62103b1
Add signed-integer and nested-fraction rules
Kostenkov-2021 Jun 25, 2026
1bbe33c
Merge branch 'ru' of https://github.com/Kostenkov-2021/MathCAT into ru
Kostenkov-2021 Jun 25, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 87 additions & 0 deletions Rules/Braille/Russian/Russian_Rules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,17 @@
- x: "*[1]"
- t: "⠹"

-
name: nested-fraction
tag: mfrac
match: "parent::m:mfrac"
replace:
- t: "⠆"
- x: "*[1]"
- t: "⠀⠳"
- x: "*[2]"
- t: "⠰"

-
name: simple-numeric
tag: mfrac
Expand Down Expand Up @@ -267,6 +278,41 @@
- t: "#"
- x: "*[1]"

-
name: signed-integer-number
tag: [msub, munder]
match: "*[2][self::m:mn and (substring(., 1, 1)='-' or substring(., 1, 1)='−' or substring(., 1, 1)='+') and translate(substring(., 2), '0123456789', '')='']"
replace:
- x: "*[1]"
- test:
if: "self::m:munder"
then: [t: "⠨⠡"]
else: [t: "⠡"]
- test:
if: "substring(*[2], 1, 1)='+'"
then: [t: "⠖"]
else: [t: "⠤"]
- x: "BrailleChars(translate(substring(*[2], 2), '0123456789', '\ue000\ue001\ue002\ue003\ue004\ue005\ue006\ue007\ue008\ue009'), 'Russian')"

-
name: signed-integer
tag: [msub, munder]
match:
- "*[2][self::m:mrow and count(*)=2 and"
- " *[1][self::m:mo][.='-' or .='−' or .='+'] and"
- " *[2][self::m:mn and translate(., '0123456789', '')='']]"
replace:
- x: "*[1]"
- test:
if: "self::m:munder"
then: [t: "⠨⠡"]
else: [t: "⠡"]
- test:
if: "*[2]/*[1][.='+']"
then: [t: "⠖"]
else: [t: "⠤"]
- x: "BrailleChars(translate(*[2]/*[2], '0123456789', '\ue000\ue001\ue002\ue003\ue004\ue005\ue006\ue007\ue008\ue009'), 'Russian')"

-
name: integer
tag: [msub, munder]
Expand All @@ -289,9 +335,47 @@
if: "self::m:munder"
then: [t: "⠨⠡"]
else: [t: "⠡"]
- test:
if: "*[2][self::m:mrow[m:mo[.='+']] or self::m:mfrac]"
then: [t: "⠐"]
- x: "*[2]"
- t: "⠱"

-
name: signed-integer-number
tag: [msup, mover]
match: "*[2][self::m:mn and (substring(., 1, 1)='-' or substring(., 1, 1)='−' or substring(., 1, 1)='+') and translate(substring(., 2), '0123456789', '')='']"
replace:
- x: "*[1]"
- test:
if: "self::m:mover"
then: [t: "⠨⠌"]
else: [t: "⠌"]
- test:
if: "substring(*[2], 1, 1)='+'"
then: [t: "⠖"]
else: [t: "⠤"]
- x: "BrailleChars(translate(substring(*[2], 2), '0123456789', '\ue000\ue001\ue002\ue003\ue004\ue005\ue006\ue007\ue008\ue009'), 'Russian')"

-
name: signed-integer
tag: [msup, mover]
match:
- "*[2][self::m:mrow and count(*)=2 and"
- " *[1][self::m:mo][.='-' or .='−' or .='+'] and"
- " *[2][self::m:mn and translate(., '0123456789', '')='']]"
replace:
- x: "*[1]"
- test:
if: "self::m:mover"
then: [t: "⠨⠌"]
else: [t: "⠌"]
- test:
if: "*[2]/*[1][.='+']"
then: [t: "⠖"]
else: [t: "⠤"]
- x: "BrailleChars(translate(*[2]/*[2], '0123456789', '\ue000\ue001\ue002\ue003\ue004\ue005\ue006\ue007\ue008\ue009'), 'Russian')"

-
name: chemistry-repeated-charge
tag: msup
Expand Down Expand Up @@ -457,6 +541,9 @@
if: "self::m:munderover"
then: [t: "⠨⠡"]
else: [t: "⠡"]
- test:
if: "*[2][self::m:mrow[m:mo[.='+']] or self::m:mfrac]"
then: [t: "⠐"]
- x: "*[2]"
- test:
if: "self::m:munderover"
Expand Down
102 changes: 102 additions & 0 deletions tests/braille/Russian/russian.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,108 @@
use crate::common::*;
use anyhow::Result;

#[test]
fn script_grouping_regressions() -> Result<()> {
let cases = vec![
("sup_x", r#"<math><msup><mi>a</mi><mi>x</mi></msup></math>"#),
("sup_zero", r#"<math><msup><mi>x</mi><mn>0</mn></msup></math>"#),
("sup_ten", r#"<math><msup><mi>x</mi><mn>10</mn></msup></math>"#),
("sup_minus_x", r#"<math><msup><mi>a</mi><mrow><mo>-</mo><mi>x</mi></mrow></msup></math>"#),
("sup_minus_2", r#"<math><msup><mi>a</mi><mrow><mo>-</mo><mn>2</mn></mrow></msup></math>"#),
("sup_x_plus_1", r#"<math><msup><mi>a</mi><mrow><mi>x</mi><mo>+</mo><mn>1</mn></mrow></msup></math>"#),
("sup_sub_x2", r#"<math><msup><mi>a</mi><msub><mi>x</mi><mn>2</mn></msub></msup></math>"#),
("sup_nested", r#"<math><msup><mi>a</mi><msup><mi>x</mi><mn>2</mn></msup></msup></math>"#),
("sup_frac", r#"<math><msup><mi>a</mi><mfrac><mn>1</mn><mn>2</mn></mfrac></msup></math>"#),
("sup_sqrt", r#"<math><msup><mi>a</mi><msqrt><mi>x</mi></msqrt></msup></math>"#),
("sup_follow_letter", r#"<math><mrow><msup><mi>x</mi><mn>2</mn></msup><mi>y</mi></mrow></math>"#),
("sup_follow_number", r#"<math><mrow><msup><mi>x</mi><mn>2</mn></msup><mn>3</mn></mrow></math>"#),
("sub_x", r#"<math><msub><mi>a</mi><mi>x</mi></msub></math>"#),
("sub_zero", r#"<math><msub><mi>x</mi><mn>0</mn></msub></math>"#),
("sub_ten", r#"<math><msub><mi>x</mi><mn>10</mn></msub></math>"#),
("sub_minus_x", r#"<math><msub><mi>a</mi><mrow><mo>-</mo><mi>x</mi></mrow></msub></math>"#),
("sub_minus_2", r#"<math><msub><mi>a</mi><mrow><mo>-</mo><mn>2</mn></mrow></msub></math>"#),
("sub_x_plus_1", r#"<math><msub><mi>a</mi><mrow><mi>x</mi><mo>+</mo><mn>1</mn></mrow></msub></math>"#),
("sub_nested", r#"<math><msub><mi>a</mi><msub><mi>x</mi><mn>2</mn></msub></msub></math>"#),
("sub_follow_letter", r#"<math><mrow><msub><mi>x</mi><mn>2</mn></msub><mi>y</mi></mrow></math>"#),
("sub_follow_number", r#"<math><mrow><msub><mi>x</mi><mn>2</mn></msub><mn>3</mn></mrow></math>"#),
("subsup_numeric", r#"<math><msubsup><mi>x</mi><mn>1</mn><mn>2</mn></msubsup></math>"#),
("subsup_i_n", r#"<math><msubsup><mi>x</mi><mi>i</mi><mi>n</mi></msubsup></math>"#),
("subsup_grouped_sub", r#"<math><msubsup><mi>x</mi><mrow><mi>i</mi><mo>+</mo><mn>1</mn></mrow><mn>2</mn></msubsup></math>"#),
("subsup_grouped_sup", r#"<math><msubsup><mi>x</mi><mn>0</mn><mrow><mi>n</mi><mo>-</mo><mn>1</mn></mrow></msubsup></math>"#),
("subsup_nested_sup", r#"<math><msubsup><mi>x</mi><mn>0</mn><msup><mi>n</mi><mn>2</mn></msup></msubsup></math>"#),
("negative_base_sup", r#"<math><msup><mrow><mo>-</mo><mi>x</mi></mrow><mn>2</mn></msup></math>"#),
("paren_base_sup", r#"<math><msup><mrow><mo>(</mo><mi>x</mi><mo>+</mo><mn>1</mn><mo>)</mo></mrow><mn>2</mn></msup></math>"#),
("frac_base_sup", r#"<math><msup><mfrac><mn>1</mn><mi>x</mi></mfrac><mn>2</mn></msup></math>"#),
("root_base_sup", r#"<math><msup><msqrt><mi>x</mi></msqrt><mn>2</mn></msup></math>"#),
("sup_on_function", r#"<math><mrow><msup><mi>sin</mi><mn>2</mn></msup><mi>x</mi></mrow></math>"#),
("log_sub_sup", r#"<math><mrow><msubsup><mi>log</mi><mn>2</mn><mn>3</mn></msubsup><mi>x</mi></mrow></math>"#),
("root_index_group", r#"<math><mroot><mi>x</mi><mrow><mi>n</mi><mo>+</mo><mn>1</mn></mrow></mroot></math>"#),
("root_index_sub", r#"<math><mroot><mi>x</mi><msub><mi>n</mi><mn>2</mn></msub></mroot></math>"#),
("frac_num_group", r#"<math><mfrac><mrow><mi>x</mi><mo>+</mo><mn>1</mn></mrow><mi>y</mi></mfrac></math>"#),
("frac_den_group", r#"<math><mfrac><mi>x</mi><mrow><mi>y</mi><mo>+</mo><mn>1</mn></mrow></mfrac></math>"#),
("nested_frac", r#"<math><mfrac><mfrac><mn>1</mn><mi>x</mi></mfrac><mfrac><mn>1</mn><mi>y</mi></mfrac></mfrac></math>"#),
("sup_after_fraction", r#"<math><msup><mfrac><mrow><mi>x</mi><mo>+</mo><mn>1</mn></mrow><mrow><mi>y</mi><mo>-</mo><mn>1</mn></mrow></mfrac><mn>2</mn></msup></math>"#),
("sub_after_fraction", r#"<math><msub><mfrac><mrow><mi>x</mi><mo>+</mo><mn>1</mn></mrow><mrow><mi>y</mi><mo>-</mo><mn>1</mn></mrow></mfrac><mi>i</mi></msub></math>"#),
("tensor_like", r#"<math><mrow><msubsup><mi>T</mi><mi>i</mi><mi>j</mi></msubsup><msubsup><mi>x</mi><mi>j</mi><mi>k</mi></msubsup></mrow></math>"#),
("pre_negative_power", r#"<math><mrow><mn>2</mn><msup><mi>x</mi><mrow><mo>-</mo><mn>1</mn></mrow></msup></mrow></math>"#),
("power_of_power_follow", r#"<math><mrow><msup><msup><mi>x</mi><mn>2</mn></msup><mn>3</mn></msup><mi>y</mi></mrow></math>"#),
("subscripted_power_follow", r#"<math><mrow><msup><msub><mi>x</mi><mn>2</mn></msub><mn>3</mn></msup><mi>y</mi></mrow></math>"#),
("power_subscript_follow", r#"<math><mrow><msub><msup><mi>x</mi><mn>2</mn></msup><mn>3</mn></msub><mi>y</mi></mrow></math>"#),
];

let expected = std::collections::HashMap::from([
("sup_x", "⠠⠁⠌⠭⠱"),
("sup_zero", "⠠⠭⠌⠴"),
("sup_ten", "⠠⠭⠌⠂⠴"),
("sup_minus_x", "⠠⠁⠌⠀⠤⠭⠱"),
("sup_minus_2", "⠠⠁⠌⠤⠆"),
("sup_x_plus_1", "⠠⠁⠌⠭⠀⠖⠼⠁⠱"),
("sup_sub_x2", "⠠⠁⠌⠭⠡⠆⠱"),
("sup_nested", "⠠⠁⠌⠭⠌⠆⠱"),
("sup_frac", "⠠⠁⠌⠼⠁⠆⠱"),
("sup_sqrt", "⠠⠁⠌⠩⠱⠭⠹⠱"),
("sup_follow_letter", "⠠⠭⠌⠆⠽"),
("sup_follow_number", "⠠⠭⠌⠆⠼⠉"),
("sub_x", "⠠⠁⠡⠭⠱"),
("sub_zero", "⠠⠭⠡⠴"),
("sub_ten", "⠠⠭⠡⠂⠴"),
("sub_minus_x", "⠠⠁⠡⠀⠤⠭⠱"),
("sub_minus_2", "⠠⠁⠡⠤⠆"),
("sub_x_plus_1", "⠠⠁⠡⠐⠭⠀⠖⠼⠁⠱"),
("sub_nested", "⠠⠁⠡⠭⠡⠆⠱"),
("sub_follow_letter", "⠠⠭⠡⠆⠽"),
("sub_follow_number", "⠠⠭⠡⠆⠼⠉"),
("subsup_numeric", "⠠⠭⠡⠼⠁⠌⠼⠃⠱"),
("subsup_i_n", "⠠⠭⠡⠊⠌⠝⠱"),
("subsup_grouped_sub", "⠠⠭⠡⠐⠊⠀⠖⠼⠁⠌⠼⠃⠱"),
("subsup_grouped_sup", "⠠⠭⠡⠼⠚⠌⠠⠝⠀⠤⠼⠁⠱"),
("subsup_nested_sup", "⠠⠭⠡⠼⠚⠌⠠⠝⠌⠆⠱"),
("negative_base_sup", "⠤⠠⠭⠌⠆"),
("paren_base_sup", "⠣⠠⠭⠀⠖⠼⠁⠜⠌⠆"),
("frac_base_sup", "⠼⠁⠳⠠⠭⠌⠆"),
("root_base_sup", "⠩⠱⠠⠭⠹⠌⠆"),
("sup_on_function", "⠫⠎⠌⠆⠠⠭"),
("log_sub_sup", "⠫⠇⠡⠼⠃⠌⠼⠉⠱⠠⠭"),
("root_index_group", "⠩⠠⠝⠀⠖⠼⠁⠱⠠⠭⠹"),
("root_index_sub", "⠩⠠⠝⠡⠆⠱⠭⠹"),
("frac_num_group", "⠆⠠⠭⠀⠖⠼⠁⠀⠳⠠⠽⠰"),
("frac_den_group", "⠆⠠⠭⠀⠳⠽⠀⠖⠼⠁⠰"),
("nested_frac", "⠆⠆⠼⠁⠀⠳⠠⠭⠰⠀⠳⠆⠼⠁⠀⠳⠠⠽⠰⠰"),
("sup_after_fraction", "⠆⠠⠭⠀⠖⠼⠁⠀⠳⠠⠽⠀⠤⠼⠁⠰⠌⠆"),
("sub_after_fraction", "⠆⠠⠭⠀⠖⠼⠁⠀⠳⠠⠽⠀⠤⠼⠁⠰⠡⠠⠊⠱"),
("tensor_like", "⠨⠞⠡⠠⠊⠌⠚⠱⠭⠡⠚⠌⠅⠱"),
("pre_negative_power", "⠼⠃⠠⠭⠌⠤⠂"),
("power_of_power_follow", "⠠⠭⠌⠆⠌⠒⠽"),
("subscripted_power_follow", "⠠⠭⠡⠆⠌⠒⠽"),
("power_subscript_follow", "⠠⠭⠌⠆⠡⠒⠽"),
]);

for (label, expr) in cases {
test_braille("Russian", expr, expected[label])?;
}
return Ok(());
}

#[test]
fn numbers_and_operators() -> Result<()> {
let expr = r#"<math><mrow><mn>5</mn><mo>+</mo><mn>12</mn><mo>=</mo><mn>17</mn></mrow></math>"#;
Expand Down
Loading