Skip to content

Commit b891d1a

Browse files
NSoifferTimArborealisAndersEkl
authored
Sv update (daisy#682)
* Update of Swedish translation (daisy#605) * first updates unicode, general and part of default * Test update * Updated geometry.yaml #2 * Updated linear-algebra and calculus #3 #4 * ClearSpeak_rules.yaml updated * Update overview.yaml Close daisy#10 * Update navigate.yaml * Update SimpleSpeak_Rules.yaml * Update definitions.yaml Closes daisy#14 * Updated SimpleSpeakl and ClearSpeak Finished the update of SimpleSpeak and corrected a rule in both SimpleSpeak and ClearSpeak that made mixed numbers be spoken incorrectly. * Bug fix in SimpleSpeak and ClearSpeak Fixed a bug concerning common fractions used in mixed numbers. * Fixed a bug in general.yaml Fixed a bug concerning how one is spoken in combination with a unit. * Unicode-full & navigate Updated unicode-full and navigate, plus fixed a couple of typos in the english unicode-full. * Fixed a corrupt file There was some problem with general.yaml, which should now be fixed. * Update default.yaml * Update general.yaml Hopefully this fix will solve a lot of the failed tests. daisy#15 * Updated functions.rs Both for ClearSpeak and SimpleSpeak * Fixed a multiline test fail Both ClearSpeak_rules.yaml and multiline.rs needed an update. * Fixed linear-algebra fails Restored language-specific rules for homomorphism and kernel. * Tests updated Updated tests to conform to slight changes in speaking (pausing and 1/en) * Fixed some small errors * Bug fix * Update navigate.yaml * Fixed a language-dependent issue * Added audit-ignore to reintroduced rules * Fixed laplacian * Minor typo fix Added missing "bråk" to "slut bråk" announcement --------- Co-authored-by: AndersEkl <anders.eklund@spsm.se> * Sv update - fixes for failed tests (daisy#678) * first updates unicode, general and part of default * Test update * Updated geometry.yaml #2 * Updated linear-algebra and calculus #3 #4 * ClearSpeak_rules.yaml updated * Update overview.yaml Close daisy#10 * Update navigate.yaml * Update SimpleSpeak_Rules.yaml * Update definitions.yaml Closes daisy#14 * Updated SimpleSpeakl and ClearSpeak Finished the update of SimpleSpeak and corrected a rule in both SimpleSpeak and ClearSpeak that made mixed numbers be spoken incorrectly. * Bug fix in SimpleSpeak and ClearSpeak Fixed a bug concerning common fractions used in mixed numbers. * Fixed a bug in general.yaml Fixed a bug concerning how one is spoken in combination with a unit. * Unicode-full & navigate Updated unicode-full and navigate, plus fixed a couple of typos in the english unicode-full. * Fixed a corrupt file There was some problem with general.yaml, which should now be fixed. * Update default.yaml * Update general.yaml Hopefully this fix will solve a lot of the failed tests. daisy#15 * Updated functions.rs Both for ClearSpeak and SimpleSpeak * Fixed a multiline test fail Both ClearSpeak_rules.yaml and multiline.rs needed an update. * Fixed linear-algebra fails Restored language-specific rules for homomorphism and kernel. * Tests updated Updated tests to conform to slight changes in speaking (pausing and 1/en) * Fixed some small errors * Bug fix * Update navigate.yaml * Fixed a language-dependent issue * Added audit-ignore to reintroduced rules * Fixed laplacian * Minor typo fix Added missing "bråk" to "slut bråk" announcement * Fixes for failed tests Changed functions.rs in both ClearSpeak and SimpleSpeak as well as tweaked a rule for equillibrium arrows in general.yaml. --------- Co-authored-by: Tim Arborealis Lötberg <143188129+TimArborealis@users.noreply.github.com> Co-authored-by: NSoiffer <NSoiffer@users.noreply.github.com> --------- Co-authored-by: Tim Arborealis Lötberg <143188129+TimArborealis@users.noreply.github.com> Co-authored-by: AndersEkl <anders.eklund@spsm.se> Co-authored-by: AndersEkl <39799609+AndersEkl@users.noreply.github.com>
1 parent 988a845 commit b891d1a

19 files changed

Lines changed: 7090 additions & 5158 deletions

‎Rules/Languages/en/unicode-full.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1452,7 +1452,7 @@
14521452
- "✓": [t: "check mark"] # 0x2713
14531453
- "✠": [t: "maltese cross"] # 0x2720
14541454
- "✪": [t: "circled white star"] # 0x272a
1455-
- "✶": [t: "six pionted black star"] # 0x2736
1455+
- "✶": [t: "six pointed black star"] # 0x2736
14561456
- "❨": [t: "medium left parentheses ornament"] # 0x2768
14571457
- "❩": [t: "medium right parentheses ornament"] # 0x2769
14581458
- "❪": [t: "medium flattened left parentheses ornament"] # 0x276a

‎Rules/Languages/sv/ClearSpeak_Rules.yaml‎

Lines changed: 98 additions & 69 deletions
Large diffs are not rendered by default.

‎Rules/Languages/sv/SharedRules/calculus.yaml‎

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,30 @@
11
---
22

3+
- name: laplacian
4+
tag: laplacian
5+
match: "count(*) <= 1" # can be on ∇^2 or on enclosing mrow
6+
replace:
7+
- T: "laplacianen" # phrase('laplacian' of x) -- "LahPlahsian" sounds better with speech engines tested
8+
- test:
9+
if: "count(*) = 1"
10+
then:
11+
- test:
12+
if: "$Verbosity!='Terse'"
13+
then: [T: "av"] # phrase(function 'of' one variable) -- note OneCore voices spell out "div"
14+
- test:
15+
if: "not(IsNode(*[1], 'leaf'))"
16+
then: [pause: short]
17+
- x: "*[1]"
18+
319
- name: divergence
420
tag: divergence
521
match: "."
622
replace:
723
- test:
824
if: "$Verbosity='Verbose'"
9-
then: [t: "divergence"] # phrase('divergence' from the mean)
10-
else: [t: "div"] # phrase('divergence' from the mean)
11-
- t: "of" # phrase(systems 'of' linear equations)
25+
then: [T: "divergensen"] # phrase('divergence' from the mean)
26+
else: [T: "div"] # phrase('divergence' from the mean)
27+
- T: "av" # phrase(systems 'of' linear equations)
1228
- test:
1329
if: "not(IsNode(*[1], 'leaf'))"
1430
then: [pause: short]
@@ -18,7 +34,7 @@
1834
tag: curl
1935
match: "."
2036
replace:
21-
- t: "curl of" # phrase(the 'curl of' a field)
37+
- T: "rotationen av" # phrase(the 'curl of' a field)
2238
- test:
2339
if: "not(IsNode(*[1], 'leaf'))"
2440
then: [pause: short]
@@ -30,8 +46,8 @@
3046
replace:
3147
- test:
3248
if: "$Verbosity!='Terse'"
33-
then: [t: "gradient of"] # phrase('divergence' from the mean)
34-
else: [t: "del"] # phrase('divergence' from the mean)
49+
then: [T: "gradienten av"] # phrase('divergence' from the mean)
50+
else: [T: "dell"] # phrase('divergence' from the mean)
3551
- test:
3652
if: "not(IsNode(*[1], 'leaf'))"
3753
then: [pause: short]

‎Rules/Languages/sv/SharedRules/default.yaml‎

Lines changed: 64 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@
66
replace:
77
- with:
88
variables:
9-
- ClearSpeak_Fractions: "IFTHENELSE($Verbosity='Verbose' and $ClearSpeak_Fractions='Auto', 'EndFrac', $ClearSpeak_Fractions)"
10-
- ClearSpeak_AbsoluteValue: "IFTHENELSE($Verbosity='Verbose' and $ClearSpeak_AbsoluteValue='Auto', 'AbsEnd', $ClearSpeak_AbsoluteValue)"
11-
- ClearSpeak_Roots: "IFTHENELSE($Verbosity='Verbose' and $ClearSpeak_Roots='Auto', 'RootEnd', $ClearSpeak_Roots)"
12-
- ClearSpeak_Matrix: "IFTHENELSE($Verbosity='Verbose' and $ClearSpeak_Matrix='Auto', 'EndMatrix', $ClearSpeak_Matrix)"
9+
- ClearSpeak_Fractions: "IfThenElse($Verbosity='Verbose' and $ClearSpeak_Fractions='Auto', 'EndFrac', $ClearSpeak_Fractions)"
10+
- ClearSpeak_AbsoluteValue: "IfThenElse($Verbosity='Verbose' and $ClearSpeak_AbsoluteValue='Auto', 'AbsEnd', $ClearSpeak_AbsoluteValue)"
11+
- ClearSpeak_Roots: "IfThenElse($Verbosity='Verbose' and $ClearSpeak_Roots='Auto', 'RootEnd', $ClearSpeak_Roots)"
12+
- ClearSpeak_Matrix: "IfThenElse($Verbosity='Verbose' and $ClearSpeak_Matrix='Auto', 'EndMatrix', $ClearSpeak_Matrix)"
13+
14+
- MatchingPause: false()
1315
# should be set at mtable level, but unknown intents make that impossible to know
1416
- IsColumnSilent: false()
1517
replace:
@@ -55,9 +57,11 @@
5557
replace:
5658
- bookmark: "@id"
5759
- test:
58-
if: "string-length(.) = 1 and text() != '_'" # need unicode.tdl to kick in for single letter tokens
60+
- if: "string-length(.) = 1 and text() != '_'" # need unicode.tdl to kick in for single letter tokens
5961
then: [x: "text()"]
60-
else: [x: "translate(., '-_', ' ')" ] # from intent literals
62+
- else_if: "@data-chem-element" # NavMode=Character needs this
63+
then: [SPELL: "text()", pause: "short"]
64+
else: [x: "translate(., '-_\u00A0', ' ')"] # from intent literals or from extra spaces added (which get deleted)
6165

6266
- name: default
6367
tag: ms
@@ -72,8 +76,7 @@
7276
match: "."
7377
replace: [x: "*"]
7478

75-
76-
- name: structure-simple
79+
- name: literal-simple
7780
# don't include nested fractions. E.g, fraction a plus b over c + 1 end fraction" is ambiguous
7881
# by simplistic SimpleSpeak's rules "b over c" is a fraction, but if we say nested fractions
7982
# are never simple, then any 'over' applies only to enclosing "fraction...end fraction" pair.
@@ -87,7 +90,7 @@
8790
- x: "*[2]"
8891
- pause: short
8992

90-
- name: structure-default
93+
- name: literal-default
9194
tag: mfrac
9295
match: "."
9396
replace:
@@ -103,74 +106,77 @@
103106
then: [pause: short]
104107
- x: "*[2]"
105108
- pause: short
106-
- T: "slut division" # phrase("start of fraction x over y 'end over'")
109+
- test:
110+
if: "$Impairment = 'Blindness'"
111+
then: [T: "slut bråk"] # phrase("start of fraction x over y 'end over'")
107112
- pause: medium
108113

109-
110114
# not sure what really should be said for these since we should not assume they are square roots
111-
- name: structure-default
115+
- name: literal-default # audit-ignore
112116
tag: msqrt
113117
match: "."
114118
replace:
115-
- T: "rotsymbolen"
116-
- test:
117-
if: "$Verbosity!='Terse'"
118-
then: [T: "ur"] # phrase("the root 'of' x")
119+
- T: "roten ur"
119120
- x: "*[1]"
120121
- pause: short
121122
- test:
122-
if: "not(IsNode(*[1],'leaf'))"
123-
then: [T: "slut rotsymbol"] # phrase("root of x 'end root symbol'")
123+
if: "not(IsNode(*[1],'leaf')) or $Impairment = 'Blindness'"
124+
then: [T: "slut rot", pause: medium] # phrase("root of x 'end root symbol'")
124125

125126
# not sure what really should be said for these since we should not assume they are square roots
126-
- name: structure-default
127+
- name: literal-default # audit-ignore
127128
tag: mroot
128129
match: "."
129130
replace:
130-
- T: "rotsymbolen"
131-
- T: "med index" # phrase("the root of x 'with index' 5")
131+
- T: "rot med index" # phrase("the 'root with index' 3 of 5")
132132
- x: "*[1]"
133-
# SWEDISH: Check if the order of base and index is correct!
134133
- pause: short
135-
- test:
136-
if: "$Verbosity!='Terse'"
137-
then: [T: "ur"] # phrase("the root 'of' x")
134+
- T: "ur" # phrase("the root 'of' x")
138135
- x: "*[2]"
139136
- pause: short
140137
- test:
141138
if: "not(IsNode(*[2],'leaf'))"
142-
then: [T: "slut rotsymbol"] # phrase("root of x 'end root symbol'")
139+
then: [T: "slut rot"] # phrase("root of x 'end root symbol'")
143140

144-
145-
- name: simple-sub
141+
- name: simple-sub # audit-ignore
146142
tag: indexed-by
147143
# invisible comma -- want "x 1 when subscript is an integer"
148-
match: "count(*)=2 and $Verbosity='Terse' and *[2][self::m:mn and translate(., '.,', '')=.]"
144+
# SWEDISH: want to skip announcing "index" not only when integer but also the index consists of one single character
145+
match: "count(*)=2 and $Verbosity='Terse' and IsNode(*[2], 'leaf') and ( (*[2][self::m:mn and translate(., '.,', '')=.]) or string-length(*[2])=1 )"
149146
replace:
150147
- x: "*[1]"
151148
- x: "*[2]"
152149
- pause: short
153150

154151
- name: no-end-sub
155152
tag: indexed-by
156-
# invisible comma -- want "x 1 when subscript is an integer"
157-
match: "count(*)=2 and (IsNode(*[2], 'leaf') or *[2][self::m:mrow][*[2][.='⁣']])"
153+
match: "count(*)=2 and *[2][self::m:mrow and *[2][.='⁣']]"
158154
replace:
159155
- x: "*[1]"
160-
- test:
161-
if: "$Verbosity!='Terse' or not(*[2][self::m:mn])" # just say "x 1" for terse vs "x sub 1"
162-
then: [T: "nedsänkt"] # phrase(x 'sub' 2)
156+
- T: "nedsänkt" # phrase(x 'sub' 2)
157+
- x: "*[2]"
158+
- pause: short
159+
160+
- name: power-indexed-by
161+
tag: power-indexed-by
162+
match: "."
163+
replace:
164+
- x: "*[1]"
165+
- T: "nedsänkt" # phrase(x 'sub' 2)
163166
- x: "*[2]"
167+
- pause: short
164168

165-
- name: structure
169+
- name: literal
166170
tag: msub
167171
match: "."
168172
replace:
169173
- x: "*[1]"
170-
- T: "nedsänkt" # phrase(x 'sub' 2)
174+
- test:
175+
if: "not($Verbosity='Terse' and *[2][self::m:mn and not(translate(., '.,', '')!=.)])" # just say "x 1" for terse vs "x sub 1"
176+
then: [T: "nedsänkt"] # phrase(x 'sub' 2)
171177
- x: "*[2]"
172178

173-
- name: structure
179+
- name: literal
174180
tag: [msup, msubsup]
175181
match: "."
176182
replace:
@@ -184,34 +190,26 @@
184190
if: "*[last()][translate(., '′″‴⁗†‡°*', '')='']"
185191
then: [x: "*[last()]"]
186192
else_test:
187-
if: "ancestor-or-self::*[contains(@data-intent-property, ':structure:')]" # FIX: is this test necessary?
193+
if: "ancestor-or-self::*[contains(@data-intent-property, ':literal:')]" # FIX: is this test necessary?
188194
then:
189195
- T: "upphöjt" # phrase(x 'super' 2)
190196
- x: "*[last()]"
191197
- test:
192-
if: "not(IsNode(*[last()], 'simple'))"
198+
if: "not(IsNode(*[last()], 'simple')) or $Impairment = 'Blindness'"
193199
then: [T: "slut upphöjt"] # phrase(x super 2 'end of super')
194200
else:
195-
- T: "upphöjt till" # phrase(5 'raised to the' second power equals 25)
201+
- test:
202+
if: "$Verbosity='Verbose'"
203+
then: [T: "övre index"]
204+
else: [T: "upphöjt"]
196205
- x: "*[last()]"
197-
# - t: "power" # phrase(5 raised to the second 'power' equals 25)
198-
199-
# - name: default
200-
# tag: munder
201-
# match: "."
202-
# replace:
203-
# - test:
204-
# if: "not(IsNode(*[1], 'leaf'))"
205-
# then: [T: "kommenterat uttryck"] # phrase(phrase(x 'modified' with y above it)
206-
# - x: "*[1]"
207-
# - pause: short
208-
# - T: "med kommentar under" # phrase(x 'with' z below it)
209-
# - pause: short
210-
# - x: "*[2]"
211-
# - pause: short
212-
# - T: "slut kommentar" # phrase(x with z 'below' it)
206+
- test:
207+
if: "$Verbosity='Verbose'"
208+
then: [T: "slut övre index"]
209+
else: [T: "slut upphöjt"]
213210

214-
- name: default
211+
# SWEDISH: adapted the rule for less verbose speaking of expressions with a brace under them and then with something under the brace
212+
- name: default # audit-ignore
215213
tag: munder
216214
match: "."
217215
replace:
@@ -243,7 +241,7 @@
243241

244242
- name: diacriticals
245243
tag: mover
246-
match: "*[1][self::m:mi] and *[2][translate(., '\u0306\u030c.\u00A8\u02D9\u20DB\u20DC`^~→¯_', '')='']"
244+
match: "*[1][self::m:mi] and *[2][translate(., '\u0306\u030c.\u00A8\u02D9\u20DB\u20DC`^ˇ~→¯_', '')='']"
247245
replace:
248246
- x: "*[1]"
249247
- x: "*[2]"
@@ -282,11 +280,12 @@
282280
- pause: short
283281
- T: "slut kommentar" # phrase(x modified with y 'above' it)
284282

285-
- name: default
283+
- name: default # audit-ignore
286284
# Here we support up to 2 prescripts and up to 4 postscripts -- that should cover all reasonable cases
287285
# If there are more, we just dump them out without regard to sup/super :-(
288286
# FIX: this could use more special cases
289287
# There is (currently) no way in MathCAT to deal with n-ary arguments other than "all" ('*') or an individual entry ('*[1]').
288+
# SWEDISH: announce "left index" also if there are no right indexes
290289
tag: mmultiscripts
291290
match: "."
292291
variables:
@@ -371,9 +370,10 @@
371370
else:
372371
- test:
373372
if: "$Prescripts"
374-
then: [T: "och"]
375-
- T: "höger index"
376-
- pause: short
373+
then:
374+
- T: "och"
375+
- T: "höger index"
376+
- pause: short
377377
- test:
378378
if: "not($Postscripts[1][self::m:none])"
379379
then:
@@ -458,7 +458,7 @@
458458
- T: "och" # phrase(the table with 3 rows 'and' 4 columns)
459459
- x: "$NumColumns"
460460
- test:
461-
if: "$NumColumns"
461+
if: "NumColumns=1"
462462
then: [T: "kolumn"] # phrase(the table with 3 rows and 1 'column')
463463
else: [T: "kolumner"] # phrase(the table with 3 rows and 4 'columns')
464464
- pause: long
@@ -716,7 +716,7 @@
716716
then: [pause: short]
717717
else: [pause: auto]
718718

719-
- name: function-intent
719+
- name: function-intent # audit-ignore
720720
# uncaught intent -- speak as foo of arg1 comma arg2 .... The MathML spec requires arguments to functions
721721
tag: "*"
722722
match: "count(*)>0"

0 commit comments

Comments
 (0)