Skip to content

Commit 680f410

Browse files
Div. changes
ClearSpeak: Minor clean-ups Deafault: Minor clean-ups General: Minor clean-ups. Linear-algebra: Minor clean-ups SimpleSpeak: Added short pause in the default-root-rule. Unicode-full: Splitted some units with prefix for better pronunciation. Unicode: Added condition in the rule for 0xB7. Now it doesn't speak "tom tom" for the test continued_row in multiline.
1 parent 0b8260b commit 680f410

File tree

9 files changed

+56
-82
lines changed

9 files changed

+56
-82
lines changed

Rules/Languages/nb/ClearSpeak_Rules.yaml

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,13 @@
6161
then: [T: "kvadratroten"] # phrase(5 is the 'square root' of 25)
6262
- else_if: "*[2][.='3']"
6363
then: [T: "kubikkroten"] # phrase(5 is the 'cube root' of 625)
64-
- else_if: "*[2][not(contains(., ','))]" # SWEDISH: Changed decimal point to comma.
64+
- else_if: "*[2][not(contains(., ','))]" # SWEDISH/NORWEGIAN: Changed decimal point to comma.
6565
then: [x: "ToOrdinal(*[2])", T: "roten"] # phrase(the square 'root' of 25)
6666
else:
6767
- T: "roten av grad" # phrase(the square 'root' of 36)
6868
- x: "*[2]"
6969
- pause: short
70-
# SWEDISH: Removed verbosity settings.
70+
# SWEDISH/NORWEGIAN: Removed verbosity settings.
7171
- T: "av" # phrase(the square root 'of' 36)
7272
- x: "*[1]"
7373
- test:
@@ -450,7 +450,6 @@
450450
- EndToSay: "IfThenElse($ClearSpeak_AbsoluteValue = 'Cardinality', 'kardinalitet', 'absoluttverdi')"
451451
replace:
452452
- x: "$WordToSay"
453-
#- T: "av" # phrase(the absolute value 'of' 25)
454453
- x: "*[1]"
455454
- test:
456455
if: "$ClearSpeak_AbsoluteValue = 'AbsEnd'"
@@ -495,19 +494,15 @@
495494
# # note that *[2] is an mrow with X, ",", Y, so getting X or Y is a double index
496495
# onto the [not] [including]... part
497496

498-
# SWEDISH: rewrote the intervals function to better deal with Swedish convention of speaking intervals
499-
# NORWEGIAN: Removed test for verbosity, cause you should always say "det åpne"
497+
# SWEDISH/NORWEGIAN: rewrote the intervals function to better deal with Swedish convention of speaking intervals
498+
# NORWEGIAN: Removed test for verbosity, cause you should always say "det åpne" etc.
500499
- name: ClearSpeak-intervals # avoid overriding with default "intervals" name
501500
variables:
502501
- is_intervals_start_infinity: "*[1][self::m:minus and count(*)=1 and *[1][.='∞']]"
503502
- is_intervals_end_infinity: "*[2][.='∞'or (self::m:plus and count(*)=1 and *[1][.='∞'])]"
504503
tag: [open-interval, open-closed-interval, closed-interval, closed-open-interval]
505504
match: "."
506505
replace:
507-
#- test:
508-
#- if: "$Verbosity!='Terse'"
509-
#then:
510-
#- T: "det"
511506
- test:
512507
- if: "name(.)='open-interval'"
513508
then: [T: "det åpne"]
@@ -592,9 +587,7 @@
592587
- else_if: $ClearSpeak_Log = 'LnAsNaturalLog' or $Verbosity='Verbose'
593588
then: [T: "den naturlige logaritmen"] # phrase(the 'natural log' of x)
594589
else: [spell: "'ln'"]
595-
#- test:
596-
#- if: "$Verbosity='Verbose'"
597-
#then: [{T: "av"}] # phrase(the natural log 'of' x)
590+
#NORWEGIAN: Removed test for verbosity
598591
- T: "av"
599592
- pause: short
600593
- x: "*[3]"
@@ -649,7 +642,7 @@
649642
- if: "$LineCount > 1 and $ClearSpeak_MultiLineLabel != 'None'"
650643
then: [T: "steg"] # phrase(this is the first 'step' of three steps)
651644
else: [T: "steg"] # phrase(this is the first 'step' of three steps)
652-
# SWEDISH: Every expression had to be inflected separately.
645+
# SWEDISH/NORWEGIAN: Every expression had to be inflected separately.
653646
- pause: short
654647
- x: "*"
655648

Rules/Languages/nb/SharedRules/default.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,14 +127,14 @@
127127
then: [T: "slutt rottegn"] # phrase("root of x 'end root symbol'")
128128

