Enhance Russian Braille support with mathematical symbols and rules#589
Enhance Russian Braille support with mathematical symbols and rules#589Kostenkov-2021 wants to merge 30 commits into
Conversation
… 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).
…s already, so it might in some other branch
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
NSoiffer
left a comment
There was a problem hiding this comment.
There is a much better way to handle the long if...elseif...elseif....
I was surprised I didn't see any example in a braille file, but there is in an english file. In definitions.yaml, you want to add something like:
- SIPrefixes: {
"Q": "quetta", "R": "ronna", "Y": "yotta", "Z": "zetta", "E": "exa", "P": "peta", "T": "tera", "G": "giga", "M": "mega", "k": "kilo", "h": "hecto", "da": "deka",
"d": "deci", "c": "centi", "m": "milli", "µ": "micro", "n": "nano", "p": "pico", "f": "femto", "a": "atto", "z": "zepto", "y": "yocto", "r": "ronto", "q": "quecto"
}
but in this case, you want the braille. So something like
- TrigFunctions: {
} "arcsin": "⠫⠁⠎#", ...
and in the rule file you use
"DefinitionValue(. 'Braille', 'TrigFunctions')
FYI: unless Russian braille is very simple, I think you will need emulate some of the other braille files and use "L" for letters, "N" for digits, and a few other things so that after the rules are applied, you can do some cleanup. For example, if there is a rule that a letter after a digit is allowed accept for a-j which are used for digits for 0-9 in Western braille codes, you can adjust the code in the final cleanup. Without the "L" and "N", there is no way to detect that case.
* 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
This commit adds first druft version for Russian Braille.
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.
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.
This commit adds Roots, powers and scripts according to the Russian math 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 PR adds fixes and expands Russian Braille support for MathCAT.