Suggestion: Small improvement to MathCAT's range handling in unicode files
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- rust
- Domain
- performance
Research direction
Start in tts.rs and trace how a Unicode range is expanded and how spell invokes the rule for a letter, using the example rule in the issue. Check the braille recursion case before changing the constant translate optimization; done means constant translations are avoided without breaking that invocation.
Written by the indexing model from the issue text.
Description
When reading rule files, MathCAT supports ranges. For example
- "𝗮-𝘇": # 0x1d5ee - 0x1d607
- test:
if: "not($IgnoreBold)"
then: [t: "bold"]
- spell: "translate('.', '𝗮𝗯𝗰𝗱𝗲𝗳𝗴𝗵𝗶𝗷𝗸𝗹𝗺𝗻𝗼𝗽𝗾𝗿𝘀𝘁𝘂𝘃𝘄𝘅𝘆𝘇', 'abcdefghijklmnopqrstuvwxyz')"
This gets rewritten to 26 rules for each letter, with "." replaced by the letter. When there is a translate, an optimization is to avoid the translate so that you end up with something like
- "𝗮": # 0x1d5ee - 0x1d607
- test:
if: "not($IgnoreBold)"
then: [t: "bold"]
- spell: "a"
However, in some cases such as in braille, we need to invoke the rule for "a". There is a hack in tts.rs that deals with the recursion and uses spell. Any change would need to make sure that still triggers after this change.
This is a minor optimization that probably doesn't result in a noticeable speedup. Still, it is kind of silly to call translate on a constant.
- Dominant language
- Rust
- Stars
- 118
- Forks
- 88
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 49
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from daisy/MathCAT
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
daisy/MathCAT#839 · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
Speak !! as double factorial in MathMLPossibly taken @AdamMagued claimed this 7 days ago. Openbug rules
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
discussion
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
discussion translation
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
daisy/MathCAT#675 · 1 comment ·
Maintainers usually reply within 1 day
Similar issues
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
zcashlabs/thus-spoke-zakura#153 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
topgrade-rs/topgrade#2395 ·
Maintainers usually reply within 1 day
-
app bug windows-os
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
Maintainers usually reply within 1 day
-
editor good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
funnyboy-roks/inq#54 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day