129129
# not sure what really should be said for these since we should not assume they are square roots
130+
# NORWEGIAN: Changed to "med grad", and changed the order of the index and the variable/number in the root.
130131
- name: literal-default
131132
tag: mroot
132133
match: "."
133134
replace:
134135
- T: "rottegn"
135136
- T: "med grad" # phrase("the root of x 'with index' 5")
136137
- x: "*[2]"
137-
# SWEDISH: Check if the order of base and index is correct!
138138
- pause: short
139139
- test:
140140
if: "$Verbosity!='Terse'"
@@ -709,7 +709,7 @@
709709
# - test:
710710
# if: "not(contains(@data-intent-property, ':literal:'))"
711711
# then: [x: "','"]
712-
# SWEDISH: After correspondence with a mathematician we have decided to not have any punctuation between variables, but a short pause. Length of pause needs to be tested.
712+
# SWEDISH/NORWEGIAN: After correspondence with a mathematician we have decided to not have any punctuation between variables, but a short pause. Length of pause needs to be tested.
713713
- test:
714714

715715
if: "$Impairment = 'Blindness' and not(*[last()][IsBracketed(., '', '') or IsNode(., 'simple')] )"

Rules/Languages/nb/SharedRules/general.yaml

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
tag: number-sets
1414
match: "count(*)=2 and *[2][.='+' or .='-']"
1515
replace:
16-
# SWEDISH: This test, to see if "the" is supposed to be added or not, is removed from the Swedish translations, as it is not applicable.
16+
# NORWEGIAN: Removed test for verbosity
1717
#- test:
1818
#if: "$Verbosity!='Terse'"
1919
#then:
@@ -100,7 +100,7 @@
100100
if: "$Verbosity!='Terse'"
101101
then: [T: "evaluert i"] # phrase(results were 'evaluated at' a given point)
102102
else: [T: "i"]
103-
# SWEDISH: Added a verbosity setting test to allow a shorter form.
103+
# SWEDISH/NORWEGIAN: Added a verbosity setting test to allow a shorter form.
104104
- pause: auto
105105
- x: "*[2]"
106106

@@ -118,13 +118,9 @@
118118
- x: "*[3]"
119119
- pause: short
120120
- T: "og" # phrase(this result is 'minus the same expression evaluated at' an earlier point)
121-
# SWEDISH: Removed the expansion of the expression, keeping the output closer to what is actually shown visually.
122-
- test:
123-
if: "$Verbosity!='Terse'"
124-
then: [T: "nedre verdi"] # phrase(results were 'evaluated at' a given point)
125-
else: [T: "nedre verdi"]
121+
- T: "nedre verdi"
122+
# SWEDISH/NORWEGIAN: Removed the expansion of the expression, keeping the output closer to what is actually shown visually.
126123
- pause: short
127-
# SWEDISH: Added a verbosity setting test to allow a shorter form.
128124
- x: "*[2]"
129125

130126
- name: permutation
@@ -136,12 +132,12 @@
136132
- T: "elementer av" # phrase(the solution involves several 'permutations of' values)
137133
- x: "*[1]"
138134

139-
# NORWEGIAN: Removed test for Verbosity
135+
# NORWEGIAN: Removed test for verbosity
140136
- name: intervals
141137
tag: [open-interval, open-closed-interval, closed-interval, closed-open-interval]
142138
match: "count(*)=2"
143139
replace:
144-
# SWEDISH: The translate function doesn't work for non-English. Used the solution below instead.
140+
# SWEDISH/NORWEGIAN: The translate function doesn't work for non-English. Used the solution below instead.
145141
- test:
146142
- if: "self::m:open-interval"
147143
then: [T: "det åpne intervallet"]
@@ -339,7 +335,7 @@
339335
if: "$Verbosity='Terse'"
340336
then: [T: "sin"] # phrase('sin' is the abbreviation for sine)
341337
else: [T: "sinus"] # phrase(the 'sine' of the angle)
342-
# SWEDISH: Added short form.
338+
# SWEDISH/NORWEGIAN: Added short form.
343339

344340
- name: cos
345341
tag: mi
@@ -391,7 +387,7 @@
391387
then: [T: "cotan"] # phrase(find the 'cotangent' in a right-angle triangle)
392388
else: [T: "cotangens"] # phrase(the 'cotangent' is the reciprocal of the tangent)
393389

394-
# NORWEGIAN: Removed tests for Verbosity. We don't say "sin hype" and "sinh" sounds like "sin"
390+
# NORWEGIAN: Removed tests for verbosity. We don't say "sin hype" etc., and "sinh" sounds like "sin"
395391
- name: sinh
396392
tag: mi
397393
match: ".='sinh'"
@@ -469,17 +465,13 @@
469465
then: [T: "exp"] # phrase('exp' means exponential function)
470466
else: [T: "eksponensialfunksjonen"] # phrase('exponential' function) #Norwegian: Spelled wrong for correct pronunciation
471467

