diff --git a/Rules/Languages/zh/tw/SharedRules/default.yaml b/Rules/Languages/zh/tw/SharedRules/default.yaml
index 36c8e777b..d5b17cd1b 100644
--- a/Rules/Languages/zh/tw/SharedRules/default.yaml
+++ b/Rules/Languages/zh/tw/SharedRules/default.yaml
@@ -131,17 +131,17 @@
- test:
if: "$Verbosity!='Terse'"
then: [T: ""] # phrase("'the' root of x")
+ - T: "根指數" # phrase("the root of x 'with index' 5")
+ - x: "*[2]"
- T: "根號"
- - T: "開方次數" # phrase("the root of x 'with index' 5")
- - x: "*[1]"
- pause: short
- test:
if: "$Verbosity!='Terse'"
then: [T: ""] # phrase("the root 'of' x")
- - x: "*[2]"
+ - x: "*[1]"
- pause: short
- test:
- if: "not(IsNode(*[2],'leaf'))"
+ if: "not(IsNode(*[1],'leaf'))"
then: [T: "結束根號"] # phrase("root of x 'end root symbol'")
@@ -406,7 +406,7 @@
- NumColumns: "count(*[1]/*) - IfThenElse(*/self::m:mlabeledtr, 1, 0)"
match: "."
replace:
- - T: "表" # phrase(the 'table with' 3 rows)
+ - T: "表格有" # phrase(the 'table with' 3 rows)
- x: count(*)
- test:
if: count(*)=1
diff --git a/Rules/Languages/zh/tw/SharedRules/geometry.yaml b/Rules/Languages/zh/tw/SharedRules/geometry.yaml
index e4241c0f4..85a6c6ba4 100644
--- a/Rules/Languages/zh/tw/SharedRules/geometry.yaml
+++ b/Rules/Languages/zh/tw/SharedRules/geometry.yaml
@@ -23,12 +23,12 @@
- test:
if: "$Verbosity='Verbose'"
then:
- - T: "向量" # phrase('the ray from' A to B)
+ - T: "射線" # phrase('the ray from' A to B)
- x: "*[1]"
- T: "到" # phrase(the ray from A 'to' B)
- x: "*[2]"
else:
- - T: "向量" # phrase(the 'ray'A B)
+ - T: "射線" # phrase(the 'ray'A B)
- x: "*[1]"
- x: "*[2]"
diff --git a/Rules/Languages/zh/tw/SimpleSpeak_Rules.yaml b/Rules/Languages/zh/tw/SimpleSpeak_Rules.yaml
index 10a487480..7877cb2e3 100644
--- a/Rules/Languages/zh/tw/SimpleSpeak_Rules.yaml
+++ b/Rules/Languages/zh/tw/SimpleSpeak_Rules.yaml
@@ -36,7 +36,7 @@
tag: root
match: "."
replace:
- - T: "根號"
+ - T: ""
- x: "*[1]"
- test:
if: "$Verbosity!='Terse'"
diff --git a/Rules/Languages/zh/tw/definitions.yaml b/Rules/Languages/zh/tw/definitions.yaml
index 93460509a..280ec6039 100644
--- a/Rules/Languages/zh/tw/definitions.yaml
+++ b/Rules/Languages/zh/tw/definitions.yaml
@@ -48,28 +48,28 @@
}
- NavigationParts: {
- "large-op": "base; lower limit; upper limit",
- "mfrac": "numerator;denominator",
- "fraction": "numerator;denominator",
- "msqrt": "root",
- "square-root": "root",
- "mroot": "root;root index",
- "root": "root;root index",
- "msub": "base;subscript",
- "sub": "base;subscript",
- "msup": "base;superscript",
- "say-super": "base;superscript",
- "skip-super": "base;superscript",
- "power": "base;exponent",
- "msubsup": "base;subscript;superscript",
- "munder": "base;under limit",
- "mover": "base;upper limit",
- "munderover": "base;under limit;upper limit",
+ "large-op": "基底; 下限; 上限",
+ "mfrac": "分子;分母",
+ "fraction": "分子;分母",
+ "msqrt": "根號",
+ "square-root": "根號",
+ "mroot": "根號;根指數",
+ "root": "根號;根指數",
+ "msub": "基底;下標",
+ "sub": "基底;下標",
+ "msup": "基底;上標",
+ "say-super": "基底;上標",
+ "skip-super": "基底;上標",
+ "power": "基底;指數",
+ "msubsup": "基底;下標;上標",
+ "munder": "基底;下限",
+ "mover": "基底;上限",
+ "munderover": "基底;下限;上限",
# words for moving into and out of one of the parts (e.g., "move right 'out of' numerator, 'in' denominator")
# it's a hack to put them here, but at least they are grouped with the other navigation parts
- "in": "in",
- "out": "out of",
+ "in": "進入",
+ "out": "離開",
}
@@ -90,7 +90,7 @@
"g": "克",
"m": "米", # British spelling works for US also
"mol": "莫耳",
- "s": "秒", "″": "秒", "\"": "秒", "sec": "秒", # "sec" not actually legal
+ "s": "秒", "sec": "秒", # "sec" not actually legal
# derived units
"Bq": "貝克",
diff --git a/Rules/Languages/zh/tw/navigate.yaml b/Rules/Languages/zh/tw/navigate.yaml
index a41067957..0e94a5350 100644
--- a/Rules/Languages/zh/tw/navigate.yaml
+++ b/Rules/Languages/zh/tw/navigate.yaml
@@ -3,9 +3,9 @@
#
# The general form for many rules is:
# 1. Say the command if this is first rule to fire (MatchCounter) and depending upon "NavVerbosity"s value
+# This will increment MatchCounter so that the command won't be spoken again
# 2. Say info about moving into/out of 2D structures
# 3. Set some variables and possibly recurse.
-# If recursing, "MatchCounter" should be incremented.
# If stopping, "NavNode" should be set.
#
# The meaning of NavVerbosity:
@@ -33,119 +33,86 @@
# ReadZoomLevel -- -1 for Enhanced, otherwise the distance from leaf the rules should maintain
# PlaceMarkerIndex
+# Note: the rules for saying a command and announcing what is said when moving in/out of a 2d exprs are hacks
+# They depend upon special variables "SayCommand" and "Move2D" being set and if they are, the rules are activated.
+# If/when functions can be defined in a rules file, it is likely these would be much better done via those functions
+# as they would likely be much more efficient and also cleaner.
-# Rules for speaking what happens when moving into or out of a notation
-- name: into-or-out-of
- tag: mfrac
- match: "$Move2D != ''"
+# Rules for announcing the command
+- name: say-command
+ tag: "!*"
+ match: "$SayCommand != ''" # value should be '', 'true', or 'false'
+ variables: [Prefix: "''"]
replace:
- - x: "$Move2D"
- test:
- if: "count($Child2D/preceding-sibling::*)=0"
- then:
- test:
- if: "$Child2D/..[@linethickness='0']"
- then: [T: "全"] # phrase(the 'numerator' of a fraction)
- else: [T: "分子"]
- else:
- test:
- if: "$Child2D/..[@linethickness='0']"
- then: [T: "選"]
- else: [T: "分母"] # phrase(the 'denominator' of a fraction)
- - pause: "medium"
-
-- name: into-or-out-of
- tag: msqrt
- match: "$Move2D != ''"
- replace:
- - x: "$Move2D"
- - T: "平方根內" # phrase(the 'square root' of x)
- - pause: "medium"
-
-- name: into-or-out-of
- tag: mroot
- match: "$Move2D != ''"
- replace:
- - x: "$Move2D"
- - test:
- if: "count($Child2D/preceding-sibling::*)=0"
- then: [T: "根號內"] # phrase(the cube 'root' of x)
- else: [T: "開方次數"] # phrase(the 'root index' of x is 3)
- - pause: "medium"
-
-- name: into-or-out-of
- tag: msub
- match: "$Move2D != ''"
- replace:
- - x: "$Move2D"
- - test:
- if: "count($Child2D/preceding-sibling::*)=0"
- then: [T: "基本"] # phrase(the 'base' of the power)
- else: [T: "下標"] # phrase(x with 'subscript' 2)
- - pause: "medium"
-
-- name: into-or-out-of
- tag: msup
- match: "$Move2D != ''"
- replace:
- - x: "$Move2D"
- - test:
- if: "count($Child2D/preceding-sibling::*)=0"
- then: [T: "基本"] # phrase(the 'base' of the power)
- else: [T: "上標"] # phrase(x with 'superscript' 2) # FIX: it would be better to use the word used when reading (power, exponent, ...)
- - pause: "medium"
-
-- name: into-or-out-of
- tag: msubsup
- match: "$Move2D != ''"
- replace:
- - x: "$Move2D"
- - test:
- - if: "count($Child2D/preceding-sibling::*)=0"
- then: [T: "基本"] # phrase(the 'base' of the power)
- - else_if: "count($Child2D/preceding-sibling::*)=1"
- then: [T: "下標"] # phrase(x with 'subscript' 2)
- else: [T: "上標"] # phrase(x with 'superscript' 2) # FIX: it would be better to use the word used when reading (power, exponent, ...)
- - pause: "medium"
-
-- name: into-or-out-of
- tag: munder
- match: "$Move2D != ''"
- replace:
- - x: "$Move2D"
- - test:
- if: "count($Child2D/preceding-sibling::*)=0"
- then: [T: "基本"] # phrase(the 'base' of the power)
- else: [T: "下層"] # phrase(the 'lower limit' of the function is zero)
- - pause: "medium"
-
-- name: into-or-out-of
- tag: mover
- match: "$Move2D != ''"
- replace:
- - x: "$Move2D"
- - test:
- if: "count($Child2D/preceding-sibling::*)=0"
- then: [T: "基本"] # phrase(the 'base' of the power)
- else: [T: "上層"] # phrase(the 'upper limit' of the function is zero)
- - pause: "medium"
+ - if: "$MatchCounter = 0 and $SayCommand = 'true'"
+ then_test:
+ - if: "self::m:math and starts-with($NavCommand, 'ZoomOut')"
+ then: [T: "已完全縮小", pause: "medium"]
+ - else_if: "IsNode(., 'leaf') and starts-with($NavCommand, 'ZoomIn')"
+ then: [T: "已完全放大", pause: "medium"]
+ else:
+ - test:
+ - if: "starts-with($NavCommand, 'Zoom')"
+ then: [set_variables: [Prefix: "' '"]] # phrase('zoom' in to see more details) #hjy -- 'zoom' is a bit weird in Chinese, so skip it.
+ - else_if: "starts-with($NavCommand, 'Move')"
+ then: [set_variables: [Prefix: "'移到'"]] # phrase('move' to next entry in table)
+ - else_if: "starts-with($NavCommand, 'Read')"
+ then: [set_variables: [Prefix: "'讀出'"]] # phrase('read' to next entry in table)
+ - else_if: "starts-with($NavCommand, 'Describe')"
+ then: [set_variables: [Prefix: "'描述'"]] # phrase('describe' to next entry in table)
+ - test:
+ if: "$Prefix != ''"
+ then:
+ - x: "$Prefix"
+ - test:
+ - if: "substring($NavCommand, 5) = 'In'"
+ then: [T: "放大"] # phrase(zoom 'in' to see more details)
+ - else_if: "substring($NavCommand, 5) = 'InAll'"
+ # HACK: '\uF8FE' is used internally for the concatenation char by 'ct' -- this gets "ed" concatenated to "zoom"
+ then: [T: "完全放大"] # phrase(zoom 'out all the way' to see more details)
+ - else_if: "substring($NavCommand, 5) = 'Out'"
+ then: [T: "縮小"] # phrase(zoom 'out' to see more details)
+ - else_if: "substring($NavCommand, 5) = 'OutAll'"
+ # HACK: '\uF8FE' is used internally for the concatenation char by 'ct' -- this gets "ed" concatenated to "zoom"
+ then: [T: "完全縮小"] # phrase(zoom 'out all the way' to see more details)
+ - else_if: "substring($NavCommand, 5) = 'Next'" # string-length($Prefix)+1 ###fix by hjy
+ then: [T: "下一項"] # phrase(move to the 'right')
+ - else_if: "substring($NavCommand, 9) = 'Next'" # string-length($Prefix)+1 ###fix by hjy for describe
+ then: [T: "下一項"] # phrase(move to the 'right')
+ - else_if: "substring($NavCommand, 5) = 'Previous'" #string-length($Prefix)+1 ###fix by hjy
+ then: [T: "上一項"] # phrase(move to the 'left')
+ - else_if: "substring($NavCommand, 9) = 'Previous'" #string-length($Prefix)+1 ###fix by hjy for describe
+ then: [T: "上一項"] # phrase(move to the 'left')
+ - else_if: "substring($NavCommand, 5) = 'Current'"
+ then: [T: "目前"] # phrase(who is the 'current' president)
+ - else_if: "substring($NavCommand, 9) = 'Current'"
+ then: [T: "目前"] # phrase(who is the 'current' president)
+ - else_if: "substring($NavCommand, 5) = 'LineStart'"
+ then: [T: "到行首"] # phrase(move 'to start of line')
+ - else_if: "substring($NavCommand, 5) = 'LineEnd'"
+ then: [T: "到行尾"] # phrase(move 'to end of line')
+ - pause: "medium"
+ - set_variables: [MatchCounter: "$MatchCounter + 1"]
+
+- name: into-or-out-of-silent
+ tag: "*"
+ # saying "out of row n" is not very useful, so skip it
+ match: "$Move2D != '' and (not(@data-from-mathml) or @data-from-mathml = name(.)) and
+ (name(.)='mrow' or name(.) = 'mtr' or name(.) = 'mlabeledtr' or @data-from-mathml = 'mtable')"
+ replace: []
-- name: into-or-out-of
- tag: munderover
- match: "$Move2D != ''"
+- name: into-or-out-of-mtr
+ tag: [mtr, mlabeledtr]
+ match: "$Move2D = '進入'"
replace:
- - x: "$Move2D"
- - test:
- - if: "count($Child2D/preceding-sibling::*)=0"
- then: [T: "基本"] # phrase(the 'base' of the power)
- - else_if: "count($Child2D/preceding-sibling::*)=1"
- then: [T: "下層"] # phrase(the 'lower limit' of the function is zero)
- else: [T: "上層"] # phrase(the 'upper limit' of the function is zero)
+ - T: "行"
+ - x: "count($Child2D/preceding-sibling::*)+1"
- pause: "medium"
-- name: into-or-out-of
- tag: mmultiscripts
- match: "$Move2D != ''"
+- name: into-or-out-of-mmultiscripts
+ tag: "*"
+ match: "$Move2D != '' and (@data-from-mathml='mmultiscripts' or self::m:mmultiscripts)"
replace:
- test:
if: "name($Child2D)!='none'"
@@ -157,36 +124,45 @@
- x: "$Move2D"
- test:
- if: "$NumPrecedingSiblings=0"
- then: [T: "基本"] # phrase(the 'base' of the power)
+ then: [T: "基底"] # phrase(the 'base' of the power)
- else_if: "$Child2D/preceding-sibling::*[self::m:mprescripts]" # are we before mprescripts and hence are postscripts
then:
- test: # in postscripts -- base shifts by one
- if: "$NumPrecedingSiblings mod 2 = 0"
- then: [T: "下標"] # phrase(x with 'subscript' 2)
- else: [T: "上標"] # phrase(x with 'superscript' 2)
+ if: "$NumPrecedingSiblings mod 2 = 0"
+ then: [T: "前下標"] # phrase(x with 'subscript' 2)
+ else: [T: "前上標"] # phrase(x with 'superscript' 2)
else:
- test:
if: "$NumPrecedingSiblings mod 2 = 0"
- then: [T: "上標"] # phrase(x with 'superscript' 2)
- else: [T: "下標"] # phrase(x with 'subscript' 2)
+ then: [T: "上標"] # phrase(x with 'pre-superscript' 2)
+ else: [T: "下標"] # phrase(x with 'pre-subscript' 2)
- pause: "medium"
-- name: into-or-out-of
- tag: mtd
- match: "$Move2D = '進入'"
- replace:
- - x: "$Move2D"
- - T: "行" # phrase(the first 'column' in the table)
- - x: "count($Child2D/preceding-sibling::*)+1"
- - pause: "medium"
-
-- name: into-or-out-of
- tag: [mtr, mlabeledtr]
- match: "$Move2D = '進入'"
+# Rules for speaking what happens when moving into or out of a notation
+- name: into-or-out-of-default
+ tag: "*"
+ # saying "out of row n" is not very useful, so skip it
+ # match: "$Move2D != '' and @data-from-mathml and @data-from-mathml != name(.) and count(*)>1 and @data-from-mathml != 'mtable'"
+ match: "$Move2D != '' and not(self::m:math or @data-from-mathml = 'mtable' or @data-from-mathml = 'mtd') "
replace:
- - x: "$Move2D"
- - x: "count($Child2D/preceding-sibling::*)+1"
- - pause: "medium"
+ - with:
+ variables:
+ - PartNumber: "count($Child2D/preceding-sibling::*)"
+ - PartName: "GetNavigationPartName(name(.), $PartNumber)"
+ replace:
+ - x: "$Move2D"
+ - test:
+ - if: "$PartName != ''"
+ then: [x: "$PartName"]
+ - else_if: "count(*) = 1"
+ then_test:
+ if: "$NavVerbosity = 'Verbose'"
+ then: [x: "translate(name(.), '-_', ' ')"] # e.g., "in absolute value"
+ else:
+ - T: "第" # phrase(the 'part' of the expression)
+ - x: "count($Child2D/preceding-sibling::*) + 1"
+ - T: "部分" # phrase(the 'part' of the expression)
+ - pause: "medium"
- name: default-move
# nothing to do (not 2D) -- need to catch $Move2D though so rules based on NavCommand don't trigger
@@ -207,20 +183,20 @@
then:
- test:
- if: "$PreviousNavCommand = 'ZoomIn'"
- then: [T: "撤消放大"] # phrase('undo zoom in')
+ then: [T: "復原放大"] # phrase('undo zoom in')
- else_if: "$PreviousNavCommand = 'ZoomOut'"
- then: [T: "撤消縮小"] # phrase('undo zoom out')
+ then: [T: "復原縮小"] # phrase('undo zoom out')
- else_if: "$PreviousNavCommand = 'ZoomInAll'"
- then: [T: "一路撤消放大"] # phrase('undo zooming in all the way')
+ then: [T: "復原完全放大"] # phrase('undo zooming in all the way')
- else_if: "$PreviousNavCommand = 'ZoomOutAll'"
- then: [T: "一路撤消縮小"] # phrase('undo zooming out all the way')
+ then: [T: "復原完全縮小"] # phrase('undo zooming out all the way')
- else_if: "$PreviousNavCommand = 'MovePrevious' or $PreviousNavCommand = 'MovePreviousZoom'"
- then: [T: "撤消向左移動"] # phrase('undo move left')
+ then: [T: "復原移到上一項"] # phrase('undo move left')
- else_if: "$PreviousNavCommand = 'MoveNext' or $PreviousNavCommand = 'MoveNextZoom'"
- then: [T: "撤消向右移動"] # phrase('undo move right')
+ then: [T: "復原移到下一項"] # phrase('undo move right')
- else_if: "$PreviousNavCommand = 'None'"
- then: [T: "沒有以前的命令"] # phrase('no previous command')
- - pause: "long"
+ then: [T: "沒有前一指令"] # phrase('no previous command')
+ - pause: "medium"
- set_variables: [NavNode: "@id"]
# many times, for typographic reasons, people include punctuation at the end of a math expr
@@ -242,40 +218,32 @@
replace:
- test:
if: "$MatchCounter = 0 and $NavVerbosity != 'Terse'"
- then: [T: "一路放大", pause: "long"] # phrase('zoomed in all of the way')
+ then: [T: "已完全放大", pause: "long"] # phrase('zoomed in all of the way')
- test:
if: "$ReadZoomLevel!=-1"
then:
- set_variables: [ReadZoomLevel: "0"]
- set_variables: [NavNode: "@id"]
-# special case of zooming into a matrix or determinant -- move to the first row
-- name: zoom-in-matrix
-
- tag: mrow
- match:
- - "$NavCommand = 'ZoomIn' and count(*)=3 and "
- - "*[2][self::m:mtable and (IsBracketed(., '(', ')') or IsBracketed(., '[', ']') or IsBracketed(., '|', '|'))]"
- replace:
- - test:
- if: "$MatchCounter = 0 and $NavVerbosity = 'Verbose'"
- then: [T: "放大", pause: "long"] # phrase('zoom in')
- - set_variables: [NavNode: "*[2]/*[1]/@id"]
-
-# special case of zooming into a table -- move to the first row
+# special case of zooming into a table -- move to the first row (if only one row, first column)
- name: zoom-in-table
- tag: mtable
- match: "$NavCommand = 'ZoomIn'"
+ tag: "*"
+ match: "$NavCommand = 'ZoomIn' and (name(.) = 'mtable' or (count(*)=1 and *[1][@data-from-mathml='mtable']))"
replace:
+ - with:
+ variables: [SayCommand: "string($NavVerbosity = 'Verbose')"]
+ replace: [x: "."]
- test:
- if: "$MatchCounter = 0 and $NavVerbosity = 'Verbose'"
- then: [T: "放大", pause: "long"] # phrase('zoom in')
- - set_variables: [NavNode: "*[1]/@id"]
+ if: "count(*)=1"
+ then:
+ - set_variables: [NavNode: "*[1]/*[1]/@id"]
+ else:
+ - set_variables: [NavNode: "*[1]/@id"]
- name: zoom-in-mrow-in-math
- # Moving to first or last is meaningless the 'math' has only an 'mrow' inside -- dig inside and do it again
+ # zooming in only once is meaningless because 'math' has only a single child and it was spoken at the math level -- dig inside and do it again
tag: math
- match: "count(*)=1 and ($NavCommand = 'ZoomIn' or $NavCommand = 'MoveNextZoom' or $NavCommand = 'MovePreviousZoom')"
+ match: "$NavCommand = 'ZoomIn' or $NavCommand = 'MoveNextZoom' or $NavCommand = 'MovePreviousZoom'"
replace:
- test:
if: "$NavCommand = 'MovePreviousZoom'"
@@ -289,117 +257,119 @@
match:
- "($NavCommand = 'ZoomIn' or "
- " ($NavCommand = 'MoveNextZoom' or $NavCommand = 'MovePreviousZoom') and $NavMode='Enhanced') and "
- - "count(*)=1 and (*[1][self::m:mrow] and not(self::m:msqrt or self::m:menclose))"
+ - "count(*)=1 and
+ (*[1][self::m:mrow or @data-from-mathml='mrow'] and
+ not(@data-from-mathml='msqrt' or self::m:msqrt or @data-from-mathml='menclose' or self::m:menclose))"
replace:
- - test:
- if: "$MatchCounter = 0 and $NavVerbosity = 'Verbose'"
- then: [T: "放大", pause: "long"] # phrase('zoom in')
- with:
- variables: [MatchCounter: "$MatchCounter + 1"]
- replace:
- - test:
- if: "$NavCommand = 'MovePreviousZoom'"
- then: [x: "*[last()]"]
- else: [x: "*[1]"]
+ variables: [SayCommand: "string($NavVerbosity = 'Verbose')"]
+ replace: [x: "."]
+ - test:
+ if: "name(*[1]) != 'mrow'"
+ then:
+ - with:
+ variables: [Move2D: "'進入'", Child2D: "IfThenElse(count(*)=0, $Move2D, $Move2D)"] # phrase('in' the denominator)
+ replace: [x: "IfThenElse($NavCommand = 'MovePreviousZoom', 1, $Child2D)"]
+ - test:
+ if: "$NavCommand = 'MovePreviousZoom'"
+ then: [x: "*[last()]"]
+ else: [x: "*[1]"]
- name: zoom-in-enhanced
-
tag: "*"
match: "$NavCommand = 'ZoomIn' and $NavMode='Enhanced'"
replace:
- - test:
- if: "$MatchCounter = 0 and $NavVerbosity = 'Verbose'"
- then: [T: "放大", pause: "long"] # phrase('zoom in')
+ - with:
+ variables: [SayCommand: "string($NavVerbosity = 'Verbose')"]
+ replace: [x: "."]
- test:
- if: "self::m:mtr or self::m:mlabeledtr"
then:
- with:
- variables: [Move2D: "'在'", Child2D: "*[1]/*[1]"] # phrase('in' the denominator)
+ variables: [Move2D: "'進入'", Child2D: "*[1]/*[1]"] # phrase('in' the denominator)
replace: [x: "."]
- set_variables: [NavNode: "*[1]/*[1]/@id"] # skip mtd
- - else_if: "*[1][self::m:mrow and IsBracketed(., '(', ')', false) or IsBracketed(., '[', ']', false)]" # auto zoom
+ - else_if: "*[1][self::m:mrow and (IsBracketed(., '(', ')', false) or IsBracketed(., '[', ']', false))]" # auto zoom
then:
- with:
- variables: [Move2D: "'在'", Child2D: "*[1]"] # phrase('in' the denominator)
+ variables: [Move2D: "'進入'", Child2D: "*[1]"] # phrase('in' the denominator)
replace: [x: "."]
- set_variables: [NavNode: "*[1]/*[2]/@id"] # skip parens/brackets
else:
- with:
- variables: [Move2D: "'在'", Child2D: "*[1]"] # phrase('in' the denominator)
+ variables: [Move2D: "'進入'", Child2D: "*[1]"] # phrase('in' the denominator)
replace: [x: "."]
- set_variables: [NavNode: "*[1]/@id"]
-- name: zoom-in-2D-not-enhanced
+
+- name: zoom-in-simple
tag: "*"
- match: "$NavCommand = 'ZoomIn' and $NavMode!='Enhanced' and IsNode(., '2D')"
+ match: "$NavCommand = 'ZoomIn' and $NavMode='Simple'"
replace:
- - test:
- if: "$MatchCounter = 0 and $NavVerbosity = 'Verbose'"
- then: [T: "放大", pause: "long"] # phrase('zoom in')
- with:
- variables: [Move2D: "'在'", Child2D: "*[1]"] # phrase('in' the denominator)
+ variables: [SayCommand: "string($NavVerbosity = 'Verbose')"]
replace: [x: "."]
- - with:
- variables: [MatchCounter: "$MatchCounter + 1", NavCommand: "'MoveNextZoom'"]
- replace: [x: "*[1]"]
+ - test:
+ if: "DEBUG($MatchCounter) > 1 and IsNode(., '2D') "
+ then: [set_variables: [NavNode: "@id"]] # time to stop, not going "in" to next thing, so before "Move2D"
+ else:
+ - with:
+ variables: [Move2D: "'進入'", Child2D: "*[1]"] # phrase('in' the denominator)
+ replace: [x: "."]
+ - x: "*[1]"
-- name: zoom-in-default
+ # At this point, we are zooming in on a non-2D element, non-leaf in Character mode
+- name: zoom-in-2D-character
tag: "*"
- match: "$NavCommand = 'ZoomIn'"
+ match: "$NavCommand = 'ZoomIn' and (IsNode(., '2D') or not(IsNode(., 'mathml')))"
replace:
- - test:
- if: "$MatchCounter = 0 and $NavVerbosity = 'Verbose'"
- then: [T: "放大", pause: "long"] # phrase('zoom in')
- with:
- variables: [Move2D: "'在'", Child2D: "*[1]"] # phrase('in' the denominator)
+ variables: [SayCommand: "string($NavVerbosity = 'Verbose')"]
+ replace: [x: "."]
+ - with:
+ variables: [Move2D: "'進入'", Child2D: "*[1]"] # phrase('in' the denominator)
replace: [x: "."]
- test:
- if: "$NavMode='Character'"
+ if: "$NavMode = 'Simple'"
then:
+ - set_variables: [NavNode: "*[1]/@id"]
+ else:
- with:
- variables: [MatchCounter: "$MatchCounter + 1"]
+ variables: [NavCommand: "'MoveNextZoom'"]
replace: [x: "*[1]"]
- else_test:
- if: "self::m:mtd"
- then: [x: "*[1]"]
- else:
- - test:
- if: "$ReadZoomLevel!=-1"
- then:
- - set_variables: [ReadZoomLevel: "DistanceFromLeaf(*[1], true, $NavMode!='Character')"]
- - set_variables: [NavNode: "*[1]/@id"]
+
+ # At this point, we are zooming in on a non-2D element, non-leaf in Character mode
+- name: zoom-in-default
+ tag: "*"
+ match: "$NavCommand = 'ZoomIn'"
+ replace:
+ - with:
+ variables: [SayCommand: "string($NavVerbosity = 'Verbose')"]
+ replace: [x: "."]
+ - x: "*[1]"
+
- name: zoom-in-all-default
tag: "*"
match: "$NavCommand = 'ZoomInAll'"
replace:
- - test:
- if: "$MatchCounter = 0 and $NavVerbosity = 'Verbose'"
- then: [T: "一路放大", pause: "medium"] # phrase('zoom in all the way')
- with:
- variables: [Move2D: "'在'", Child2D: "*[1]"] # phrase('in' the denominator)
+ variables: [SayCommand: "string($NavVerbosity = 'Verbose')"]
replace: [x: "."]
- with:
- variables: [MatchCounter: "$MatchCounter + 1"]
- replace: [x: "*[1]"]
+ variables: [Move2D: "'進入'", Child2D: "*[1]"] # phrase('in' the denominator)
+ replace: [x: "."]
+ - x: "*[1]"
- name: zoom-out
tag: math
match: "$NavCommand = 'ZoomOut' or $NavCommand = 'ZoomOutAll'"
replace:
- - test:
- if: "$MatchCounter = 0 and $NavVerbosity != 'Terse'"
- then: [T: "一路縮小", pause: "long"] # phrase('zoomed out all the the way')
+ - with:
+ variables: [SayCommand: "string($NavVerbosity = 'Verbose')"]
+ replace: [x: "."]
- set_variables: [NavNode: "*[1]/@id"] # no-op for $NavCommand = 'ZoomOut'
-- name: zoom-out-top
- tag: "*"
- match:
- - "($NavCommand = 'ZoomOut' or $NavCommand = 'ZoomOutAll') and"
- - "parent::m:math "
- replace:
- - x: ".." # let math rule deal with it
-
- name: skip-punct-at-end-zoom-out
tag: mrow
match:
@@ -409,19 +379,25 @@
replace:
- x: ".."
+- name: zoom-out-top
+ tag: "*"
+ match:
+ - "($NavCommand = 'ZoomOut' or $NavCommand = 'ZoomOutAll') and"
+ - "parent::m:math "
+ replace:
+ - x: ".." # let math rule deal with it
+
- name: zoom-out-all-default
tag: "*"
match: "$NavCommand = 'ZoomOutAll'"
replace:
- - test:
- if: "$MatchCounter = 0 and $NavVerbosity != 'Terse'"
- then: [T: "一路縮小", pause: "medium"] # phrase('zoomed out all the the way')
- with:
- variables: [Move2D: "'離開'", Child2D: "."]
- replace: [x: ".."]
+ variables: [SayCommand: "string($NavVerbosity = 'Verbose')"]
+ replace: [x: "."]
- with:
- variables: [MatchCounter: "$MatchCounter + 1"]
+ variables: [Move2D: "'離開'", Child2D: "."]
replace: [x: ".."]
+ - x: ".."
# deal with internal zooming: MoveNextZoom and MovePreviousZoom
@@ -432,12 +408,12 @@
- "($NavCommand = 'MoveNextZoom' or $NavCommand = 'MovePreviousZoom') and "
- "$NavMode = 'Enhanced'"
replace:
- # don't bother with MatchCounter since we only get here if > 1
- with:
- variables: [Move2D: "'在'", Child2D: "*[1]"] # phrase('in' the denominator)
+ variables: [Move2D: "'進入'", Child2D: "*[1]"] # phrase('in' the denominator)
replace: [x: "."]
- test:
- - if: "count(*)> 1 or IsNode(., 'leaf') or self::m:msqrt or self::m:menclose"
+ - if: "count(*)> 1 or IsNode(., 'leaf') or
+ @data-from-mathml='msqrt' or self::m:msqrt or @data-from-mathml='menclose' or self::m:menclose"
then: [set_variables: [NavNode: "@id"]]
else: [x: "*[1]"]
@@ -448,7 +424,7 @@
replace:
#don't bother with MatchCounter since we only get here if > 1
- test:
- if: "$ReadZoomLevel >= DistanceFromLeaf(., false, $NavMode!='Character')"
+ if: "IsNode(., 'leaf') or $ReadZoomLevel >= DistanceFromLeaf(., false, $NavMode!='Character')"
then:
# - with:
# variables: [Move2D: "'in'", Child2D: "following-sibling::*[1]"] # phrase('in' the denominator)
@@ -456,7 +432,7 @@
- set_variables: [NavNode: "@id"]
else:
- with:
- variables: [Move2D: "'在'", Child2D: "*[1]"] # phrase('in' the denominator)
+ variables: [Move2D: "'進入'", Child2D: "*[1]"] # phrase('in' the denominator)
replace: [x: "."]
- x: "*[1]"
@@ -475,7 +451,7 @@
- set_variables: [NavNode: "@id"]
else:
- with:
- variables: [Move2D: "'在'", Child2D: "*[last()]"] # phrase('in' the denominator)
+ variables: [Move2D: "'進入'", Child2D: "*[last()]"] # phrase('in' the denominator)
replace: [x: "."]
- x: "*[last()]"
@@ -486,14 +462,14 @@
tag: mtd
match: "$Move2D = '' and ($NavCommand = 'ZoomOut')"
replace:
- - test:
- if: "$MatchCounter = 0 and $NavVerbosity = 'Verbose'"
- then: [T: "縮小", pause: "medium"] # phrase('zoom out' of expression)
+ - with:
+ variables: [SayCommand: "string($NavVerbosity = 'Verbose')"]
+ replace: [x: "."]
# we need to speak it here
- - T: "列" # phrase(the first 'row' of the matrix)
- # if we let the speech rules speak the row, it is given just the MathML for the row, so the row # will always be '1'
- - x: "count(../preceding-sibling::*)+1"
- - pause: medium
+ # - t: "row" # phrase(the first 'row' of the matrix)
+ # # if we let the speech rules speak the row, it is given just the MathML for the row, so the row # will always be '1'
+ # - x: "count(../preceding-sibling::*)+1"
+ # - pause: medium
- set_variables: [NavNode: "../@id"]
- name: zoom-out
@@ -502,26 +478,23 @@
match: "$NavCommand = 'ZoomOut'"
replace:
- with:
- variables: [MatchCounter: "$MatchCounter + 1"]
- replace:
- - test:
- if: "$MatchCounter = 1 and $NavVerbosity = 'Verbose'"
- then: [T: "縮小", pause: "medium"] # phrase('zoom out' of the expression)
+ variables: [SayCommand: "string($NavVerbosity = 'Verbose')"]
+ replace: [x: "."]
+ - test:
+ if: "$NavMode='Enhanced' and parent::*[self::m:mrow and (IsBracketed(., '(', ')', false) or IsBracketed(., '[', ']', false))]"
+ then: [x: ".."] # auto-zoom: move out a level and retry
+ else:
+ - with:
+ variables: [Move2D: "'離開'", Child2D: "."]
+ replace: [x: ".."]
- test:
- if: "$NavMode='Enhanced' and parent::*[self::m:mrow and IsBracketed(., '(', ')', false) or IsBracketed(., '[', ']', false)]"
- then: [x: ".."] # auto-zoom: move out a level and retry
+ if: "parent::m:mtd"
+ then: [x: ".."]
else:
- - with:
- variables: [Move2D: "'離開'", Child2D: "."]
- replace: [x: ".."]
- test:
- if: "parent::m:mtd"
- then: [x: ".."]
- else:
- - test:
- if: "$ReadZoomLevel!=-1"
- then: [set_variables: [ReadZoomLevel: "DistanceFromLeaf(.., true, $NavMode!='Character')"]]
- - set_variables: [NavNode: "../@id"]
+ if: "$ReadZoomLevel!=-1"
+ then: [set_variables: [ReadZoomLevel: "DistanceFromLeaf(.., true, $NavMode!='Character')"]]
+ - set_variables: [NavNode: "../@id"]
# ********* MoveStart/End ***************
- name: math-move-to-start-or-end
@@ -536,42 +509,56 @@
then:
- test:
- if: "$NavCommand = 'MoveStart'"
- then: [T: "移至數學開頭"] # phrase('move to start of math')
+ then: [T: "移到數學開頭"] # phrase('move to start of math')
- else_if: "$NavCommand = 'MoveLineStart'"
- then: [T: "移至列頭"] # phrase('move to start of line')
+ then: [T: "移到行首"] # phrase('move to start of line')
- else_if: "$NavCommand = 'MoveEnd'"
- then: [T: "移至數學結束"] # phrase('move to end of math')
- else: [T: "移至列尾"] # "$NavCommand = 'MoveLineEnd'" # phrase('move to end of line')
+ then: [T: "移到數學結尾"] # phrase('move to end of math')
+ else: [T: "移到行尾"] # "$NavCommand = 'MoveLineEnd'" # phrase('move to end of line')
- pause: "medium"
- test:
if: "$NavCommand = 'MoveStart' or $NavCommand = 'MoveLineStart'"
then:
# move inside of the mrow inside of 'math' or inside the fraction, etc (hence two levels down)
+ # Note: an apparent bug in the xpath code doesn't let me use IfThenElse for the 2 if: then: below
- with:
variables: [NavCommand: "'MoveNextZoom'"]
- replace: [x: "*[1]/*[1]"]
+ replace:
+ - test:
+ if: "*[1]/*[1]" # could be a , so no grandchild
+ then: [x: "*[1]/*[1]"]
+ else: [x: "*[1]"]
else:
- with:
variables: [NavCommand: "'MovePreviousZoom'"]
- replace: [x: "*[last()]/*[last()]"]
+ replace:
+ - test:
+ if: "*[last()]/*[last()]" # could be a , so no grandchild
+ then: [x: "*[last()]/*[last()]"]
+ else: [x: "*[last()]"]
# We stop when the parent is 2d (e.g., frac), but not if in leaf base of msub/msup/msubsup/mmultiscripts because that's really on the same line
- name: move-to-start-or-end-2d
tag: "*"
match:
- "($NavCommand = 'MoveLineStart' or $NavCommand = 'MoveLineEnd') and IsNode(.., '2D') and"
- - "not( IsNode(., 'leaf') and (parent::m:msub or parent::m:msup or parent::m:msubsup or parent::m:mmultiscripts) )"
+ - "not( IsNode(., 'leaf') and"
+ - " parent::*[1][self::m:msub or self::m:msup or self::m:msubsup or self::m:mmultiscripts or"
+ - " @data-from-mathml and"
+ - " (@data-from-mathml='msub' or @data-from-mathml='msup' or"
+ - " @data-from-mathml='msubsup' or @data-from-mathml='mmultiscripts')"
+ - " ] )"
replace:
- test:
if: "$NavVerbosity = 'Verbose'"
then:
- test:
if: "$NavCommand = 'MoveLineStart'"
- then: [T: "移至列頭"] # phrase('move to start of line')
- else: [T: "移至列尾"] # "$NavCommand = 'MoveLineEnd'" # phrase('move to end of line')
+ then: [T: "移到行首"] # phrase('move to start of line')
+ else: [T: "移到行尾"] # "$NavCommand = 'MoveLineEnd'" # phrase('move to end of line')
- pause: "medium"
- test:
- if: "self::m:mrow"
+ if: "self::m:mrow or @data-from-mathml = 'mrow'"
then_test:
if: "$NavCommand = 'MoveLineStart'"
then:
@@ -604,7 +591,7 @@
- "$NavCommand='MoveColumnStart' or $NavCommand='MoveColumnEnd' or"
- "$NavCommand='ReadCellCurrent'"
replace:
- - T: "不在表中" # phrase('not in table')
+ - T: "不在表格內" # phrase('not in table')
- pause: long
- set_variables: [SpeakExpression: "'false'"]
@@ -618,7 +605,7 @@
- test:
if: "$NavVerbosity = 'Verbose'"
then:
- - T: "向左移" # phrase('move left')
+ - T: "移到上一項" # phrase('move left')
- pause: short
- test:
if: "$NavVerbosity != 'Terse'"
@@ -635,7 +622,7 @@
else:
- set_variables: [NavNode: "preceding-sibling::*[1]/*[1]/@id"]
else:
- - T: "沒有前一行" # phrase('no previous column' in the table)
+ - T: "沒有左一行" # phrase('no previous column' in the table)
- set_variables: [SpeakExpression: "'false'"]
- name: move-cell-next
@@ -648,7 +635,7 @@
- test:
if: "$NavVerbosity = 'Verbose'"
then:
- - T: "向右移" # phrase('move right')
+ - T: "移到下一項" # phrase('move right')
- pause: short
- test:
if: "$NavVerbosity != 'Terse'"
@@ -665,7 +652,7 @@
else:
- set_variables: [NavNode: "following-sibling::*[1]/*[1]/@id"]
else:
- - T: "沒有下一行" # phrase('no next column' in the table)
+ - T: "沒有右一行" # phrase('no next column' in the table)
- set_variables: [SpeakExpression: "'false'"]
- name: move-cell-up
@@ -681,7 +668,7 @@
- test:
if: "$NavVerbosity = 'Verbose'"
then:
- - T: "向上移動" # phrase('move up' to previous row in the table)
+ - T: "往上一格" # phrase('move up' to previous row in the table)
- pause: short
- test:
if: "$NavVerbosity != 'Terse'"
@@ -701,7 +688,7 @@
else:
- set_variables: [NavNode: "../preceding-sibling::*[1]/*[$Column]/*[1]/@id"]
else:
- - T: "沒有前一列" # phrase('no previous row' in the table)
+ - T: "沒有上一列" # phrase('no previous row' in the table)
- set_variables: [SpeakExpression: "'false'"]
- name: move-cell-down
@@ -717,7 +704,7 @@
- test:
if: "$NavVerbosity = 'Verbose'"
then:
- - T: "向下移動" # phrase('move down to the next row in the table)
+ - T: "往下一格" # phrase('move down to the next row in the table)
- pause: short
- test:
if: "$NavVerbosity != 'Terse'"
@@ -744,20 +731,14 @@
tag: [mtr, mlabeledtr]
match: "$NavCommand='MoveCellUp'"
replace:
+ - test:
+ if: "$NavVerbosity = 'Verbose'"
+ then:
+ - T: "移到上一列" # phrase('move to previous row' to the previous row in the table)
+ - pause: medium
- test:
if: "preceding-sibling::*"
then:
- - test:
- if: "$NavVerbosity = 'Verbose'"
- then:
- - T: "向上移動" # phrase('move up' to the previous row in the table)
- - pause: medium
- - test:
- if: "$NavVerbosity != 'Terse'"
- then:
- - T: "列" # phrase(the previous 'row' in the table)
- - x: "count(preceding-sibling::*)"
- - pause: medium
- test:
if: "$NavMode='Character'"
then:
@@ -767,27 +748,21 @@
else:
- set_variables: [NavNode: "preceding-sibling::*[1]/@id"]
else:
- - T: "沒有前一列" # phrase('no previous row' in the table)
+ - T: "沒有上一列" # phrase('no previous row' in the table)
- set_variables: [SpeakExpression: "'false'"]
- name: move-cell-down
tag: [mtr, mlabeledtr]
match: "$NavCommand='MoveCellDown'"
replace:
+ - test:
+ if: "$NavVerbosity = 'Verbose'"
+ then:
+ - T: "移到下一列" # phrase('move to next row' to the next row in the table)
+ - pause: medium
- test:
if: "following-sibling::*"
then:
- - test:
- if: "$NavVerbosity = 'Verbose'"
- then:
- - T: "向下移動" # phrase('move down' to the next row in the table)
- - pause: medium
- - test:
- if: "$NavVerbosity != 'Terse'"
- then:
- - T: "列" # phrase(the previous 'row' in the table)
- - x: "count(preceding-sibling::*)+2"
- - pause: medium
- test:
if: "$NavMode='Character'"
then:
@@ -800,6 +775,32 @@
- T: "沒有下一列" # phrase('no next row' in the table)
- set_variables: [SpeakExpression: "'false'"]
+- name: move-cell-previous
+ # if a row is selected, there is no previous/next column, so this is trivial
+ tag: [mtr, mlabeledtr]
+ match: "$NavCommand='MoveCellPrevious'"
+ replace:
+ - test:
+ if: "$NavVerbosity = 'Verbose'"
+ then:
+ - T: "移到左一行" # phrase('move to previous column' to the previous row in the table)
+ - pause: medium
+ - T: "沒有左一行" # phrase('no previous column' in the table)
+ - set_variables: [SpeakExpression: "'false'"]
+
+- name: move-cell-next
+ # if a row is selected, there is no previous/next column, so this is trivial
+ tag: [mtr, mlabeledtr]
+ match: "$NavCommand='MoveCellNext'"
+ replace:
+ - test:
+ if: "$NavVerbosity = 'Verbose'"
+ then:
+ - T: "移到右一行" # phrase('move to next column' to the next row in the table)
+ - pause: medium
+ - T: "沒有右一行" # phrase('no next column' in the table)
+ - set_variables: [SpeakExpression: "'false'"]
+
- name: default-read-cell
tag: "*"
match: "$NavCommand='ReadCellCurrent'"
@@ -813,19 +814,20 @@
- test:
if: "$NavVerbosity = 'Verbose'"
then:
- - T: "閱讀當前項目" # phrase('read current entry' in the table)
+ - T: "讀出目前項目" # phrase('read current entry' in the table)
- pause: medium
- test:
if: "$NavVerbosity != 'Terse'"
then:
- T: "列" # phrase(the previous 'row' in the table)
- x: "count($MTD[1]/../preceding-sibling::*)+1"
+ - pause: short
- T: "行" # phrase(the previous 'column' in the table)
- x: "count($MTD[1]/preceding-sibling::*)+1"
- pause: short
- set_variables: [NavNode: "$MTD[1]/*[1]/@id"]
else:
- - T: "不在表中" # phrase('not in table' or matrix)
+ - T: "不在表格內" # phrase('not in table' or matrix)
- pause: long
- set_variables: [SpeakExpression: "'false'"]
@@ -1065,7 +1067,7 @@
then:
- x: "ancestor::m:mtd[1]" # try again on an mtd node
else:
- - T: "不在表中" # phrase('not in table' or matrix)
+ - T: "不在表格內" # phrase('not in table' or matrix)
- pause: long
- set_variables: [SpeakExpression: "'false'"]
@@ -1087,7 +1089,7 @@
then: [x: "$Following"]
else:
- with:
- variables: [Move2D: "'在'", Child2D: "$Following"] # phrase('in' the denominator)
+ variables: [Move2D: "'進入'", Child2D: "$Following"] # phrase('in' the denominator)
replace: [x: ".."]
- with:
variables: [NavCommand: "'MoveNextZoom'"]
@@ -1109,7 +1111,7 @@
then: [x: "$Preceding"]
else:
- with:
- variables: [Move2D: "'在'", Child2D: "$Preceding"] # phrase('in' the denominator)
+ variables: [Move2D: "'進入'", Child2D: "$Preceding"] # phrase('in' the denominator)
replace: [x: ".."]
- with:
variables: [NavCommand: "'MovePreviousZoom'"]
@@ -1124,24 +1126,14 @@
- "($NavCommand = 'MoveNext' or $NavCommand = 'ReadNext' or $NavCommand = 'DescribeNext') and"
- "following-sibling::*[1][name(.)='mo' and translate(., '\u2061\u2062\u2063\u2064', '')='']"
replace:
- - test:
- if: "$MatchCounter = 0 and $NavVerbosity = 'Verbose'"
- then:
- - test:
- - if: "$NavCommand = 'MoveNext'"
- then: [T: "移動"] # phrase('move' to next entry in table)
- - else_if: "$NavCommand = 'ReadNext'"
- then: [T: "讀"] # phrase('read' next entry in table)
- else: [T: "描述"] # phrase('describe' next entry in table)
- - T: "往右" # phrase(move 'right') # phrase(move 'right')
- - pause: short
- with:
- variables: [MatchCounter: "$MatchCounter + 1"]
- replace:
- - test:
- if: "following-sibling::*[1][.='\u2062' or .='\u2064'] and $NavMode='Enhanced'" # invisible times and plus
- then: [set_variables: [NavNode: "following-sibling::*[1]/@id"]]
- else: [x: "following-sibling::*[1]"]
+ variables: [SayCommand: "string($NavVerbosity = 'Verbose')"]
+ replace: [x: "."]
+ - test:
+ if: "following-sibling::*[1][.='\u2062' or .='\u2064'] and
+ ($NavMode='Enhanced' or ($NavMode='Simple' and following-sibling::*[2][not(IsNode(., 'mathml'))]))" # invisible times and plus
+ then: [set_variables: [NavNode: "following-sibling::*[1]/@id"]]
+ else: [x: "following-sibling::*[1]"]
- name: move-next-no-auto-zoom-at-edge
# at edge of 2D and in a mode where moving right isn't an option
@@ -1150,11 +1142,15 @@
match: "$NavCommand = 'MoveNext' and $NavMode!='Character' and not($AutoZoomOut) and $EdgeNode/@id!=@id"
replace:
- test:
- if: "$MatchCounter = 0 and $NavVerbosity != 'Terse' and $NavCommand = 'MoveNext'"
+ if: "$MatchCounter = 0 and $NavVerbosity = 'Verbose'"
then:
- - T: "無法往右移動" # phrase('cannot move right')
+ - T: "無法移到下一項" # phrase('cannot move right')
+ - pause: medium
- with:
- variables: [Move2D: "'結束'", Child2D: "$EdgeNode/*[last()]"]
+ variables:
+ - Move2D: "'end of'"
+ - Child2D: "$EdgeNode/*[last()]"
+ - MatchCounter: $MatchCounter + 1
replace: [x: "$EdgeNode"]
- pause: long
- set_variables: [SpeakExpression: "'false'"]
@@ -1167,17 +1163,19 @@
- "(self::m:math or name(EdgeNode(., 'right', 'math'))='math')" # at edge of math
replace:
- test:
- if: "$MatchCounter = 0 and $NavVerbosity != 'Terse'"
+ if: "$MatchCounter = 0 and $NavVerbosity = 'Verbose'"
then:
- - T: "不能" # phrase('cannot' move right in expression)
+ - T: "無法" # phrase('cannot' move right in expression)
- test:
- if: "$NavCommand = 'MoveNext'"
- then: [T: "移動"] # phrase('move' to next entry in table)
+ then: [T: "移到"] # phrase('move' to next entry in table)
- else_if: "$NavCommand = 'ReadNext'"
- then: [T: "讀"] # phrase('read' next entry in table)
+ then: [T: "讀出"] # phrase('read' next entry in table)
else: [T: "描述"] # phrase('describe' next entry in table)
- - T: "往右,數學結束" # phrase(move 'right, end of math')
- - pause: long
+ - T: "下一項" # phrase(move 'right')
+ - pause: short
+ - T: "數學結尾" # phrase(move 'end of math')
+ - pause: long
- set_variables: [SpeakExpression: "'false'"]
- name: move-next-auto-zoom-up-one-level
@@ -1192,48 +1190,34 @@
- " )"
- ")"
replace:
+ - with:
+ variables: [SayCommand: "string($NavVerbosity = 'Verbose')"]
+ replace: [x: "."]
- test:
- if: "$MatchCounter = 0 and $NavVerbosity = 'Verbose'"
+ if: "following-sibling::*"
then:
- - test:
- - if: "$NavCommand = 'MoveNext'"
- then: [T: "移動"] # phrase('move' to next entry in table)
- - else_if: "$NavCommand = 'ReadNext'"
- then: [T: "讀"] # phrase('read' next entry in table)
- else: [T: "描述"] # phrase('describe' next entry in table)
- - T: "往右" # phrase(move 'right') # phrase(move 'right')
- - pause: short
- - with:
- variables: [MatchCounter: "$MatchCounter + 1", NavCommand: "'MoveNext'"]
- replace:
- - test:
- if: "following-sibling::*"
- then:
- - with:
- variables: [Move2D: "'在'", Child2D: "."] # phrase('in' the denominator)
- replace: [x: ".."]
- else:
- - with:
- variables: [Move2D: "'離開'", Child2D: "."]
- replace: [x: ".."]
- - test:
- if: "following-sibling::*"
- then:
- - x: ".." # move out of parens
- else:
- - x: ".."
+ - with:
+ variables: [Move2D: "'進入'", Child2D: "."] # phrase('in' the denominator)
+ replace: [x: ".."]
+ else:
+ - with:
+ variables: [Move2D: "'離開'", Child2D: "."]
+ replace: [x: ".."]
+ - x: ".."
# At this point, if XXXNext, then we know there is must be a right sibling
- name: move-next-default
tag: mtd
match: "$Move2D = '' and ($NavCommand = 'MoveNext' or $NavCommand = 'ReadNext' or $NavCommand = 'DescribeNext')"
replace:
+ - with:
+ variables: [SayCommand: "string($NavVerbosity = 'Verbose')"]
+ replace: [x: "."]
- test:
- # can't get here with MatchCounter=0, so no need to echo command
if: "following-sibling::*"
then:
- test:
- if: "$NavVerbosity != 'Terse'"
+ if: "$NavVerbosity = 'Verbose'"
then:
- T: "行" # phrase(the previous 'column' in the table)
- x: "count(preceding-sibling::*)+2"
@@ -1250,25 +1234,21 @@
- name: move-next-default
tag: [mtr, mlabeledtr]
- match: "$Move2D = '' and ($NavCommand = 'MoveNext' or $NavCommand = 'ReadNext' or $NavCommand = 'DescribeNext')"
+ match: "$Move2D = '' and
+ ($NavCommand = 'MoveNext' or $NavCommand = 'ReadNext' or $NavCommand = 'DescribeNext') and
+ following-sibling::*"
replace:
+ - with:
+ variables: [SayCommand: "string($NavVerbosity = 'Verbose')"]
+ replace: [x: "."]
- test:
- # can't get here with MatchCounter=0, so no need to echo command
- if: "following-sibling::*"
+ if: "$NavMode = 'Character'"
then:
- - T: "列" # phrase(the previous 'row' in the table)
- - x: "count(preceding-sibling::*)+2"
- - T: "第 1 行" # phrase('column 1' in the table)
- - pause: medium
- - test:
- if: "$NavMode = 'Character'"
- then:
- - with:
- variables: [NavCommand: "'MoveNextZoom'"]
- replace: [x: "following-sibling::*[1]"]
- else:
- - set_variables: [NavNode: "following-sibling::*[1]/*[1]/*[1]/@id"]
- else: [x: ".."] # try again for after
+ - with:
+ variables: [NavCommand: "'MoveNextZoom'"]
+ replace: [x: "following-sibling::*[1]"]
+ else:
+ - set_variables: [NavNode: "following-sibling::*[1]/@id"]
- name: move-next-auto-zoom-parens
# auto-zoom into next child if next child is parenthesized expr
@@ -1278,20 +1258,12 @@
- "$NavMode='Enhanced' and"
- "parent::m:mrow and following-sibling::* and"
- "following-sibling::*[1][self::m:mrow and count(*)=3 and " #exclude empty parens
- - " (IsBracketed(., '(', ')') or IsBracketed(., '[', ']'))"
- - " ]"
+ - " (IsBracketed(., '(', ')') or IsBracketed(., '[', ']'))"
+ - " ]"
replace:
- - test:
- if: "$MatchCounter = 0 and $NavVerbosity = 'Verbose'"
- then:
- - test:
- - if: "$NavCommand = 'MoveNext'"
- then: [T: "移動"] # phrase('move' to next entry in table)
- - else_if: "$NavCommand = 'ReadNext'"
- then: [T: "讀"] # phrase('read' next entry in table)
- else: [T: "描述"] # phrase('describe' next entry in table)
- - T: "往右" # phrase(move 'right') # phrase(move 'right')
- - pause: short
+ - with:
+ variables: [SayCommand: "string($NavVerbosity = 'Verbose')"]
+ replace: [x: "."]
- set_variables: [NavNode: "following-sibling::*[1]/*[2]/@id"]
# normal cases for MoveNext
@@ -1302,17 +1274,9 @@
- "($NavCommand = 'MoveNext' or $NavCommand = 'ReadNext' or $NavCommand = 'DescribeNext') and"
- "$ReadZoomLevel>=0"
replace:
- - test:
- if: "$MatchCounter = 0 and $NavVerbosity = 'Verbose'"
- then:
- - test:
- - if: "$NavCommand = 'MoveNext'"
- then: [T: "移動"] # phrase('move' to next entry in table)
- - else_if: "$NavCommand = 'ReadNext'"
- then: [T: "讀"] # phrase('read' next entry in table)
- else: [T: "描述"] # phrase('describe' next entry in table)
- - T: "往右" # phrase(move 'right') # phrase(move 'right')
- - pause: short
+ - with:
+ variables: [SayCommand: "string($NavVerbosity = 'Verbose')"]
+ replace: [x: "."]
- test:
# if in base (nothing before), we must be moving to a script, so "in" will be said
if: "preceding-sibling::* and following-sibling::*[1][name(.)='none']"
@@ -1320,39 +1284,33 @@
- with:
variables: [Move2D: "'離開'", Child2D: "."]
replace: [x: ".."]
- - with:
- variables: [MatchCounter: "$MatchCounter + 1"]
- replace: [x: "following-sibling::*[1]"] # skip over 'none'
+ - x: "following-sibling::*[1]"
else:
- with:
- variables: [Move2D: "'在'", Child2D: "following-sibling::*[1]"] # phrase('in' the denominator)
+ variables: [Move2D: "'進入'", Child2D: "following-sibling::*[1]"] # phrase('in' the denominator)
replace: [x: ".."]
- with:
- variables: [MatchCounter: "$MatchCounter + 1", NavCommand: "'MoveNextZoom'"]
+ variables: [NavCommand: "'MoveNextZoom'"]
replace: [x: "following-sibling::*[1]"]
- name: move-next-default
tag: "*"
match: "$NavCommand = 'MoveNext' or $NavCommand = 'ReadNext' or $NavCommand = 'DescribeNext'"
replace:
+ - with:
+ variables: [SayCommand: "string($NavVerbosity = 'Verbose')"]
+ replace: [x: "."]
- test:
- if: "$MatchCounter = 0 and $NavVerbosity = 'Verbose'"
- then:
+ if: "following-sibling::*[1][@data-from-mathml='none' or @data-from-mathml='mprescripts']"
+ then: [x: "following-sibling::*[1]"]
+ else:
- test:
- - if: "$NavCommand = 'MoveNext'"
- then: [T: "移動"] # phrase('move' to next entry in table)
- - else_if: "$NavCommand = 'ReadNext'"
- then: [T: "讀"] # phrase('read' next entry in table)
- else: [T: "描述"] # phrase('describe' next entry in table)
- - T: "往右" # phrase(move 'right') # phrase(move 'right')
- - pause: short
- - test:
- if: "IsNode(.., '2D')"
- then:
- - with:
- variables: [Move2D: "'在'", Child2D: "following-sibling::*[1]"] # phrase('in' the denominator)
- replace: [x: ".."]
- - set_variables: [NavNode: "following-sibling::*[1]/@id"]
+ if: "IsNode(.., '2D') or not(IsNode(.., 'mathml'))"
+ then:
+ - with:
+ variables: [Move2D: "'進入'", Child2D: "following-sibling::*[1]"] # phrase('in' the denominator)
+ replace: [x: ".."]
+ - set_variables: [NavNode: "following-sibling::*[1]/@id"]
# ======== Move/Read/Describe Previous rules =================
@@ -1363,38 +1321,31 @@
- "($NavCommand = 'MovePrevious' or $NavCommand = 'ReadPrevious' or $NavCommand = 'DescribePrevious') and"
- "preceding-sibling::*[1][name(.)='mo' and translate(., '\u2061\u2062\u2063\u2064', '')='']"
replace:
- - test:
- if: "$MatchCounter = 0 and $NavVerbosity = 'Verbose'"
- then:
- - test:
- - if: "$NavCommand = 'MovePrevious'"
- then: [T: "移動"] # phrase('move' to next entry in table)
- - else_if: "$NavCommand = 'ReadPrevious'"
- then: [T: "讀"] # phrase('read' next entry in table)
- else: [T: "描述"] # phrase('describe' next entry in table)
- - T: "往左" # phrase(move 'left')
- - pause: short
- with:
- variables: [MatchCounter: "$MatchCounter + 1"]
- replace:
- - test:
- if: "preceding-sibling::*[1][.='\u2062' or .='\u2064'] and $NavMode='Enhanced'" # invisible times and plus
- then: [set_variables: [NavNode: "preceding-sibling::*[1]/@id"]]
- else: [x: "preceding-sibling::*[1]"]
+ variables: [SayCommand: "string($NavVerbosity = 'Verbose')"]
+ replace: [x: "."]
+ - test:
+ if: "preceding-sibling::*[1][.='\u2062' or .='\u2064'] and $NavMode='Enhanced'" # invisible times and plus
+ then: [set_variables: [NavNode: "preceding-sibling::*[1]/@id"]]
+ else: [x: "preceding-sibling::*[1]"]
-# two rules for when can't move right
+# two rules for when can't move left
- name: move-previous-no-auto-zoom-at-edge
- # at edge of 2D and in a mode where moving right isn't an option
+ # at edge of 2D and in a mode where moving left isn't an option
tag: "*"
variables: [EdgeNode: "EdgeNode(., 'left', '2D')"]
match: "$NavCommand = 'MovePrevious' and $NavMode!='Character' and not($AutoZoomOut) and $EdgeNode/@id!=@id"
replace:
- test:
- if: "$MatchCounter = 0 and $NavVerbosity != 'Terse' and $NavCommand = 'MovePrevious'"
+ if: "$MatchCounter = 0 and $NavVerbosity = 'Verbose' and $NavCommand = 'MovePrevious'"
then:
- - T: "無法向左移動" # phrase('cannot move left' in expression)
+ - T: "無法移到上一項" # phrase('cannot move left' in expression)
+ - pause: medium
- with:
- variables: [Move2D: "'離開'", Child2D: "$EdgeNode/*[1]"]
+ variables:
+ - Move2D: "'end of'"
+ - Child2D: "$EdgeNode/*[1]"
+ - MatchCounter: $MatchCounter + 1
replace: [x: "$EdgeNode"]
- pause: long
@@ -1405,7 +1356,7 @@
- "($NavCommand = 'MovePrevious' or $NavCommand = 'ReadPrevious' or $NavCommand = 'DescribePrevious') and"
- "(self::m:math or name(EdgeNode(., 'left', 'math'))='math')"
replace:
- - T: "開始數學" # phrase('start of math')
+ - T: "數學開頭" # phrase('start of math')
- pause: long
- set_variables: [SpeakExpression: "'false'"]
@@ -1416,10 +1367,14 @@
- "name(EdgeNode(., 'left', 'math'))='math'" # at edge of math
replace:
- test:
- if: "$MatchCounter = 0 and $NavVerbosity != 'Terse'"
+ if: "$MatchCounter = 0 and $NavVerbosity = 'Verbose'"
then:
- - T: "無法向左移動,數學開始" # phrase('cannot move left, start of math')
- - pause: long
+ - T: "無法移到上一項" # phrase('cannot move left')
+ - pause: short
+ - with:
+ variables: [Move2D: "'start of'", Child2D: "."]
+ replace: [x: "."]
+ - pause: long
- set_variables: [SpeakExpression: "'false'"]
- name: move-previous-auto-zoom-up-one-level
@@ -1434,36 +1389,20 @@
- " )"
- ")"
replace:
+ - with:
+ variables: [SayCommand: "string($NavVerbosity = 'Verbose')"]
+ replace: [x: "."]
- test:
- if: "$MatchCounter = 0 and $NavVerbosity = 'Verbose'"
+ if: "preceding-sibling::*"
then:
- - test:
- - if: "$NavCommand = 'MovePrevious'"
- then: [T: "移動"] # phrase('move' to next entry in table)
- - else_if: "$NavCommand = 'ReadPrevious'"
- then: [T: "讀"] # phrase('read' next entry in table)
- else: [T: "描述"] # phrase('describe' next entry in table)
- - T: "往左" # phrase(move 'left')
- - pause: short
- - with:
- variables: [MatchCounter: "$MatchCounter + 1", NavCommand: "'MovePrevious'"]
- replace:
- - test:
- if: "preceding-sibling::*"
- then:
- - with:
- variables: [Move2D: "'在'", Child2D: "."] # phrase('in' the denominator)
- replace: [x: ".."]
- else:
- - with:
- variables: [Move2D: "'離開'", Child2D: "."]
- replace: [x: ".."]
- - test:
- if: "preceding-sibling::*"
- then:
- - x: .. # move out of parens
- else:
- - x: ".."
+ - with:
+ variables: [Move2D: "'進入'", Child2D: "."] # phrase('in' the denominator)
+ replace: [x: ".."]
+ else:
+ - with:
+ variables: [Move2D: "'離開'", Child2D: "."]
+ replace: [x: ".."]
+ - x: ".."
- name: move-previous-auto-zoom-parens
# auto-zoom into previous child if previous child is parenthesized expr
@@ -1480,22 +1419,14 @@
- " (IsBracketed(., '(', ')') or IsBracketed(., '[', ']'))"
- " ]"
replace:
- - test:
- if: "$MatchCounter = 0 and $NavVerbosity = 'Verbose'"
- then:
- - test:
- - if: "$NavCommand = 'MovePrevious'"
- then: [T: "移動"] # phrase('move' to next entry in table)
- - else_if: "$NavCommand = 'ReadPrevious'"
- then: [T: "讀"] # phrase('read' next entry in table)
- else: [T: "描述"] # phrase('describe' next entry in table)
- - T: "往左" # phrase(move 'left')
- - pause: short
+ - with:
+ variables: [SayCommand: "string($NavVerbosity = 'Verbose')"]
+ replace: [x: "."]
- test:
if: "not(parent::m:mrow)"
then:
- with:
- variables: [Move2D: "'在'", Child2D: "preceding-sibling::*[1]"] # phrase('in' the denominator)
+ variables: [Move2D: "'進入'", Child2D: "preceding-sibling::*[1]"] # phrase('in' the denominator)
replace: [x: ".."]
- set_variables: [NavNode: "preceding-sibling::*[1]/*[2]/@id"]
@@ -1503,44 +1434,37 @@
- name: move-previous-default
tag: mtd
- match: "$Move2D = '' and ($NavCommand = 'MovePrevious' or $NavCommand = 'ReadPrevious' or $NavCommand = 'DescribePrevious')"
+ match: "$Move2D = '' and
+ ($NavCommand = 'MovePrevious' or $NavCommand = 'ReadPrevious' or $NavCommand = 'DescribePrevious') and
+ preceding-sibling::*"
replace:
+ - with:
+ variables: [SayCommand: "string($NavVerbosity = 'Verbose')"]
+ replace: [x: "."]
- test:
- # can't get here with MatchCounter=0, so no need to echo command
- if: "preceding-sibling::*"
+ if: "$NavVerbosity = 'Verbose'"
then:
- - test:
- if: "$NavVerbosity != 'Terse'"
- then:
- - T: "行" # phrase(the first 'column' in the table)
- - x: "count(preceding-sibling::*)"
- - pause: short
- - test:
- if: "$NavMode = 'Character'"
- then:
- - with:
- variables: [NavCommand: "'MovePreviousZoom'"]
- replace: [x: "preceding-sibling::*[1]"]
- else: [set_variables: [NavNode: "preceding-sibling::*[1]/*[last()]/@id"]]
- else:
- - x: ".." # try again at the row level
+ - T: "行" # phrase(the first 'column' in the table)
+ - x: "count(preceding-sibling::*)"
+ - pause: short
+ - test:
+ if: "$NavMode = 'Character'"
+ then:
+ - with:
+ variables: [NavCommand: "'MovePreviousZoom'"]
+ replace: [x: "preceding-sibling::*[1]"]
+ else: [set_variables: [NavNode: "preceding-sibling::*[1]/*[last()]/@id"]]
- name: move-previous-default
tag: [mtr, mlabeledtr]
match: "$Move2D = '' and ($NavCommand = 'MovePrevious' or $NavCommand = 'ReadPrevious' or $NavCommand = 'DescribePrevious')"
replace:
+ - with:
+ variables: [SayCommand: "string($NavVerbosity = 'Verbose')"]
+ replace: [x: "."]
- test:
- # can't get here with MatchCounter=0, so no need to echo command
if: "preceding-sibling::*"
then:
- - test:
- if: "$NavVerbosity != 'Terse'"
- then:
- - T: "列" # phrase('row' five in table)
- - x: "count(preceding-sibling::*)"
- - T: "行" # phrase('column' five in table)
- - x: "count(*)"
- - pause: medium
- test:
if: "$NavMode = 'Character'"
then:
@@ -1548,7 +1472,7 @@
variables: [NavCommand: "'MovePreviousZoom'"]
replace: [x: "preceding-sibling::*[1]"]
else:
- - set_variables: [NavNode: "preceding-sibling::*[1]/*[last()]/*[last()]/@id"]
+ - set_variables: [NavNode: "preceding-sibling::*[1]/@id"]
else: [x: ".."] # try again for after
- name: move-previous-locked-zoom-level
@@ -1558,6 +1482,9 @@
- "($NavCommand = 'MovePrevious' or $NavCommand = 'ReadPrevious' or $NavCommand = 'DescribePrevious') and"
- "$ReadZoomLevel>=0"
replace:
+ - with:
+ variables: [SayCommand: "string($NavVerbosity = 'Verbose')"]
+ replace: [x: "."]
- test:
# if moving into base (nothing before), we must be moving to the base, so "in" will be said
if: "count(preceding-sibling::*) > 2 and preceding-sibling::*[1][name(.)='none']"
@@ -1565,50 +1492,33 @@
- with:
variables: [Move2D: "'離開'", Child2D: "."]
replace: [x: ".."]
- - with:
- variables: [MatchCounter: "$MatchCounter + 1"]
- replace: [x: "preceding-sibling::*[1]"] # skip over 'none'
+ - x: "preceding-sibling::*[1]" # skip over 'none'
else:
- - test:
- if: "$MatchCounter = 0 and $NavVerbosity = 'Verbose'"
- then:
- - test:
- - if: "$NavCommand = 'MovePrevious'"
- then: [T: "移動"] # phrase('move' to next entry in table)
- - else_if: "$NavCommand = 'ReadPrevious'"
- then: [T: "讀"] # phrase('read' next entry in table)
- else: [T: "描述"] # phrase('describe' next entry in table)
- - T: "往左" # phrase(move 'left')
- - pause: short
- with:
- variables: [Move2D: "'在'", Child2D: "preceding-sibling::*[1]"] # phrase('in' the denominator)
+ variables: [Move2D: "'進入'", Child2D: "preceding-sibling::*[1]"] # phrase('in' the denominator)
replace: [x: ".."]
- with:
- variables: [MatchCounter: "$MatchCounter + 1", NavCommand: "'MovePreviousZoom'"]
+ variables: [NavCommand: "'MovePreviousZoom'"]
replace: [x: "preceding-sibling::*[1]"]
- name: move-previous-default
tag: "*"
match: "$NavCommand = 'MovePrevious' or $NavCommand = 'ReadPrevious' or $NavCommand = 'DescribePrevious'"
replace:
+ - with:
+ variables: [SayCommand: "string($NavVerbosity = 'Verbose')"]
+ replace: [x: "."]
- test:
- if: "$MatchCounter = 0 and $NavVerbosity = 'Verbose'"
- then:
+ if: "preceding-sibling::*[1][@data-from-mathml='none' or @data-from-mathml='mprescripts']"
+ then: [x: "preceding-sibling::*[1]"]
+ else:
- test:
- - if: "$NavCommand = 'MovePrevious'"
- then: [T: "移動"] # phrase('move' to next entry in table)
- - else_if: "$NavCommand = 'ReadPrevious'"
- then: [T: "讀"] # phrase('read' next entry in table)
- else: [T: "描述"] # phrase('describe' next entry in table)
- - T: "往左" # phrase(move 'left')
- - pause: short
- - test:
- if: "IsNode(.., '2D')"
- then:
- - with:
- variables: [Move2D: "'在'", Child2D: "preceding-sibling::*[1]"] # phrase('in' the denominator)
- replace: [x: ".."]
- - set_variables: [NavNode: "preceding-sibling::*[1]/@id"]
+ if: "IsNode(.., '2D') or not(IsNode(.., 'mathml'))"
+ then:
+ - with:
+ variables: [Move2D: "'進入'", Child2D: "preceding-sibling::*[1]"] # phrase('in' the denominator)
+ replace: [x: ".."]
+ - set_variables: [NavNode: "preceding-sibling::*[1]/@id"]
# ********* ReadZoomLevel toggle ***************
# These set ::NavMode
@@ -1624,7 +1534,7 @@
- set_variables: [NavMode: "'Character'", ReadZoomLevel: "1"]
- else_if: "$NavMode = 'Character'"
then:
- - T: "簡單" # phrase(a 'simple' way to do something)
+ - T: "簡易" # phrase(a 'simple' way to do something)
- set_variables: [NavMode: "'Simple'", ReadZoomLevel: "1"]
- else:
- T: "增強" # phrase(an 'enhanced' way to do something)
@@ -1645,7 +1555,7 @@
- test:
- if: "$NavMode = 'Enhanced'"
then:
- - T: "簡單" # phrase(an 'simple' way to do something)
+ - T: "簡易" # phrase(a 'simple' way to do something)
- set_variables: [NavMode: "'Simple'", ReadZoomLevel: "1"]
- else_if: "$NavMode = 'Character'"
then:
@@ -1670,12 +1580,13 @@
- test:
if: "$Overview = 'true'"
then:
- - T: "移動後唸出式子" # phrase('speak expression after move')
+ - T: "讀出式子" # phrase('speak expression after move')
+ - pause: long
- set_variables: [Overview: "'false'"]
else:
- - T: "移動後概述式子" # phrase('overview of expression after move')
+ - T: "描述式子" # phrase('overview of expression after move')
+ - pause: long
- set_variables: [Overview: "'true'"]
- - pause: long
- name: current
tag: "*"
@@ -1686,11 +1597,11 @@
then:
- test:
- if: "$NavCommand = 'ReadCurrent'"
- then: [T: "讀"] # phrase('read' next entry in table)
+ then: [T: "讀出"] # phrase('read' next entry in table)
else: [T: "描述"] # phrase('describe' next entry in table)
- - T: "當前的" # phrase('current' entry in table)
+ - T: "目前" # phrase('current' entry in table)
+ - pause: long
- set_variables: [NavNode: "@id"]
- - pause: long
# this needs to be near the end because we only test for 'Describe', "Read", etc., and we don't want to get 'DescribeNext', etc.
- name: placemarker
@@ -1706,13 +1617,13 @@
then:
- test:
- if: "starts-with($NavCommand, 'Read')"
- then: [T: "讀"] # phrase('read' next entry in table)
+ then: [T: "讀出"] # phrase('read' next entry in table)
- else_if: "starts-with($NavCommand, 'Describe')"
then: [T: "描述"] # phrase('describe' next entry in table)
- else_if: "starts-with($NavCommand, 'MoveTo')"
then: [T: "移到"] # phrase('move to' the next entry in table)
else: [T: "設定"] # phrase('set' the value of the next entry in table)
- - T: "佔位符" # phrase('placeholder' for the value)
+ - T: "書籤" # phrase('placeholder' for the value)
- x: "$PlaceMarkerIndex"
- pause: long
- set_variables: [NavNode: "$PlaceMarker"]
@@ -1724,7 +1635,7 @@
- test:
if: "$NavVerbosity != 'Terse'"
then:
- - T: "設定佔位符" # phrase('set placeholder' to the value)
+ - T: "設定書籤" # phrase('set placeholder' to the value)
- x: "$PlaceMarkerIndex"
- pause: long
- set_variables: [NavNode: "@id"]
@@ -1735,8 +1646,6 @@
# Alternatively, it could insert a special token that Rust code does a "replace" on with the speech (e.g. SPEECH_AT{id})
# or a new command "speak" which takes a node id
- name: where-am-i-start
-
-
tag: "*"
match: "($NavCommand = 'WhereAmI' or $NavCommand = 'WhereAmIAll') and $MatchCounter = 0"
replace:
@@ -1758,11 +1667,11 @@
- test:
if: "$NavCommand = 'WhereAmI'"
then:
- - T: "內部沒東西" # phrase('inside of nothing more')
+ - T: "不在別的式子裡面" # phrase('inside of nothing more')
- pause: long
- set_variables: [SpeakExpression: "'false'"]
else:
- - T: "裡面" # phrase('inside' a big expression)
+ - T: "在後面式子裡面" # phrase('inside' a big expression)
- pause: medium
- set_variables: [NavNode: "@id"]
@@ -1770,10 +1679,10 @@
tag: "*"
match: "$NavCommand = 'WhereAmI' or $NavCommand = 'WhereAmIAll'"
replace:
- - T: "裡面" # phrase('inside' a big expression)
+ - T: "在後面式子裡面" # phrase('inside' a big expression)
- pause: medium
- test:
- - if: "$NavMode='Enhanced' and parent::*[self::m:mrow and IsBracketed(., '(', ')', false) or IsBracketed(., '[', ']', false)]"
+ - if: "$NavMode='Enhanced' and parent::*[self::m:mrow and (IsBracketed(., '(', ')', false) or IsBracketed(., '[', ']', false))]"
then: [x: ".."] # auto-zoom up
- else_if: "$NavCommand = 'WhereAmI'"
then: [set_variables: [NavNode: "@id"]]
diff --git a/Rules/Languages/zh/tw/overview.yaml b/Rules/Languages/zh/tw/overview.yaml
index 78bdcd0eb..240fb45c6 100644
--- a/Rules/Languages/zh/tw/overview.yaml
+++ b/Rules/Languages/zh/tw/overview.yaml
@@ -44,7 +44,7 @@
tag: mroot
match: "."
replace:
- - T: "根號"
+ - T: ""
- x: "*[1]"
- test:
if: "IsNode(*[1], 'simple')"
@@ -94,7 +94,7 @@
- x: count(*[2]/*)
- T: "乘"
- x: count(*[2]/*[self::m:mtr][1]/*)
- - T: "表"
+ - T: "表格"
- name: short-mrow
tag: mrow
diff --git a/Rules/Languages/zh/tw/unicode-full.yaml b/Rules/Languages/zh/tw/unicode-full.yaml
index 7e930e016..9e4e85087 100644
--- a/Rules/Languages/zh/tw/unicode-full.yaml
+++ b/Rules/Languages/zh/tw/unicode-full.yaml
@@ -2446,116 +2446,116 @@
- "㊽": [T: "圈圈內48"] # 0x32bd (en: 'circled number forty eight', GPT-5.4 translation)
- "㊾": [T: "圈圈內49"] # 0x32be (en: 'circled number forty nine', GPT-5.4 translation)
- "㊿": [T: "圈圈內50"] # 0x32bf (en: 'circled number fifty', GPT-5.4 translation)
- - "㋌": [T: "汞"] # 0x32cc (en: 'mercury', google translation)
- - "㋍": [t: "ergs"] # 0x32cd (google translation)
+ - "㋌": [T: "汞柱"] # 0x32cc (en: 'mercury', google translation)
+ - "㋍": [T: "耳格"] # 0x32cd (google translation)
- "㋎": [T: "電子伏特"] # 0x32ce (en: 'electron volts', google translation)
- "㋏": [T: "有限責任標誌"] # 0x32cf (en: 'limited liability sign', google translation)
- - "㍱": [t: "海毛"] # 0x3371 (en: 'hectopascals', google translation)
- - "㍲": [t: "達爾頓"] # 0x3372 (en: 'daltons', google translation)
+ - "㍱": [T: "百帕"] # 0x3371 (en: 'hectopascals', google translation)
+ - "㍲": [T: "道爾頓"] # 0x3372 (en: 'daltons', google translation)
- "㍳": [T: "天文單位"] # 0x3373 (en: 'astronomical units', google translation)
- - "㍴": [t: "酒吧"] # 0x3374 (en: 'bars', google translation)
+ - "㍴": [T: "巴"] # 0x3374 (en: 'bars', google translation)
- "㍵": [t: "o v"] # 0x3375 (google translation)
- - "㍶": [t: "parsecs"] # 0x3376 (google translation)
- - "㍷": [T: "公寸"] # 0x3377 (en: 'decimeters', google translation)
- - "㍸": [T: "公寸平方"] # 0x3378 (en: 'decimeters squared', google translation)
- - "㍹": [T: "公寸立方"] # 0x3379 (en: 'decimeters cubed', google translation)
+ - "㍶": [T: "秒差距"] # 0x3376 (google translation)
+ - "㍷": [T: "分米"] # 0x3377 (en: 'decimeters', google translation)
+ - "㍸": [T: "平方分米"] # 0x3378 (en: 'decimeters squared', google translation)
+ - "㍹": [T: "立方分米"] # 0x3379 (en: 'decimeters cubed', google translation)
- "㍺": [t: "樂器單元"] # 0x337a (en: 'instrumental units', google translation)
- - "㎀": [t: "picoamps"] # 0x3380 (google translation)
- - "㎁": [t: "nanoamps"] # 0x3381 (en: 'nanoamps', google translation)
- - "㎂": [t: "microamps"] # 0x3382 (en: 'microamps', google translation)
- - "㎃": [t: "milliamps"] # 0x3383 (en: 'milliamps', google translation)
- - "㎄": [T: "kiloamps"] # 0x3384 (en: 'kiloamps', google translation)
- - "㎅": [T: "千位元組"] # 0x3385 (en: 'kilobytes', google translation)
- - "㎆": [T: "百萬位元組"] # 0x3386 (en: 'megabytes', google translation)
- - "㎇": [T: "十億位元組"] # 0x3387 (en: 'gigabytes', google translation)
- - "㎈": [T: "卡路里"] # 0x3388 (en: 'calories', google translation)
- - "㎉": [T: "千卡"] # 0x3389 (en: 'kilocalories', google translation)
- - "㎊": [t: "picofarads"] # 0x338a (google translation)
- - "㎋": [t: "nanofarads"] # 0x338b (en: 'nanofarads', google translation)
- - "㎌": [t: "microfarads"] # 0x338c (en: 'microfarads', google translation)
+ - "㎀": [t: "皮安培"] # 0x3380 (google translation)
+ - "㎁": [t: "奈安培"] # 0x3381 (en: 'nanoamps', google translation)
+ - "㎂": [t: "微安培"] # 0x3382 (en: 'microamps', google translation)
+ - "㎃": [t: "毫安培"] # 0x3383 (en: 'milliamps', google translation)
+ - "㎄": [T: "千安培"] # 0x3384 (en: 'kiloamps', google translation)
+ - "㎅": [T: "KB"] # 0x3385 (en: 'kilobytes', google translation)
+ - "㎆": [T: "MB"] # 0x3386 (en: 'megabytes', google translation)
+ - "㎇": [T: "GB"] # 0x3387 (en: 'gigabytes', google translation)
+ - "㎈": [T: "卡"] # 0x3388 (en: 'calories', google translation)
+ - "㎉": [T: "大卡"] # 0x3389 (en: 'kilocalories', google translation)
+ - "㎊": [t: "皮法拉"] # 0x338a (google translation)
+ - "㎋": [t: "奈法拉"] # 0x338b (en: 'nanofarads', google translation)
+ - "㎌": [t: "微法拉"] # 0x338c (en: 'microfarads', google translation)
- "㎍": [T: "微克"] # 0x338d (en: 'micrograms', google translation)
- "㎎": [T: "毫克"] # 0x338e (en: 'milligrams', google translation)
- "㎏": [T: "公斤"] # 0x338f (en: 'kilograms', google translation)
- "㎐": [T: "赫茲"] # 0x3390 (en: 'hertz', google translation)
- "㎑": [T: "千赫"] # 0x3391 (en: 'kilohertz', google translation)
- "㎒": [T: "百萬赫"] # 0x3392 (en: 'megahertz', google translation)
- - "㎓": [T: "十億赫"] # 0x3393 (en: 'gigahertz', google translation)
- - "㎔": [t: "terahertz"] # 0x3394 (google translation)
+ - "㎓": [T: "吉赫"] # 0x3393 (en: 'gigahertz', google translation)
+ - "㎔": [t: "兆赫"] # 0x3394 (google translation)
- "㎕": [T: "微升"] # 0x3395 (en: 'microliters', google translation)
- "㎖": [T: "毫升"] # 0x3396 (en: 'milliliters', google translation)
- - "㎗": [t: "deciliters"] # 0x3397 (en: 'deciliters', google translation)
- - "㎘": [T: "千升"] # 0x3398 (en: 'kiloliters', google translation)
- - "㎙": [t: "femtometers"] # 0x3399 (google translation)
+ - "㎗": [t: "分升"] # 0x3397 (en: 'deciliters', google translation)
+ - "㎘": [T: "公秉"] # 0x3398 (en: 'kiloliters', google translation)
+ - "㎙": [t: "飛米"] # 0x3399 (google translation)
- "㎚": [T: "奈米"] # 0x339a (en: 'nanometers', google translation)
- "㎛": [T: "微米"] # 0x339b (en: 'micrometers', google translation)
- "㎜": [T: "毫米"] # 0x339c (en: 'millimeters', google translation)
- - "㎝": [T: "厘米"] # 0x339d (en: 'centimeters', google translation)
+ - "㎝": [T: "公分"] # 0x339d (en: 'centimeters', google translation)
- "㎞": [T: "公里"] # 0x339e (en: 'kilometers', google translation)
- - "㎟": [T: "毫米平方"] # 0x339f (en: 'millimeters squared', google translation)
- - "㎠": [T: "厘米平方"] # 0x33a0 (en: 'centimeters squared', google translation)
- - "㎡": [T: "米平方"] # 0x33a1 (en: 'meters squared', google translation)
- - "㎢": [T: "公里平方"] # 0x33a2 (en: 'kilometers squared', google translation)
- - "㎣": [T: "毫米立方"] # 0x33a3 (en: 'millimeters cubed', google translation)
- - "㎤": [T: "厘米立方"] # 0x33a4 (en: 'centimeters cubed', google translation)
- - "㎥": [T: "米立方"] # 0x33a5 (en: 'meters cubed', google translation)
- - "㎦": [T: "公里立方"] # 0x33a6 (en: 'kilometers cubed', google translation)
- - "㎧": [T: "每秒米"] # 0x33a7 (en: 'meters per second', google translation)
- - "㎨": [T: "每秒平方米"] # 0x33a8 (en: 'meters per second squared', google translation)
- - "㎩": [t: "pascals"] # 0x33a9 (en: 'pascals', google translation)
- - "㎪": [t: "kilopascals"] # 0x33aa (google translation)
- - "㎫": [t: "megapascals"] # 0x33ab (en: 'megapascals', google translation)
- - "㎬": [t: "gigapascals"] # 0x33ac (google translation)
+ - "㎟": [T: "平方毫米"] # 0x339f (en: 'millimeters squared', google translation)
+ - "㎠": [T: "平方公分"] # 0x33a0 (en: 'centimeters squared', google translation)
+ - "㎡": [T: "平方公尺"] # 0x33a1 (en: 'meters squared', google translation)
+ - "㎢": [T: "平方公里"] # 0x33a2 (en: 'kilometers squared', google translation)
+ - "㎣": [T: "立方毫米"] # 0x33a3 (en: 'millimeters cubed', google translation)
+ - "㎤": [T: "立方公分"] # 0x33a4 (en: 'centimeters cubed', google translation)
+ - "㎥": [T: "立方公尺"] # 0x33a5 (en: 'meters cubed', google translation)
+ - "㎦": [T: "立方公里"] # 0x33a6 (en: 'kilometers cubed', google translation)
+ - "㎧": [T: "公尺/秒"] # 0x33a7 (en: 'meters per second', google translation)
+ - "㎨": [T: "公尺/平方秒"] # 0x33a8 (en: 'meters per second squared', google translation)
+ - "㎩": [t: "帕"] # 0x33a9 (en: 'pascals', google translation)
+ - "㎪": [t: "千帕"] # 0x33aa (google translation)
+ - "㎫": [t: "百萬帕"] # 0x33ab (en: 'megapascals', google translation)
+ - "㎬": [t: "吉帕"] # 0x33ac (google translation)
- "㎭": [T: "弳"] # 0x33ad (en: 'rads', google translation)
- - "㎮": [T: "每秒弳"] # 0x33ae (en: 'rads per second', google translation)
- - "㎯": [T: "每秒平方弳"] # 0x33af (en: 'rads per second squared', google translation)
- - "㎰": [t: "picseconds"] # 0x33b0 (en: 'picoseconds', google translation)
- - "㎱": [t: "nanoseconds"] # 0x33b1 (en: 'nanoseconds', google translation)
+ - "㎮": [T: "弳/秒"] # 0x33ae (en: 'rads per second', google translation)
+ - "㎯": [T: "弳/平方秒"] # 0x33af (en: 'rads per second squared', google translation)
+ - "㎰": [t: "皮秒"] # 0x33b0 (en: 'picoseconds', google translation)
+ - "㎱": [t: "奈秒"] # 0x33b1 (en: 'nanoseconds', google translation)
- "㎲": [T: "微秒"] # 0x33b2 (en: 'microseconds', google translation)
- "㎳": [T: "毫秒"] # 0x33b3 (en: 'milliseconds', google translation)
- - "㎴": [t: "picovolts"] # 0x33b4 (google translation)
- - "㎵": [t: "nanovolts"] # 0x33b5 (en: 'nanovolts', google translation)
+ - "㎴": [t: "皮伏特"] # 0x33b4 (google translation)
+ - "㎵": [t: "奈伏特"] # 0x33b5 (en: 'nanovolts', google translation)
- "㎶": [T: "微伏特"] # 0x33b6 (en: 'microvolts', google translation)
- "㎷": [T: "毫伏特"] # 0x33b7 (en: 'millivolts', google translation)
- "㎸": [T: "千伏特"] # 0x33b8 (en: 'kilovolts', google translation)
- - "㎹": [t: "megavolts"] # 0x33b9 (google translation)
- - "㎺": [t: "picowatts"] # 0x33ba (google translation)
- - "㎻": [t: "nanowatts"] # 0x33bb (en: 'nanowatts', google translation)
- - "㎼": [t: "microwatts"] # 0x33bc (google translation)
+ - "㎹": [t: "百萬伏特"] # 0x33b9 (google translation)
+ - "㎺": [t: "皮瓦"] # 0x33ba (google translation)
+ - "㎻": [t: "奈瓦"] # 0x33bb (en: 'nanowatts', google translation)
+ - "㎼": [t: "微瓦"] # 0x33bc (google translation)
- "㎽": [T: "毫瓦"] # 0x33bd (en: 'milliwatts', google translation)
- "㎾": [T: "千瓦"] # 0x33be (en: 'kilowatts', google translation)
- "㎿": [T: "百萬瓦"] # 0x33bf (en: 'megawatts', google translation)
- "㏀": [T: "千歐姆"] # 0x33c0 (en: 'kilo-ohms', google translation)
- "㏁": [T: "百萬歐姆"] # 0x33c1 (google translation)
- "㏂": [t: "attometers"] # 0x33c2 (google translation)
- - "㏃": [t: "becquerels"] # 0x33c3 (en: 'becquerels', google translation)
+ - "㏃": [t: "貝克"] # 0x33c3 (en: 'becquerels', google translation)
- "㏄": [T: "cc"] # 0x33c4 (en: 'cubic centimeters', google translation)
- - "㏅": [t: "candelas"] # 0x33c5 (en: 'candelas', google translation)
- - "㏆": [t: "coulombs per kilogram"] # 0x33c6 (en: 'coulombs per kilogram', google translation)
+ - "㏅": [t: "燭光"] # 0x33c5 (en: 'candelas', google translation)
+ - "㏆": [t: "庫侖/公斤"] # 0x33c6 (en: 'coulombs per kilogram', google translation)
- "㏇": [t: "cardiac output"] # 0x33c7 (en: 'cardiac output', google translation)
- "㏈": [T: "分貝"] # 0x33c8 (en: 'decibels', google translation)
- - "㏉": [t: "grays"] # 0x33c9 (en: 'grays', google translation)
- - "㏊": [t: "hectares"] # 0x33ca (en: 'hectares', google translation)
+ - "㏉": [t: "戈雷"] # 0x33c9 (en: 'grays', google translation)
+ - "㏊": [t: "公頃"] # 0x33ca (en: 'hectares', google translation)
- "㏋": [T: "馬力"] # 0x33cb (en: 'horsepower', google translation)
- "㏌": [T: "英寸"] # 0x33cc (en: 'inches', google translation)
- "㏍": [t: "kilokelvins"] # 0x33cd (google translation)
- "㏎": [T: "公里"] # 0x33ce (en: 'kilometers', google translation)
- - "㏏": [t: "結"] # 0x33cf (en: 'knots', google translation)
+ - "㏏": [t: "節"] # 0x33cf (en: 'knots', google translation)
- "㏐": [T: "流明"] # 0x33d0 (en: 'lumens', google translation)
- "㏑": [T: "自然對數"] # 0x33d1 (en: 'natural log', google translation)
- "㏒": [T: "對數"] # 0x33d2 (en: 'logarithm', google translation)
- "㏓": [t: "勒克斯"] # 0x33d3 (en: 'lux', google translation)
- - "㏔": [t: "millibarns"] # 0x33d4 (google translation)
- - "㏕": [t: "mills"] # 0x33d5 (en: 'mills', google translation)
- - "㏖": [t: "moles"] # 0x33d6 (en: 'moles', google translation)
- - "㏗": [T: "p h"] # 0x33d7 (google translation)
+ - "㏔": [t: "毫邦"] # 0x33d4 (google translation)
+ - "㏕": [t: "密耳"] # 0x33d5 (en: 'mills', google translation)
+ - "㏖": [t: "莫耳"] # 0x33d6 (en: 'moles', google translation)
+ - "㏗": [T: "pH"] # 0x33d7 (google translation)
- "㏘": [t: "picometers"] # 0x33d8 (en: 'picometers', google translation)
- - "㏙": [T: "p p m"] # 0x33d9 (en: 'parts per million', google translation)
- - "㏚": [t: "petaroentgens"] # 0x33da (google translation)
- - "㏛": [t: "steradians"] # 0x33db (en: 'steradians', google translation)
- - "㏜": [t: "sieverts"] # 0x33dc (google translation)
- - "㏝": [t: "webers"] # 0x33dd (en: 'webers', google translation)
- - "㏞": [T: "每米伏"] # 0x33de (en: 'volts per meter', google translation)
- - "㏟": [T: "每米安"] # 0x33df (en: 'amps per meter', google translation)
+ - "㏙": [T: "PPM"] # 0x33d9 (en: 'parts per million', google translation)
+ - "㏚": [t: "拍侖琴"] # 0x33da (google translation)
+ - "㏛": [t: "立弳"] # 0x33db (en: 'steradians', google translation)
+ - "㏜": [t: "西弗"] # 0x33dc (google translation)
+ - "㏝": [t: "韋伯"] # 0x33dd (en: 'webers', google translation)
+ - "㏞": [T: "伏特/公尺"] # 0x33de (en: 'volts per meter', google translation)
+ - "㏟": [T: "安培/公尺"] # 0x33df (en: 'amps per meter', google translation)
- "㏿": [T: "加侖"] # 0x33ff (en: 'gallons', google translation)
- "": [t: "等於下面的帽子"] # 0xe900 (en: 'equals with hat below', google translation)
- "": [t: "等於上面"] # 0xe901 (en: 'equals with plus above', google translation)
diff --git a/tests/Languages/zh/tw/SimpleSpeak/geometry.rs b/tests/Languages/zh/tw/SimpleSpeak/geometry.rs
index 20235702b..4a9b4c72a 100644
--- a/tests/Languages/zh/tw/SimpleSpeak/geometry.rs
+++ b/tests/Languages/zh/tw/SimpleSpeak/geometry.rs
@@ -30,7 +30,7 @@ fn arc_mtext() -> Result<()> {
#[test]
fn ray_mtext() -> Result<()> {
let expr = "";
- test("zh-tw", "SimpleSpeak", expr, "向量 大寫 x 大寫 y")?;
+ test("zh-tw", "SimpleSpeak", expr, "射線 大寫 x 大寫 y")?;
return Ok(());
}
diff --git a/tests/Languages/zh/tw/SimpleSpeak/mroot.rs b/tests/Languages/zh/tw/SimpleSpeak/mroot.rs
index c28fd8e71..57cf39c59 100644
--- a/tests/Languages/zh/tw/SimpleSpeak/mroot.rs
+++ b/tests/Languages/zh/tw/SimpleSpeak/mroot.rs
@@ -48,7 +48,7 @@ fn cube_root() -> Result<()> {
let expr = "";
- test("zh-tw", "SimpleSpeak", expr, "根號 x 的 立方根")?;
+ test("zh-tw", "SimpleSpeak", expr, "x 的 立方根")?;
return Ok(());
}
@@ -58,7 +58,7 @@ fn ordinal_root() -> Result<()> {
let expr = "";
- test("zh-tw", "SimpleSpeak", expr, "根號 x 的 9 次方根")?;
+ test("zh-tw", "SimpleSpeak", expr, "x 的 9 次方根")?;
return Ok(());
}
@@ -67,7 +67,7 @@ fn ordinal_root_2() -> Result<()> {
let expr = "";
- test("zh-tw", "SimpleSpeak", expr, "根號 x 的 9.1 次方根")?;
+ test("zh-tw", "SimpleSpeak", expr, "x 的 9.1 次方根")?;
return Ok(());
}
@@ -77,7 +77,7 @@ fn simple_mi_root() -> Result<()> {
let expr = "";
- test("zh-tw", "SimpleSpeak", expr, "根號 x 的 n 次方根")?;
+ test("zh-tw", "SimpleSpeak", expr, "x 的 n 次方根")?;
return Ok(());
}
@@ -91,7 +91,7 @@ fn simple_fraction_power() -> Result<()> {
13
";
- test("zh-tw", "SimpleSpeak", expr, "根號 x 的 3 分之 1 次方根")?;
+ test("zh-tw", "SimpleSpeak", expr, "x 的 3 分之 1 次方根")?;
return Ok(());
}