Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
2a9d3a7
use translation audit tool check and fix navigate.yaml,
hjy1210 Jun 17, 2026
d53b74e
人工比對 en/tw 版 definitions.yaml,非常辛苦()
hjy1210 Jun 17, 2026
271c3fa
用 translation audit tool 檢查default.yaml 與 geometry.yaml,default.yaml …
hjy1210 Jun 18, 2026
5044284
calculus.yaml 增加 laplacian(laplacian),變動 divergence, curl, gradient,
hjy1210 Jun 18, 2026
bbc32fb
general.yaml 新增 repeating-decimal, unit-terse, currency, exponential,…
hjy1210 Jun 18, 2026
ec397d1
update unicode.yaml, overview.yaml, SimpleSpeak_rules,yaml
hjy1210 Jun 22, 2026
8c3758d
update unicode-full.yaml
hjy1210 Jun 22, 2026
eb298c9
unicode-full.yaml 箭頭重翻。空心字形>雙線字形
hjy1210 Jun 23, 2026
f04a035
黑圈內->黑圈圈,圈圈內->圈圈.
hjy1210 Jun 23, 2026
fbb6875
intent.rs 增加 silent_intent(), prefix_intent(), postfix_intent(), in…
hjy1210 Jun 23, 2026
9390860
update mtable.rs
hjy1210 Jun 23, 2026
5d65d10
update shared.rs, literal_speak_perpendicular(), literal_intent_prope…
hjy1210 Jun 23, 2026
f208bb6
definitions.yaml/IntentMappings/binomial
hjy1210 Jun 24, 2026
c262a91
update units.rs
hjy1210 Jun 25, 2026
4da21ed
t->T
hjy1210 Jun 25, 2026
e71adb8
註解intent.rs裡面的init_logger,避免 cargo test 的錯誤。cargo test Languages::zh:…
hjy1210 Jun 25, 2026
92536ae
223, 2245, 251, 223, 百分點, 三角形
hjy1210 Jun 25, 2026
519717f
remove geometry-vector(mover), geometry-arc(mover)
hjy1210 Jun 30, 2026
2bdf69e
linear-algebra移除norm,transpose,trace,dimension,homomorphism,kernel轉由d…
hjy1210 Jun 30, 2026
e4006a4
navigate/end of ->終點, start of -> 開頭
hjy1210 Jun 30, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 28 additions & 10 deletions Rules/Languages/zh/tw/SharedRules/calculus.yaml
Original file line number Diff line number Diff line change
@@ -1,37 +1,55 @@
---

- name: laplacian
tag: laplacian
match: "count(*) <= 1" # can be on ∇^2 or on enclosing mrow
replace:
- T: "LahPlahsian" # phrase('laplacian' of x) -- "LahPlahsian" sounds better with speech engines tested
- test:
if: "count(*) = 1"
then:
- test:
if: "$Verbosity!='Terse'"
then: [T: ""] # phrase(function 'of' one variable) -- note OneCore voices spell out "div"
- test:
if: "not(IsNode(*[1], 'leaf'))"
then: [pause: short]
- x: "*[1]"

- name: divergence
tag: divergence
match: "."
match: "count(*) = 1"
replace:
- test:
if: "$Verbosity='Verbose'"
then: [t: "divergence"] # phrase('divergence' from the mean)
else: [t: "div"] # phrase('divergence' from the mean)
- t: "of" # phrase(systems 'of' linear equations)
if: "$Verbosity='Terse'"
then: [T: "div"] # phrase('div' is short for divergence) -- note OneCore voices spell out "div"
else: [T: "divergence"] # phrase('divergence of' this function from the mean)
- test:
if: "not(IsNode(*[1], 'leaf'))"
then: [pause: short]
- x: "*[1]"

- name: curl
tag: curl
match: "."
match: "count(*) = 1"
replace:
- t: "curl of" # phrase(the 'curl of' a field)
- T: "curl" # phrase(the 'curl of' a field)
- test:
if: "$Verbosity!='Terse'"
then: [t: ""] # phrase(function 'of' one variable) -- note OneCore voices spell out "div"
- test:
if: "not(IsNode(*[1], 'leaf'))"
then: [pause: short]
- x: "*[1]"