472-
# NORWEGIAN: Added this rule from English version, but removed test for Verbosity.
468+
# NORWEGIAN: Added this rule from English version, but removed test for verbosity.
473469
- name: covariance
474470
tag: mi
475471
match: ".='Cov'"
476472
replace:
477473
- bookmark: "@id"
478474
- T: "kovarians"
479-
#- test:
480-
#if: "$Verbosity='Terse'"
481-
#then: [t: "Cov"] # phrase('Cov' is shorthand for the covariance function)
482-
#else: [t: "covariance"] # phrase('covariance' function)
483475

484476
- # handle both log and ln
485477
name: log
@@ -501,7 +493,7 @@
501493
- if: "$Verbosity!='Verbose'"
502494
then: [spell: "'lg'"] # phrase(the 'lg' of x)
503495
else: [T: "tier-logaritmen"]
504-
# SWEDISH: We have added the term "lg" for the logarithm with base 10. Also added a verbosity test for long and short form.
496+
# SWEDISH/NORWEGIAN: We have added the term "lg" for the logarithm with base 10. Also added a verbosity test for long and short form.
505497
- else_if: "$Verbosity!='Verbose'"
506498
then: [spell: "'ln'"]
507499
else: [T: "den naturlige logaritmen"] # phrase(the 'natural log' function is used in mathematics)
@@ -632,7 +624,7 @@
632624

633625

634626
# simpler reading methods for special case matrices
635-
# NORWEGIAN: Added these tests from the English version.
627+
# NORWEGIAN: Added these rules from the English.
636628
- name: zero-matrix
637629
tag: matrix
638630
# select all the non-zero entries -- if there are none of them, then it is a zero matrix
@@ -846,6 +838,7 @@
846838
if: "$Verbosity='Terse'"
847839
then: [pause: short]
848840

841+
#NORWEGIAN: Added from English. Not tested
849842
- name: dimension-by
850843
tag: mrow
851844
match: dimension-product

Rules/Languages/nb/SharedRules/linear-algebra.yaml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,23 @@
11
---
2-
# NORWEGIAN: Removed test for Verbosity
32
- name: scalar-determinant
43
tag: determinant
54
match: "count(*)=1 and not(*[1][self::m:mtr])"
65
replace:
76
- T: "determinanten" # phrase(the 'determinant' of a matrix)
8-
#- test:
9-
#if: "$Verbosity!='Terse'"
10-
#then:
7+
# NORWEGIAN: Removed test for Verbosity
118
- T: "til" # phrase(systems 'of' linear equations)
129
- x: "*[1]"
1310
- test:
1411
if: "not(IsNode(*[1], 'simple'))"
1512
then: [T: "slutt determinant"] # phrase('end determinant' of a matrix)
1613

17-
# NORWEGIAN: Removed test for Verbosity
1814
- name: subscripted-norm
1915
tag: subscripted-norm
2016
match: "count(*)=2"
2117
replace:
2218
- x: "*[2]"
2319
- T: "normen" # phrase(the 'norm' can be a measure of distance)
24-
#- test:
25-
#if: "$Verbosity!='Terse'"
26-
#then:
20+
# NORWEGIAN: Removed test for Verbosity
2721
- T: "til" # phrase(systems 'of' linear equations)
2822
- x: "*[1]"
2923

Rules/Languages/nb/SimpleSpeak_Rules.yaml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,17 @@
1414
- T: "minus" # phrase(x 'minus' y)
1515
- x: "translate(text(), '-_', '')"
1616

17-
# NORWEGIAN: Removed test for Verbosity
1817
- name: default
1918
tag: square-root
2019
match: "."
2120
replace:
2221
- T: "kvadratroten av" # phrase(the 'square root' of x)
23-
#- test:
24-
#if: "$Verbosity!='Terse'"
25-
#then: {T: "av"} # phrase(the square root 'of' x)
26-
#else: {pause: short}
27-
#- pause: short
22+
# NORWEGIAN: Removed test for Verbosity
2823
- x: "*[1]"
2924
- test:
3025
if: IsNode(*[1], 'leaf')
3126
then: [pause: short]
32-
else: [{pause: short}, {T: "slutt rot"}, {pause: short}] # phrase(start the square root of x 'end of root')
27+
else: [pause: short, T: "slutt rot", pause: short] # phrase(start the square root of x 'end of root')
3328

3429
- name: default
3530
tag: root
@@ -53,7 +48,7 @@
5348
- test:
5449
if: IsNode(*[1], 'leaf')
5550
then: [pause: short]
56-
else: [T: "slutt rot", pause: short] # phrase(start the fifth root of x 'end of root')
51+
else: [pause: short, T: "slutt rot", pause: short] # phrase(start the fifth root of x 'end of root')
5752

5853
# Fraction rules
5954
# Mixed numbers mostly "just work" because the invisible char reads as "and" and other parts read properly on their own

0 commit comments

Comments
 (0)