|
1 | 1 | --- |
2 | | -# audit-ignore |
3 | 2 | - name: pause |
4 | 3 | tag: "!*" |
5 | 4 | match: "not(self::m:math) and not($MatchingPause) and @data-intent-property[contains(., ':pause')]" |
|
15 | 14 | else: [pause: medium] |
16 | 15 | - x: "." |
17 | 16 |
|
18 | | -# audit-ignore |
19 | 17 | - name: intent-literal-silent |
20 | 18 | tag: [mi, mo, mn] |
21 | 19 | match: "contains(@data-intent-property, ':silent:')" |
22 | 20 | # say nothing |
23 | 21 | replace: [] |
24 | 22 |
|
25 | | -# audit-ignore |
26 | 23 | # handling of negative numbers that come from 'intent' is hard -- we do something that is close to right here |
27 | 24 | - name: intent-literal-negative-number |
28 | 25 | tag: mn |
|
31 | 28 | - T: "minus" # phrase(10 'minus' 4 equals 6) |
32 | 29 | - x: "translate(text(), '-_', '')" |
33 | 30 |
|
34 | | -# audit-ignore |
35 | | -- name: default |
| 31 | +- name: default #audit-ignore |
36 | 32 | tag: square-root |
37 | 33 | match: "." |
38 | 34 | replace: |
|
59 | 55 | then: [pause: short] |
60 | 56 | else: [pause: long] |
61 | 57 |
|
62 | | -# audit-ignore |
63 | | -- name: default |
| 58 | +- name: default # audit-ignore |
64 | 59 | tag: root |
65 | 60 | match: "." |
66 | 61 | replace: |
|
100 | 95 | then: [pause: short] |
101 | 96 | else: [pause: long] |
102 | 97 |
|
103 | | -# audit-ignore |
104 | 98 | # The 'negative' rule interacts with the msqrt/mroot rules as those might pick off this case ("the negative square root of x") |
105 | 99 | - name: negative_and_positive |
106 | 100 | tag: [plus, minus] |
|
122 | 116 | # Fraction rules |
123 | 117 | # Mixed numbers mostly "just work" because the invisible char reads as "and" and other parts read properly on their own |
124 | 118 |
|
125 | | -# audit-ignore |
126 | 119 | # Units (e.g., meters per second) |
127 | 120 | # NORWEGIAN: Added rule for t="time" |
128 | | -- name: per-fraction |
| 121 | +- name: per-fraction # audit-ignore |
129 | 122 | tag: fraction |
130 | 123 | match: |
131 | 124 | - "$ClearSpeak_Fractions='Per' or" |
|
142 | 135 | else: |
143 | 136 | - x: "*[2]" |
144 | 137 |
|
145 | | -# audit-ignore |
146 | 138 | # Note: if the bounds change for what is a common fraction, change them in general.yaml for units |
147 | | -- name: common-fraction |
| 139 | +- name: common-fraction # audit-ignore |
148 | 140 | tag: fraction |
149 | 141 | match: |
150 | 142 | - "($ClearSpeak_Fractions='Auto' or $ClearSpeak_Fractions='Ordinal' or $ClearSpeak_Fractions='EndFrac') and" |
|
194 | 186 | then: [x: "DefinitionValue(*[2], 'Speech', 'OrdinalFractionalDenominatorsForUnits')"] |
195 | 187 | else: [x: "*[2]", CT: "dels"] # this is wrong but shouldn't occur normally -- need to write a function to compute cardinal numbers as words |
196 | 188 |
|
197 | | -# audit-ignore |
198 | 189 | # NORWEGIAN: Changed to English version, but changed decimal point to $DecimalSeparators |
199 | | -- name: fraction-over-simple |
| 190 | +- name: fraction-over-simple # audit-ignore |
200 | 191 | tag: fraction |
201 | 192 | match: |
202 | 193 | - "($ClearSpeak_Fractions='Over' or $ClearSpeak_Fractions='FracOver' or $ClearSpeak_Fractions='OverEndFrac') or" |
|
221 | 212 | - T: "slutt brøk" # phrase(7 over 8 'end fraction') |
222 | 213 | - pause: short |
223 | 214 |
|
224 | | -# audit-ignore |
225 | 215 | - # fraction with text or numbers followed by text in both numerator and denominator |
226 | 216 | name: fraction-over-text |
227 | 217 | tag: fraction |
|
251 | 241 | - T: "slutt brøk" # phrase(7 over 8 'end fraction') |
252 | 242 | - pause: short |
253 | 243 |
|
254 | | -# audit-ignore |
255 | 244 | # NORWEGIAN: Changed to English version |
256 | 245 | - name: default |
257 | 246 | tag: fraction |
|
273 | 262 | - T: "slutt brøk" # phrase(the fraction with 3 over 4 'end fraction') |
274 | 263 | - pause: short |
275 | 264 |
|
276 | | -# audit-ignore |
277 | 265 | # rules for functions raised to a power |
278 | 266 | # these could have been written on 'mrow' but putting them on msup seems more specific |
279 | 267 | # to see if it is a function, we look right to see if the following sibling is apply-function |
|
289 | 277 | then: [bookmark: "*[2]/@id", T: "arcus", x: "*[1]"] # phrase(the 'buelenge' of a circle) |
290 | 278 | else: [bookmark: "*[2]/@id", T: "invers", x: "*[1]"] # default/Auto # phrase(8 over 5 is the 'inverse' of 5 over 8) |
291 | 279 |
|
292 | | -# audit-ignore |
293 | 280 | - name: function-squared-or-cubed |
294 | 281 | tag: power |
295 | 282 | match: |
|
303 | 290 | then: [T: "i andre"] # phrase(25 equals 5 'squared') |
304 | 291 | else: [T: "i tredje"] # phrase(625 equals 5 'cubed') |
305 | 292 |
|
| 293 | +# The following element is invisible function application. Used for expressions like sin^n x. |
306 | 294 | - name: function-power |
307 | 295 | tag: power |
308 | 296 | match: |
|
394 | 382 | # but the test cases all fall back to "raised to the exponent" when not "Auto" |
395 | 383 | # If these are allowed for non-Auto values, then you end up with "...power power...". |
396 | 384 | - # [xxx]^n |
| 385 | + # Norwegian: Consider to find a word similar to "power". |
397 | 386 | name: nested-squared-or-cubed |
398 | 387 | tag: power |
399 | 388 | match: |
|
412 | 401 | - x: "*[2]" |
413 | 402 |
|
414 | 403 | - # - [xxx]^n |
| 404 | + # Norwegian: Consider to find a word similar to "power". |
415 | 405 | name: nested-negative-squared-or-cubed |
416 | 406 | tag: power |
417 | 407 | match: |
|
432 | 422 | - x: "*[2]" |
433 | 423 |
|
434 | 424 | - # [xxx] var^n |
| 425 | + # Norwegian: Consider to find a word similar to "power". |
435 | 426 | name: nested-var-squared-or-cubed |
436 | 427 | tag: power |
437 | 428 | match: |
|
454 | 445 | - x: "*[2]" |
455 | 446 |
|
456 | 447 | - # -[xxx] var^n |
| 448 | + # Norwegian: Consider to find a word similar to "power". |
457 | 449 | name: nested-negative-var-squared-or-cubed |
458 | 450 | tag: power |
459 | 451 | match: |
|
489 | 481 | - pause: short |
490 | 482 | - T: "slutt eksponent" # phrase(and now 'end exponent' has been reached) |
491 | 483 |
|
| 484 | +# Norwegian: Consider to find a word similar to "power". |
492 | 485 | - name: default |
493 | 486 | tag: power |
494 | 487 | match: "." |
|
500 | 493 | # |
501 | 494 | # Some rules on mrows |
502 | 495 | # |
503 | | -# audit-ignore |
504 | 496 | - # the inference rules lump absolute value and cardinality together, so those rules are implemented here |
505 | | - name: ClearSpeak-absolute-value |
| 497 | + name: ClearSpeak-absolute-value # audit-ignore |
506 | 498 | tag: absolute-value |
507 | 499 | match: "." |
508 | 500 | # SWEDISH/NORWEGIAN: Differentiate between the initial and ending declaration of the terms. |
|
521 | 513 | - x: "$EndToSay" |
522 | 514 | - pause: short |
523 | 515 |
|
524 | | -# audit-ignore |
525 | | -- name: set |
| 516 | +- name: set # audit-ignore |
526 | 517 | tag: set |
527 | 518 | match: "." |
528 | 519 | replace: |
|
559 | 550 |
|
560 | 551 | # SWEDISH/NORWEGIAN: rewrote the intervals function to better deal with Swedish/Norwegian convention of speaking intervals |
561 | 552 | # NORWEGIAN: Removed test for verbosity, cause you should always say "det åpne" etc. |
562 | | - # audit-ignore |
563 | | -- name: ClearSpeak-intervals # avoid overriding with default "intervals" name |
| 553 | +- name: ClearSpeak-intervals # avoid overriding with default "intervals" name # audit-ignore |
564 | 554 | variables: |
565 | 555 | - is_intervals_start_infinity: "*[1][self::m:minus and count(*)=1 and *[1][.='∞']]" |
566 | 556 | - is_intervals_end_infinity: "*[2][.='∞'or (self::m:plus and count(*)=1 and *[1][.='∞'])]" |
|
585 | 575 | then: [T: "og med"] |
586 | 576 | - x: "*[2]" |
587 | 577 |
|
588 | | - # audit-ignore |
589 | 578 | - name: binomial-frac-vector |
590 | 579 | tag: matrix |
591 | 580 | match: |
|
596 | 585 | - T: "over" # phrase(the binomial coefficient n 'choose' m) |
597 | 586 | - x: "*[2]/*[1]/*" |
598 | 587 |
|
599 | | - # audit-ignore |
600 | 588 | - name: ClearSpeak-default |
601 | 589 | tag: [mtr, mlabeledtr] |
602 | 590 | match: "parent::m:matrix or parent::m:determinant" |
|
618 | 606 | else: [x: "*"] |
619 | 607 |
|
620 | 608 | - # handle both log and ln |
621 | | - name: ClearSpeak-log |
| 609 | + name: ClearSpeak-log # audit-ignore |
622 | 610 | tag: mi |
623 | 611 | variables: [log_is_simple: "IsNode(following-sibling::*[2],'simple')"] # skip function apply |
624 | 612 | match: ".='log' or .='ln' or .='lg'" |
|
653 | 641 | then: [T: "den naturlige logaritmen"] # phrase(the 'natural log' of x) |
654 | 642 | else: [SPELL: "'ln'"] |
655 | 643 |
|
656 | | -# audit-ignore |
657 | | -# NORWEGIAN: Changed to English version |
| 644 | +# Norwegian: The preference MultiLineLabel = none is handled differently than it is for English. |
658 | 645 | - name: ClearSpeak-multi-line |
659 | 646 | tag: [piecewise, system-of-equations, lines] # these are ignored in favor of the ClearSpeak prefs |
660 | 647 | match: "." |
|
708 | 695 | - pause: short |
709 | 696 | - x: "*" |
710 | 697 |
|
711 | | -# audit-ignore |
712 | 698 | # NORWEGIAN: Changed from Swedish to English version |
713 | 699 | - name: ClearSpeak-default-multiline |
714 | 700 | tag: [mtr, mlabeledtr] |
|
749 | 735 | then: [x: "*[position()>1]"] |
750 | 736 | else: [x: "*"] |
751 | 737 |
|
752 | | -# audit-ignore |
753 | | -- name: ClearSpeak_Functions_None |
| 738 | +- name: ClearSpeak_Functions_None # audit-ignore |
754 | 739 | tag: mo |
755 | 740 | match: |
756 | 741 | - ".='' and $ClearSpeak_Functions = 'None' and" |
|
761 | 746 | then: [T: ""] |
762 | 747 | else: [T: "ganger"] # phrase(5 'times' 3 equals 15) |
763 | 748 |
|
764 | | -# audit-ignore |
765 | 749 | - name: no-times |
766 | 750 | tag: mo |
767 | 751 | match: |
|
770 | 754 | replace: |
771 | 755 | - T: "" |
772 | 756 |
|
773 | | -# audit-ignore |
774 | 757 | # NORWEGIAN: Changed to English version |
775 | 758 | - name: ClearSpeak-times |
776 | 759 | tag: mo |
|
803 | 786 | replace: |
804 | 787 | - T: "ganger" # phrase(5 'times' 3 equals 15) |
805 | 788 |
|
806 | | -# audit-ignore |
807 | 789 | - name: no-say-parens |
808 | 790 | tag: mrow |
809 | 791 | match: |
|
0 commit comments