Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Symbols Dictionary for Speech and Braille #327

Open
NV-Codes opened this issue Dec 31, 2024 · 2 comments
Open

Add Symbols Dictionary for Speech and Braille #327

NV-Codes opened this issue Dec 31, 2024 · 2 comments

Comments

@NV-Codes
Copy link
Contributor

It would be incredibly useful to have an easily-accessible "Symbols Dictionary" feature in MathCAT (especially the NVDA add-on) to allow users to map certain symbols to certain words to be spoken or certain braille sequences to be displayed in braille output. Perhaps the dictionary would be global (e.g., if reduced Planck constant ($\hbar$) is set to be spoken as "h bar" and brailled as dot 4, dots 1-2-5, then this would apply regardless of speech style or braille math code). The dictionary could be a fourth tab in MathCAT's settings in addition to "Speech," "Navigation," and "Braille." Alternatively, each speech style and braille math code could have its own dictionary.

To edit such a dictionary, one would have to consider how to input the symbol in question, the preferred verbalization, and the preferred braille representation. Perhaps one would paste/type the relevant MathML snippet into the "Symbol" field, simply type a verbal sequence in the "Speech" field, and paste/type a Unicode braille sequence in the "Braille" field.

This would technically be a dictionary of non-defaults, as only those symbols for which the user has provided a preferred verbal and/or braille sequence would be included in the dictionary. A "Default" option could be available for "Speech" and for "Braille" in order to allow the user to use a custom verbal sequence and the default braille sequence (based on the math code) or the default verbal sequence (based on the speech style) and a custom braille sequence.

@NSoiffer
Copy link
Owner

NSoiffer commented Jan 1, 2025

I can easily see this as getting complicated: use this speech when these conditions are true. That's already what MathCAT uses but doesn't expose in a user-friendly way. Right now, you can modify files in %AppData%\nvda\addons\MathCAT\globalPlugins\MathCAT\Rules to change MathCAT's speech and braille. For example, if you look at ...\Languages\en\unicode.tdl, you'll see lines like

 - "¬": [t: "not"]                                 # 0xac

You can edit that line to be "logical not" and that is what MathCAT will speak.

MathCAT can make use of xpath for more complicated matches such as this one:

 - "…":                                          # 0x2026
    test:
        if:
            - "$SpeechStyle != 'ClearSpeak' or $ClearSpeak_Ellipses = 'Auto' or"
               # must be ClearSpeak and $ClearSpeak_Ellipses = 'AndSoOn'
               # speak '…' as 'and so on...' unless expr starts with '…'
            - "../*[1][text()='…']"
        then: [t: "dot dot dot"]
        else_test:  # must have $ClearSpeak_Ellipses = 'AndSoOn'
            if: "count(following-sibling::*) = 0"
            then: [t: "and so on"]
            else: [t: "and so on up to"]

However, I think most users would have difficulty understanding this rule, much less coming up with it. If you want some more info about this, take a look at this old and probably not uptodate information that I wrote about it a few years ago.

The advantage of a preference would be:

  • a simplified interface could be provided, but would lack the flexibility of the current rules
  • the change would persist across versions of MathCAT (as opposed to editing the Rules files mentioned above)

Let me know your thoughts about whether you feel a preference is worth doing giving the ability to change the files. If you feel a preference is useful, let me know your thoughts about what options, if any, an user should be given to control when the overridden speech or braille is used.

@NV-Codes
Copy link
Contributor Author

NV-Codes commented Jan 4, 2025

I had not thought about all of the conditional rules MathCAT uses besides speech style. Maybe a simple (inflexible) dictionary whose definitions would always apply (i.e., override the default settings in all cases) would be useful, though perhaps modifying the rules file(s) suffices.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants