|
36 | 36 | if: "$Verbosity!='Terse'" |
37 | 37 | then: [t: "the"] # phrase('the' square root of 25) |
38 | 38 | - test: |
39 | | - if: $ClearSpeak_Roots = 'PosNegSqRoot' or $ClearSpeak_Roots = 'PosNegSqRootEnd' |
| 39 | + if: "$ClearSpeak_Roots = 'PosNegSqRoot' or $ClearSpeak_Roots = 'PosNegSqRootEnd'" |
40 | 40 | then: |
41 | 41 | - bookmark: "*[1]/@id" |
42 | 42 | - test: |
43 | | - if: parent::*[self::m:minus and count(*)=1] |
| 43 | + if: "parent::*[self::m:minus and count(*)=1]" |
44 | 44 | then: [t: "negative"] # phrase(minus 4 is a 'negative' number) |
45 | 45 | else: [t: "positive"] # phrase(10 is a 'positive' number) |
46 | 46 | - t: "square root" # phrase(8 is the 'square root' of 64) |
|
67 | 67 | if: "$Verbosity!='Terse'" |
68 | 68 | then: [t: "the"] # phrase(6 is 'the' square root of 36) |
69 | 69 | - test: |
70 | | - if: $ClearSpeak_Roots = 'PosNegSqRoot' or $ClearSpeak_Roots = 'PosNegSqRootEnd' |
| 70 | + if: "$ClearSpeak_Roots = 'PosNegSqRoot' or $ClearSpeak_Roots = 'PosNegSqRootEnd'" |
71 | 71 | then: |
72 | 72 | - test: |
73 | 73 | if: "parent::*[(self::m:minus or self::m:plus) and count(*)=1]" |
74 | 74 | then: [bookmark: "parent/@id"] |
75 | 75 | - test: |
76 | | - if: parent::m:minus |
| 76 | + if: "parent::m:minus" |
77 | 77 | then: [t: "negative"] # phrase(minus 6 is a 'negative' number) |
78 | 78 | else: [t: "positive"] # phrase(10 is a 'positive' number) |
79 | 79 | - test: |
|
89 | 89 | if: "*[2][self::m:mi][string-length(.)=1]" |
90 | 90 | then: |
91 | 91 | - x: "*[2]" |
92 | | - - pronounce: [{text: "-th"}, {ipa: "θ"}, {sapi5: "th"}, {eloquence: "T"}] |
93 | | - else: {x: "*[2]"} |
| 92 | + - pronounce: [text: "-th", ipa: "θ", sapi5: "th", eloquence: "T"] |
| 93 | + else: [x: "*[2]"] |
94 | 94 | - t: "root" # phrase(the square 'root' of 36) |
95 | 95 | - test: |
96 | 96 | if: "$Verbosity!='Terse'" |
97 | 97 | then: [t: "of"] # phrase(the square root 'of' 36) |
98 | 98 | - x: "*[1]" |
99 | 99 | - test: |
100 | | - if: $ClearSpeak_Roots = 'RootEnd' or $ClearSpeak_Roots = 'PosNegSqRootEnd' |
| 100 | + if: "$ClearSpeak_Roots = 'RootEnd' or $ClearSpeak_Roots = 'PosNegSqRootEnd'" |
101 | 101 | then: |
102 | 102 | - pause: short |
103 | 103 | - t: "end root" # phrase(start the fifth root of x 'end root') |
104 | 104 | - pause: medium |
105 | 105 | else_test: |
106 | | - if: IsNode(*[1], 'simple') |
| 106 | + if: "IsNode(*[1], 'simple')" |
107 | 107 | then: [pause: short] |
108 | 108 | else: [pause: long] |
109 | 109 |
|
|
116 | 116 | if: |
117 | 117 | - "*[1][self::m:square-root or self::m:root] and" |
118 | 118 | - "($ClearSpeak_Roots = 'PosNegSqRoot' or $ClearSpeak_Roots = 'PosNegSqRootEnd')" |
119 | | - then: {t: ""} |
| 119 | + then: [t: ""] |
120 | 120 | else: |
121 | 121 | - bookmark: "@id" |
122 | 122 | - test: |
|
146 | 146 | tag: fraction |
147 | 147 | match: |
148 | 148 | - "($ClearSpeak_Fractions='Auto' or $ClearSpeak_Fractions='Ordinal' or $ClearSpeak_Fractions='EndFrac') and" |
149 | | - - "*[1][self::m:mn][not(contains(., '.')) and ($ClearSpeak_Fractions='Ordinal' or text()<20)] and" |
150 | | - - "*[2][self::m:mn][not(contains(., '.')) and ($ClearSpeak_Fractions='Ordinal' or (2<= text() and text()<=10))]" |
| 149 | + - "*[1][self::m:mn][not(contains(., $DecimalSeparators)) and ($ClearSpeak_Fractions='Ordinal' or text()<20)] and" |
| 150 | + - "*[2][self::m:mn][not(contains(., $DecimalSeparators)) and ($ClearSpeak_Fractions='Ordinal' or (2<= text() and text()<=10))]" |
151 | 151 | variables: [IsPlural: "*[1]!=1"] |
152 | 152 | replace: |
153 | 153 | - x: "*[1]" |
|
226 | 226 | - ot: "the" # phrase(5 is 'the' square toot of 25) |
227 | 227 | - t: "fraction with numerator" # phrase(the 'fraction with numerator' 6) |
228 | 228 | - test: |
229 | | - if: not(IsNode(*[1], 'simple')) |
| 229 | + if: "not(IsNode(*[1], 'simple'))" |
230 | 230 | then: [pause: medium] |
231 | 231 | - x: "*[1]" |
232 | 232 | - pause: medium |
|
248 | 248 | match: "." |
249 | 249 | replace: |
250 | 250 | - test: |
251 | | - if: $ClearSpeak_Trig = 'TrigInverse' |
252 | | - then: [{x: "*[1]"}, {bookmark: "*[2]/@id"}, t: "inverse"] # phrase(8 over 5 is the 'inverse' of 5 over 8) |
| 251 | + if: "$ClearSpeak_Trig = 'TrigInverse'" |
| 252 | + then: [x: "*[1]", bookmark: "*[2]/@id", t: "inverse"] # phrase(8 over 5 is the 'inverse' of 5 over 8) |
253 | 253 | else_test: |
254 | | - if: $ClearSpeak_Trig = 'ArcTrig' |
| 254 | + if: "$ClearSpeak_Trig = 'ArcTrig'" |
255 | 255 | then: [bookmark: "*[2]/@id", t: "arc", x: "*[1]"] # phrase(the 'arc' of a circle) |
256 | 256 | else: [bookmark: "*[2]/@id", t: "inverse", x: "*[1]"] # default/Auto # phrase(8 over 5 is the 'inverse' of 5 over 8) |
257 | 257 |
|
|
331 | 331 | - t: "to the" # phrase(2 raised 'to the' power 7) |
332 | 332 | - test: |
333 | 333 | if: "*[2][.>0]" |
334 | | - then: {x: "ToOrdinal(*[2])"} |
335 | | - else: {x: "*[2]"} |
| 334 | + then: [x: "ToOrdinal(*[2])"] |
| 335 | + else: [x: "*[2]"] |
336 | 336 | - test: |
337 | 337 | if: "$ClearSpeak_Exponents != 'Ordinal'" |
338 | 338 | then: [t: "power"] # phrase(2 raised to the 'power' 7) |
|
358 | 358 | - x: "*[1]" |
359 | 359 | - t: "to the" # phrase(3 raised 'to the' power 7) |
360 | 360 | - x: "*[2]" |
361 | | - - pronounce: [{text: "-th"}, {ipa: "θ"}, {sapi5: "th"}, {eloquence: "T"}] |
| 361 | + - pronounce: [text: "-th", ipa: "θ", sapi5: "th", eloquence: "T"] |
362 | 362 | - test: |
363 | 363 | if: "$ClearSpeak_Exponents != 'Ordinal'" |
364 | 364 | then: [t: "power"] # phrase(2 raised to the 'power' 7) |
|
523 | 523 | then: [t: "the"] # phrase('the' set of all integers) |
524 | 524 | - t: "set of" # phrase(this is a 'set of' numbers) |
525 | 525 | - test: |
526 | | - if: $ClearSpeak_Sets != 'woAll' |
| 526 | + if: "$ClearSpeak_Sets != 'woAll'" |
527 | 527 | then: [t: "all"] # phrase(the set of 'all' integers) |
528 | 528 | - x: "*[1]/*[1]" |
529 | 529 | - t: "such that" # phrase(the set S 'such that' x is less than y) |
530 | 530 | - x: "*[1]/*[3]" |
531 | 531 | else: |
532 | 532 | - test: |
533 | | - if: $ClearSpeak_Sets != 'SilentBracket' |
| 533 | + if: "$ClearSpeak_Sets != 'SilentBracket'" |
534 | 534 | then: |
535 | 535 | - test: |
536 | 536 | if: "$Verbosity!='Terse'" |
|
573 | 573 | else: [t: "but"] # phrase(the interval including a 'but' not b) |
574 | 574 | # some ugly logic dealing with connectives: or, but, but, and (cleaner to be part of next clause?) |
575 | 575 | - test: |
576 | | - if: not($is_intervals_end_infinity) |
| 576 | + if: "not($is_intervals_end_infinity)" |
577 | 577 | then: |
578 | 578 | - test: |
579 | 579 | # there is some asymmetry to the test because of the and/or/but logic above |
580 | | - if: not( name(.)='open-interval' or name(.)='closed-interval' ) or $is_intervals_start_infinity |
| 580 | + if: "not( name(.)='open-interval' or name(.)='closed-interval' ) or $is_intervals_start_infinity" |
581 | 581 | then: |
582 | 582 | - test: |
583 | 583 | if: "name(.) = 'open-interval' or name(.) = 'closed-open-interval'" |
|
605 | 605 | - t: "row" # phrase(the first 'row' of a matrix) |
606 | 606 | - x: "count(preceding-sibling::*)+1" |
607 | 607 | - test: |
608 | | - if: .[self::m:mlabeledtr] |
| 608 | + if: ".[self::m:mlabeledtr]" |
609 | 609 | then: |
610 | 610 | - t: "with label" # phrase(the line 'with label' first equation) |
611 | 611 | - x: "*[1]/*" |
612 | 612 | - pause: short |
613 | 613 | - pause: medium |
614 | 614 | - test: |
615 | | - if: .[self::m:mlabeledtr] |
| 615 | + if: ".[self::m:mlabeledtr]" |
616 | 616 | then: [x: "*[position()>1]"] |
617 | | - else: {x: "*"} |
| 617 | + else: [x: "*"] |
618 | 618 |
|
619 | 619 | - # handle both log and ln |
620 | 620 | name: ClearSpeak-log |
621 | | - tag: mrow |
622 | | - variables: [{log_is_simple: "IsNode(*[3],'simple')"}] |
623 | | - match: |
624 | | - - "count(*)=3 and" |
625 | | - - "*[1][self::m:mi][.='log' or .='ln'] and" |
626 | | - - "*[2][self::m:mo][.='']" |
| 621 | + tag: mi |
| 622 | + match: ".='log' or .='ln'" |
627 | 623 | replace: |
| 624 | + - bookmark: "@id" |
628 | 625 | - test: |
629 | | - if: "$log_is_simple" |
630 | | - then_test: |
631 | | - - if: "*[1][.='log']" |
632 | | - then: [t: "log"] # phrase(the 'log' of x) |
633 | | - - else_if: $ClearSpeak_Log = 'LnAsNaturalLog' |
634 | | - then: [t: "natural log"] # phrase(the 'natural log' of the product of 2 numbers) |
635 | | - else: [spell: "'ln'"] |
636 | | - else: |
637 | | - - test: |
638 | | - if: "$Verbosity!='Terse' and not(log_is_simple)" |
639 | | - then: [t: "the"] # phrase('the' square root of 25) |
640 | | - - test: |
641 | | - - if: "*[1][.='log']" |
642 | | - then: [t: "log"] |
643 | | - - else_if: $ClearSpeak_Log = 'LnAsNaturalLog' |
644 | | - then: [t: "natural log"] # phrase(the 'natural log' of x) |
645 | | - else: [spell: "'ln'"] |
646 | | - - t: "of" # phrase(the natural log 'of' x) |
647 | | - - pause: short |
648 | | - - x: "*[3]" |
| 626 | + if: "$Verbosity!='Terse' and not(IsNode(following-sibling::*[2],'simple'))" |
| 627 | + then: [t: "the"] # phrase('the' square root of 25) |
| 628 | + - test: |
| 629 | + - if: ".='log'" |
| 630 | + then: [t: "log"] |
| 631 | + - else_if: "$ClearSpeak_Log = 'LnAsNaturalLog'" |
| 632 | + then: [t: "natural log"] # phrase(the 'natural log' of x) |
| 633 | + else: [spell: "'ln'"] |
649 | 634 |
|
650 | 635 | - name: ClearSpeak-multi-line |
651 | 636 | tag: [piecewise, system-of-equations, lines] # these are ignored in favor of the ClearSpeak prefs |
|
657 | 642 | - IsColumnSilent: true() |
658 | 643 | replace: |
659 | 644 | - test: |
660 | | - - if: $ClearSpeak_MultiLineOverview = 'Auto' |
| 645 | + - if: "$ClearSpeak_MultiLineOverview = 'Auto'" |
661 | 646 | then: |
662 | 647 | - x: "$LineCount" |
663 | 648 | - test: |
|
0 commit comments