Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Suggestion: Small improvement to MathCAT's range handling in unicode files

Open
#590 0 comments 0 reactions 0 assignees View on GitHub

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

enhancement

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from daisy/MathCAT

All issues in daisy/MathCAT

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.