- name: gradient
tag: gradient
match: "."
match: "count(*) = 1"
replace:
- test:
if: "$Verbosity!='Terse'"
then: [t: "gradient of"] # phrase('divergence' from the mean)
else: [t: "del"] # phrase('divergence' from the mean)
then: [T: "gradient"] # phrase(the hill has a 'gradient of' five percent)
else: [T: "del"] # phrase(the delete key is labeled 'del')
- test:
if: "not(IsNode(*[1], 'leaf'))"
then: [pause: short]
Expand Down
90 changes: 59 additions & 31 deletions Rules/Languages/zh/tw/SharedRules/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
- ClearSpeak_AbsoluteValue: "IfThenElse($Verbosity='Verbose' and $ClearSpeak_AbsoluteValue='Auto', 'AbsEnd', $ClearSpeak_AbsoluteValue)"
- ClearSpeak_Roots: "IfThenElse($Verbosity='Verbose' and $ClearSpeak_Roots='Auto', 'RootEnd', $ClearSpeak_Roots)"
- ClearSpeak_Matrix: "IfThenElse($Verbosity='Verbose' and $ClearSpeak_Matrix='Auto', 'EndMatrix', $ClearSpeak_Matrix)"

- MatchingPause: false()
# should be set at mtable level, but unknown intents make that impossible to know
- IsColumnSilent: false()
replace:
- test:
if: "$MathRate = 100"
Expand Down Expand Up @@ -38,7 +42,10 @@
match: "."
replace:
- bookmark: "@id"
- x: "translate(., $BlockSeparators, '')" # remove digit block separators
- test:
- if: "@data-roman-numeral"
then: [SPELL: "text()", pause: "short"]
else: [x: "translate(., $BlockSeparators, '')"] # remove digit block separators

- name: default
tag: [mo, mtext]
Expand All @@ -53,9 +60,11 @@
replace:
- bookmark: "@id"
- test:
if: "string-length(.) = 1 and text() != '_'" # need unicode.tdl to kick in for single letter tokens
- if: "string-length(.) = 1 and text() != '_'" # need unicode.tdl to kick in for single letter tokens
then: [x: "text()"]
else: [x: "translate(., '-_', ' ')" ] # from intent literals
- else_if: "@data-chem-element or @data-roman-numeral" # NavMode=Character needs this
then: [SPELL: "text()", pause: "short"]
else: [x: "translate(., '-_\u00A0', ' ')"] # from intent literals or from extra spaces added (which get deleted)

- name: default
tag: ms
Expand Down Expand Up @@ -101,7 +110,9 @@
then: [pause: short]
- x: "*[1]"
- pause: short
- T: "結束分數" # phrase("start of fraction x over y 'end over'")
- test:
if: "$Impairment = 'Blindness'"
then: [T: "結束分數"] # phrase("start of fraction x over y 'end over'")
- pause: medium


Expand All @@ -120,8 +131,8 @@
- x: "*[1]"
- pause: short
- test:
if: "not(IsNode(*[1],'leaf'))"
then: [T: "結束根號"] # phrase("root of x 'end root symbol'")
if: "not(IsNode(*[1],'leaf')) or $Impairment = 'Blindness'"
then: [T: "結束根號", pause: medium] # phrase("root of x 'end root symbol'")

# not sure what really should be said for these since we should not assume they are square roots
- name: literal-default
Expand All @@ -135,9 +146,6 @@
- x: "*[2]"
- T: "根號"
- pause: short
- test:
if: "$Verbosity!='Terse'"
then: [T: ""] # phrase("the root 'of' x")
- x: "*[1]"
- pause: short
- test:
Expand All @@ -156,23 +164,35 @@

- name: no-end-sub
tag: indexed-by
# invisible comma -- want "x 1 when subscript is an integer"
match: "count(*)=2 and (IsNode(*[2], 'leaf') or *[2][self::m:mrow][*[2][.='⁣']])"
match: "count(*)=2 and *[2][self::m:mrow and *[2][.='⁣']]"
replace:
- x: "*[1]"
- test:
if: "$Verbosity!='Terse' or not(*[2][self::m:mn])" # just say "x 1" for terse vs "x sub 1"
then: [T: "下標"] # phrase(x 'sub' 2)
- T: "下標" # phrase(x 'sub' 2)
- x: "*[2]"
- pause: short

- name: power-indexed-by
tag: power-indexed-by
match: "."
replace:
- x: "*[1]"
- T: "下標" # phrase(x 'sub' 2)
- x: "*[2]"
- pause: short

# otherwise let definitions/default infix handle it

- name: literal
tag: msub
match: "."
replace:
- x: "*[1]"
- T: "下標" # phrase(x 'sub' 2)
- test:
if: "not($Verbosity='Terse' and *[2][self::m:mn and not(translate(., '.,', '')!=.)])" # just say "x 1" for terse vs "x sub 1"
then: [T: "下標"] # phrase(x 'sub' 2)
- x: "*[2]"


