Skip to content

Commit

Permalink
Changed speech for "hat" to use hat only when it is a "modified-varia…
Browse files Browse the repository at this point in the history
…ble" (basically, mover).

Otherwise, it uses "caret" so that `x^2` (those three chars) sounds better.
  • Loading branch information
NSoiffer committed Mar 10, 2024
1 parent a025ae4 commit c629b95
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Rules/Languages/en/unicode.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,11 @@
if: $SpeechStyle = 'ClearSpeak' or $SpeechStyle = 'SimpleSpeak'
then: [t: "close bracket"]
else: [t: "right bracket"]
- "^": [t: "hat"] # 0x5e
- "^": # 0x5e
- test:
if: "parent::m:modified-variable or parent::m:mover"
then: [t: "hat"]
else: [t: "caret"]
- "_": [t: "under bar"] # 0x5f
- "`": [t: "grave"] # 0x60
- "{": # 0x7b
Expand Down
6 changes: 6 additions & 0 deletions tests/Languages/en/shared.rs
Original file line number Diff line number Diff line change
Expand Up @@ -315,4 +315,10 @@ fn bug_199_2pi() {
</mrow>
</math>";
test("en", "SimpleSpeak",expr, "the closed open interval from 0 to 2 pi");
}

#[test]
fn caret_and_hat() {
let expr = "<math><mi>x</mi><mo>^</mo><mn>2</mn><mo>+</mo><mover><mi>y</mi><mo>^</mo></mover></math>";
test("en", "SimpleSpeak",expr, "x caret 2 plus y hat,");
}

0 comments on commit c629b95

Please sign in to comment.