NSoiffer / MathCAT

MathCAT: Math Capable Assistive Technology for generating speech, braille, and navigation.
MIT License
63 stars 35 forks source link

Add a UEB contractions exceptions list #223

Open NSoiffer opened 1 year ago

NSoiffer commented 1 year ago

There are other issues that suggest language-specific braille definitions.yaml file. This issue is about adding a ContractionsOverride entry. This would be used to override what happens given the limited rules used by MathCAT. For example, "arccos" has rules for contracting "ar" and "cc". However, the "cc" shouldn't be used because "arccos" is a non-hyphenated compound word (RUEB 10.11.1). So "arccos" would be in the table.

ContractionsOverride: [
   "arccos" : ">ccos",
   "arccosine" : ">ccos9e",
 ]

Probably want to accept both Unicode braille and ASCII braille (as above).

The code would first check this list for standing alone words (hashmap in Rust), and then apply rules if not in the table.

In addition to "arccos", all the words in RUEB 10.1 and 10.2 should be in the list. Faster runtime and more flexible (can add "can't" etc., and not make the rule more complicated by checking for '.