- name: literal
tag: [msup, msubsup]
match: "."
Expand All @@ -192,12 +212,18 @@
- T: "上標" # phrase(x 'super' 2)
- x: "*[last()]"
- test:
if: "not(IsNode(*[last()], 'simple'))"
if: "not(IsNode(*[last()], 'simple')) or $Impairment = 'Blindness'"
then: [T: "結束上標"] # phrase(x super 2 'end of super')
else:
- T: "的" # phrase(5 'raised to the' second power equals 25)
- test:
if: "$Verbosity='Verbose'"
then: [T: "上標"]
else: [T: "上標"]
- x: "*[last()]"
- T: "次方" # phrase(5 raised to the second 'power' equals 25)
- test:
if: "$Verbosity='Verbose'"
then: [T: "結束上標"]
else: [T: "結束上標"]

- name: default
tag: munder
Expand All @@ -213,7 +239,7 @@

- name: diacriticals
tag: mover
match: "*[1][self::m:mi] and *[2][translate(., '\u0306\u030c.\u00A8\u02D9\u20DB\u20DC`^~→¯_', '')='']"
match: "*[1][self::m:mi] and *[2][translate(., '\u0306\u030c.\u00A8\u02D9\u20DB\u20DC`^ˇ~→¯_', '')='']"
replace:
- x: "*[1]"
- x: "*[2]"
Expand All @@ -224,11 +250,9 @@
replace:
- test:
if: "not(IsNode(*[1], 'leaf'))"
then: [T: ""] # phrase(phrase(x 'modified' with y above it)
then: [T: ""] # phrase(phrase(the 'quantity' x plus 1 with y above it)
- x: "*[1]"
- test:
if: "$Verbosity='Verbose'"
then: [T: "上層"]
- T: "上層" # phrase(x modified 'with' y above it)
- x: "*[2]"
- T: "" # phrase(x modified 'with' y above it)

Expand All @@ -238,11 +262,9 @@
replace:
- test:
if: "not(IsNode(*[1], 'leaf'))"
then: [T: ""] # phrase(the equation has been 'modified')
then: [T: ""] # phrase(the 'quantity' x plus 1 with y above it)
- x: "*[1]"
- test:
if: "$Verbosity='Verbose'"
then: [T: "下層"]
- T: "下層" # phrase(x modified 'with' y above it)
- x: "*[2]"
- T: "上層" # phrase(x modified with y 'below and' y above it)
- x: "*[3]"
Expand Down Expand Up @@ -415,7 +437,7 @@
- T: "與" # phrase(the table with 3 rows 'and' 4 columns)
- x: "$NumColumns"
- test:
if: "$NumColumns"
if: "NumColumns=1"
then: [T: "行"] # phrase(the table with 3 rows and 1 'column')
else: [T: "行"] # phrase(the table with 3 rows and 4 'columns')
- pause: long
Expand Down Expand Up @@ -607,7 +629,6 @@
- pause: auto
- x: "*[position() > 1]"


# Here are the intent hints that need to be handled: 'prefix' | 'infix' | 'postfix' | 'function' | 'silent'
- name: silent-intent
# uncaught intent -- the args have been inserted in the order of speech
Expand All @@ -620,6 +641,13 @@
then: [pause: short]
else: [pause: auto]

- name: nofix-intent
# uncaught intent -- the args have been inserted in the order of speech
tag: "*"
match: "contains(@data-intent-property, ':nofix:') "
replace:
- x: "SpeakIntentName(name(.), $Verbosity, 'nofix')"

- name: prefix-intent
# uncaught intent -- the args have been inserted in the order of speech
tag: "*"
Expand Down Expand Up @@ -679,7 +707,7 @@
replace:
- x: "SpeakIntentName(name(.), $Verbosity, 'function')"
- test:
if: "not(contains(@data-intent-property, ':literal:')) and
if: "$Verbosity != 'Terse' and not(contains(@data-intent-property, ':literal:')) and
not(count(*)=2 and (IsInDefinition(*[1], 'TrigFunctionNames') or IsInDefinition(name(.), 'TerseFunctionNames')) and IsNode(*[2], 'simple'))"
then: [T: "", pause: auto] # phrase(sine 'of' 5)
- insert:
Expand All @@ -690,6 +718,7 @@
then: [x: "','"]
- pause: auto
- test:
# speak "end ..." if not bracketed or last child is not simple and not last node
if: "$Impairment = 'Blindness' and not(*[last()][IsBracketed(., '', '') or IsNode(., 'simple')] )"
then: [x: "GetBracketingIntentName(name(.), $Verbosity, 'function', 'end')"]
- test:
Expand All @@ -698,7 +727,6 @@
else: [pause: auto]



- name: default-text
# unknown leaf -- just speak the text -- could be a literal intent
tag: "*"
Expand Down
Loading
Loading