--- # number-sets are a little messy in that the base was converted to a number-set, so we have to match that (simple) case last - name: pos-neg-number-sets tag: number-sets match: "*[2][text()='+' or text()='-']" replace: # if: "$Verbosity!='Terse'" # then: # - T: "the" - bookmark: "*[2]/@id" # - test: - test: - if: "*[2][text()='+']" then: [{T: "dương"}] else: [{T: "âm"}] - bookmark: "*[1]/@id" - test: - if: "*[1][text()='ℂ']" then: [{T: số phức}] - else_if: "*[1][text()='ℕ']" then: [{T: số tự nhiên}] - else_if: "*[1][text()='ℚ']" then: [{T: số hữu tỷ}] - else_if: "*[1][text()='ℝ']" then: [{T: số thực}] - else_if: "*[1][text()='ℤ']" then: [{T: số nguyên}] else: [{x: "*[1][text()]"}] # shouldn't happen - name: dimension-number-sets # should be single digit integer at this point (e.g, R^3) tag: number-sets match: "count(*)=2" replace: - bookmark: "*[1]/@id" - test: - if: "*[1][text()='ℂ']" then: [{T: "C"}] - else_if: "*[1][text()='ℕ']" then: [{T: "N"}] - else_if: "*[1][text()='ℚ']" then: [{T: "Q"}] - else_if: "*[1][text()='ℝ']" then: [{T: "R"}] - else_if: "*[1][text()='ℤ']" then: [{T: "Z"}] else: [{x: "*[1][text()]"}] # shouldn't happen - bookmark: "*[2]/@id" - x: "*[2]" - name: simple-number-sets tag: number-sets match: "count(*)=0" replace: - bookmark: "@id" - test: - if: "text()='ℂ'" then: [{T: số phức}] - else_if: "text()='ℕ'" then: [{T: số tự nhiên}] - else_if: "text()='ℚ'" then: [{T: số hữu tỷ}] - else_if: "text()='ℝ'" then: [{T: số thực}] - else_if: "text()='ℤ'" then: [{T: số nguyên}] else: [{x: text()}] # shouldn't happen - name: real-part tag: real-part match: "." replace: - bookmark: "@id" - T: phần thực - name: imaginary-part tag: imaginary-part match: "." replace: - bookmark: "@id" - T: phần giả lập # rules on scripted vertical bars ('evaluated at') - name: evaluated-at-2 tag: evaluate match: "count(*)=2" replace: - x: "*[1]" - pause: auto - T: được tính tại - pause: auto - x: "*[2]" - name: evaluated-at-3 tag: evaluate match: "count(*)=3" replace: - x: "*[1]" - pause: auto - T: được tính tại - pause: auto - x: "*[3]" - T: "trừ cùng biểu thức được tính tại" - x: "*[2]" - name: binomial tag: binomial match: "." replace: - x: "*[1]" - T: chọn - x: "*[2]" - name: permutation tag: permutation-symbol match: "." replace: - x: "*[2]" - T: hoán vị của - x: "*[1]" - name: intervals tag: [open-interval, open-closed-interval, closed-interval, closed-open-interval] match: "." replace: # if: "$Verbosity!='Terse'" # then: # - T: "the" - test: - if: "name(.)='open-interval'" then: [{T: "mở"}] - else_if: "name(.)='open-closed-interval'" then: [{T: "đóng mở"}] - else_if: "name(.)='closed-interval'" then: [{T: "được đóng"}] else: [{T: "mở đóng"}] # closed-open-interval - test: if: "$Verbosity!='Terse'" then: - T: "từ" - x: "*[2]" - T: "đến" - x: "*[3]" else: - x: "*[2]" - T: "phẩy" - x: "*[3]" - name: default-point tag: point match: "." replace: #- test: # if: "$Verbosity!='Terse'" # then: # - T: "the" - T: "điểm" - x: "*[1]" - T: "phẩy" - x: "*[2]" - name: absolute-value tag: absolute-value match: "." replace: - test: if: "$Verbosity='Terse'" then: [{T: "trị tuyệt đối"}] else: [{T: "trị tuyệt đối của"}] - x: "*[1]" - test: if: "IsNode(*[1], 'leaf') or $Impairment != 'Blindness'" then: [{pause: short}] else: [{pause: short}, {T: hết trị tuyệt đối}, {pause: short}] - name: negative tag: negative match: "." replace: - bookmark: "./@id" - T: "âm" - x: "*[1]" - name: positive tag: positive match: "." replace: - bookmark: "./@id" - T: "dương" - x: "*[1]" - name: subscript tag: sub match: "." replace: - x: "*[1]" - x: "*[2]" - T: " " - name: bigop-both tag: large-op match: "count(*) = 3" replace: # - test: # if: "$Verbosity!='Terse'" # then: [{T: the}] - x: "*[1]" # - test: - T: từ - x: "*[2]" - T: đến - x: "*[3]" - test: if: "following-sibling::*" then: [{T: của}] - name: bigop-under tag: large-op match: "." replace: # - test: # if: "$Verbosity!='Terse'" # then: [{T: the}] - x: "*[1]" - T: trên - x: "*[2]" - test: if: "following-sibling::*" then: [{T: của}] - name: largeop tag: mrow match: "count(*)=2 and IsInDefinition(*[1], 'LargeOperators')" replace: # - test: # if: "$Verbosity!='Terse'" # then: [{T: the}] - x: "*[1]" - T: của - x: "*[2]" - name: limit tag: limit match: "." replace: - test: if: "$Verbosity!='Terse'" then: [t: ""] # phrase('the' limit as x approaches 1) - test: - if: "*[1][.='lim']" then: [T: "lim"] - else_if: "*[1][.='limsup']" then_test: if: "$Verbosity='Terse'" then: [t: "lim sup"] else: [t: "limit superior"] - else_if: "*[1][.='liminf']" then_test: if: "$Verbosity='Terse'" then: [t: "lim inf"] else: [t: "limit inferior"] - else: [x: "*[1]"] - t: "" # phrase(the limit 'as' x approaches 1) - x: "*[2]" - name: vector tag: modified-variable match: "*[2][text()='→']" replace: - T: "véc tơ" - x: "*[1]" - name: default tag: modified-variable match: "." replace: - x: "*[1]" - x: "*[2]" - pause: short - name: default # handles single, double, etc., prime tag: [skip-super, say-super] match: "count(*)=2" replace: - x: "*[1]" - test: if: "name(.)='say-super'" then_test: if: "$Verbosity='Terse'" then: {T: chỉ số trên} else: {T: chỉ số trên} - x: "*[2]" - pause: short - name: msubsup-skip-super # handles single, double, etc., prime tag: [skip-super, say-super] match: "count(*)=3" replace: - x: "*[1]" - test: if: "$Verbosity='Terse'" then: {T: "chỉ số dưới"} else: {T: "chỉ số dưới"} - x: "*[2]" - test: if: "not(IsNode(*[2],'leaf'))" then: - test: if: "$Verbosity='Terse'" then: {T: "hết chỉ số dưới"} # (en: "end sub") else: {T: "hết chỉ số dưới"} # (en: "end subscript") - pause: short else_test: if: "*[2][self::m:mi]" # need a pause in "x sub k prime" so the prime is not associated with the 'k' then: [pause: short] - test: if: "name(.)='say-super'" then_test: if: "$Verbosity='Terse'" then: {T: "chỉ số trên"} else: {T: "chỉ số trên"} - x: "*[3]" - pause: short - name: sin tag: mi match: "text()='sin'" replace: - bookmark: "@id" - T: "sin" - name: cos tag: mi match: "text()='cos'" replace: - bookmark: "@id" - test: if: "$Verbosity='Terse'" then: {T: cô sin} else: {T: cô sin} - name: tan tag: mi match: "text()='tan' or text()='tg'" replace: - bookmark: "@id" - test: if: "$Verbosity='Terse'" then: {T: tang} else: {T: tang} - name: sec tag: mi match: "text()='sec'" replace: - bookmark: "@id" - test: if: "$Verbosity='Terse'" then: {T: sin đảo} else: {T: sin đảo} - name: csc tag: mi match: "text()='csc'" replace: - bookmark: "@id" - test: if: "$Verbosity='Terse'" then: {T: cô sin đảo} else: {T: cô sin đảo} - name: cot tag: mi match: "text()='cot'" replace: - bookmark: "@id" - test: if: "$Verbosity='Terse'" then: {T: cô tang} else: {T: cô tang} - name: sinh tag: mi match: "text()='sinh'" replace: - bookmark: "@id" - test: if: "$Verbosity='Terse'" then: {T: sin híp bơ bôn} else: {T: sin híp bơ bôn} - name: cosh tag: mi match: "text()='cosh'" replace: - bookmark: "@id" - test: if: "$Verbosity='Terse'" then: {T: cô sin híp bơ bôn} else: {T: cô sin híp bơ bôn} - name: tanh tag: mi match: "text()='tanh'" replace: - bookmark: "@id" - test: if: "$Verbosity='Terse'" then: {T: tang híp bơ bôn} else: {T: tang híp bơ bôn} - name: sech tag: mi match: "text()='sech'" replace: - bookmark: "@id" - test: if: "$Verbosity='Terse'" then: {T: xê can híp bơ bôn} else: {T: xê can híp bơ bôn} - name: csch tag: mi match: "text()='csch'" replace: - bookmark: "@id" - test: if: "$Verbosity='Terse'" then: {T: cô xê can híp bơ bôn} else: {T: cô xê can híp bơ bôn} - name: coth tag: mi match: "text()='coth'" replace: - bookmark: "@id" - test: if: "$Verbosity='Terse'" then: {T: cô tang híp bơ bôn} else: {T: cô tang híp bơ bôn} - name: arcsin tag: mi match: "text()='arcsin'" replace: - bookmark: "@id" - T: "ạt sin" - name: arccos tag: mi match: "text()='arccos'" replace: - bookmark: "@id" - T: "ạt cô sin" - name: arctan tag: mi match: "text()='arctan'" replace: - bookmark: "@id" - T: "ạt tang" - name: arccot tag: mi match: "text()='arccot'" replace: - bookmark: "@id" - T: "ạt cô tang" - # handle both log and ln name: log tag: mrow variables: [{log_is_simple: "IsNode(*[3],'simple')"}] match: - "count(*)=3 and" - "*[1][self::m:mi][text()='log' or text()='ln'] and" - "*[2][self::m:mo][text()='⁡']" replace: - bookmark: "*[1]/@id" - test: if: "$log_is_simple" then_test: - if: "*[1][text()='log']" then: [{T: lóc}] - else_if: "$Verbosity='Terse'" then: [{T: lóc nơ be}] else: [{T: lóc nơ be}] else: - test: if: "$Verbosity!='Terse' and not(log_is_simple)" then: {T: " "} - test: - if: "*[1][text()='log']" then: [{T: lóc}] - else_if: "$Verbosity='Terse'" then: [{T: lóc nơ be}] else: [{T: lóc nơ be}] - T: của - pause: short - x: "*[3]" - name: log-base tag: log-base match: "." replace: - bookmark: "@id" - T: lóc cơ số # - test: # if: "$Verbosity!='Terse'" # then: {T: the} - x: "*[1]" - name: log-base-power tag: log-base-power match: "not(@data-intent-property)" replace: - bookmark: "@id" - T: "lóc" # log - bookmark: "*[1]/@id" - test: - if: "*[2][text()=2]" then: [T: "bình phương"] - else_if: "*[2][text()=3]" then: [T: "lập phương"] else: - T: mũ - x: "*[2]" - T: "cơ số" # base - x: "*[1]" # supscript - pause: short - # that eliminates the need for the if: else_if: ... name: multi-line # IDEA: set a variable with the word to say for the row (e.g., RowLabel = Row/Case/Line/...) tag: [piecewise, system-of-equations, lines] match: "." variables: [IsColumnSilent: true()] replace: - x: "count(*)" - test: - if: "self::m:piecewise" then: [{T: "trường hợp"}] - else_if: "self::m:system-of-equations" then: [{T: "biểu thức"}] else: [{T: "dòng"}] #- test: #- if: "count(*) > 1" #then: [ct: "s"] # plural - pause: short - x: "*" - name: default-multiline tag: [mtr, mlabeledtr] match: "parent::m:piecewise or parent::m:system-of-equations or parent::m:lines" replace: - test: - if: "parent::m:piecewise" then: [{T: "trường hợp"}] - else_if: "parent::m:system-of-equations" then: [{T: "biểu thức"}] else: [{T: "dòng"}] - x: "count(preceding-sibling::*)+1" - test: if: .[self::m:mlabeledtr] then: - T: với - x: "*[1]/*" - pause: medium - test: if: .[self::m:mlabeledtr] then: [{x: "*[position()>1]"}] else: {x: "*"} - name: default-multiline tag: mtd match: "parent::*[parent::m:piecewise or parent::m:system-of-equations or parent::m:lines]" replace: - x: "*" - test: # short pause after each element; medium pause if last element in a row; long pause for last element in matrix - if: count(following-sibling::*) > 0 then: {pause: short} - else_if: count(../following-sibling::*) > 0 then: {pause: medium} else: {pause: long} # Matrix/Determinant rules # matrix and determinant are the same other than "matrix"/"determinant" based on the bracketing chars # the pausing logic is pushed down to the # the rules either speak the s (to get "row n") or the s. "column n" spoken if $IsColumnSilent is false - name: 1x1-matrix tag: [matrix, determinant] variables: [{IsColumnSilent: true()}] match: "count(*)=1 and *[self::m:mtr][count(*) = 1]" replace: - test: if: "self::m:determinant" # just need to check the first bracket since we know it must be (, [, or | then: {T: định thức} else: {T: ma trận} # - OT: the - T: "1 1" - T: có đầu vào là - x: "*[1]/*" # simpler reading methods for smaller matrices if the entries are simple - name: 2-or-3x1-matrix tag: matrix variables: [{IsColumnSilent: true()}] match: - "$ClearSpeak_Matrix != 'SpeakColNum' and " # "simple" isn't used for this preference - "*[self::m:mtr][count(*) = 1] and " # one column - count(*)<=3 and # at least two rows - IsNode(*/*/*,'simple') # IsNode() returns true if all the nodes are simple replace: - test: if: "$ClearSpeak_Matrix = 'Vector' or $ClearSpeak_Matrix = 'EndVector'" then: {T: véc tơ} else: {T: ma trận} # - T: the - x: count(*) - T: 1 cột - pause: long - x: "*/*" - test: if: "$ClearSpeak_Matrix = 'EndMatrix' or $ClearSpeak_Matrix = 'EndVector'" then: - T: "kết thúc" - test: if: $ClearSpeak_Matrix = 'EndVector' then: {T: véc tơ} else: {T: ma trận} - name: default-column-matrix tag: matrix variables: [{IsColumnSilent: true()}] match: "*[self::m:mtr][count(*) = 1]" replace: #- T: the - x: "count(*)" - T: nhân 1 cột - test: if: "$ClearSpeak_Matrix = 'Vector' or $ClearSpeak_Matrix = 'EndVector'" then: {T: véc tơ} else: {T: ma trận} - pause: long - x: "*" # select the rows (mtr) - test: if: "$ClearSpeak_Matrix = 'EndMatrix' or $ClearSpeak_Matrix = 'EndVector'" then: [{T: "hết ma trận"}] - name: 1x2-or-3-matrix tag: matrix variables: [{IsColumnSilent: "$SpeechStyle = 'ClearSpeak' and $ClearSpeak_Matrix != 'SpeakColNum'"}] match: - "$ClearSpeak_Matrix != 'SpeakColNum' and " # "simple" isn't used for this preference - count(*)=1 and # one row - count(*[1]/*)<=3 and # at least two cols - IsNode(*/*/*,'simple') # IsNode() returns true if all the nodes are simple replace: - T: 1 nhân - x: count(*/*) - T: "dòng" - test: if: "$ClearSpeak_Matrix = 'Vector' or $ClearSpeak_Matrix = 'EndVector'" then: {T: véc tơ} else: {T: ma trận} - pause: long - x: "*/*" - test: if: "$ClearSpeak_Matrix = 'EndMatrix' or $ClearSpeak_Matrix = 'EndVector'" then: - T: "hết" - test: if: $ClearSpeak_Matrix = 'EndMatrix' then: {T: ma trận} else: {T: véc tơ} - name: default-row-matrix tag: matrix variables: [{IsColumnSilent: "$SpeechStyle = 'ClearSpeak' and $ClearSpeak_Matrix = 'SilentColNum'"}] match: "count(*)=1" # one row replace: - test: if: "$ClearSpeak_Matrix = 'Vector' or $ClearSpeak_Matrix = 'EndVector'" then: {T: véc tơ} else: {T: ma trận} - T: một nhân - x: "count(*/*)" - T: "dòng" - pause: long - pause: medium - x: "*/*" # select the cols (mtd) - test: if: "$ClearSpeak_Matrix = 'EndMatrix' or $ClearSpeak_Matrix = 'EndVector'" then: - T: "hết" - test: if: $ClearSpeak_Matrix = 'EndMatrix' then: {T: ma trận} else: {T: véc tơ} - name: simple-small-matrix tag: [matrix, determinant] match: - "$ClearSpeak_Matrix != 'SpeakColNum' and " # "simple" isn't used for this preference - (count(*)<=3 and count(*[1]/*)<=3) and # no bigger than a 3x3 matrix - IsNode(*/*/*,'simple') # IsNode() returns true if all the nodes are simple variables: [{IsColumnSilent: "$SpeechStyle = 'ClearSpeak' and $ClearSpeak_Matrix != 'SpeakColNum'"}] replace: #- T: the - test: if: "self::m:determinant" then: {T: định thức} else: {T: ma trận} - x: count(*) - T: nhân - x: count(*[self::m:mtr][1]/*) - pause: long - x: "*" - test: if: "$ClearSpeak_Matrix = 'EndMatrix' or $ClearSpeak_Matrix = 'EndVector'" then: - T: hết - test: if: "self::m:determinant" then: {T: định thức} else: {T: ma trận} - name: default-matrix tag: [matrix, determinant] variables: [{IsColumnSilent: "$SpeechStyle = 'ClearSpeak' and $ClearSpeak_Matrix = 'SilentColNum'"}] match: "." replace: #- T: the - test: if: "self::m:determinant" then: {T: định thức} else: {T: ma trận} - x: "count(*)" - T: nhân - x: "count(*[self::m:mtr][1]/*)" - pause: long - x: "*" - test: if: "$ClearSpeak_Matrix = 'EndMatrix' or $ClearSpeak_Matrix = 'EndVector'" then: - T: hết - test: if: "self::m:determinant" then: {T: định thức} else: {T: ma trận} - name: chemistry-msub tag: [chemical-formula] match: "*[1][text()='msub']" replace: - x: "*[2]" - x: "*[3]" - test: if: "$Verbosity='Verbose'" then: [{T: "dưới"}] else_test: if: "$Verbosity='Medium'" then: [{T: ""}] #- x: "*[3]" - name: chemistry-msup tag: [chemical-formula] match: "*[1][text()='msup']" replace: - x: "*[2]" - x: "*[3]" - test: if: "$Verbosity='Verbose'" then: [{T: "trên"}] else_test: if: "$Verbosity='Medium'" then: [{T: ""}] #- x: "*[3]" - test: if: "following-sibling::*[1][text()='+' or text()='-']" # a little lazy -- assumes chemistry superscripts end with + or - then: [{pause: medium}] - # Instead, we just deal with up to two prescripts and up to four postscripts (repeating blocks of similar code [UGLY!]) # This hopefully covers all reasonable cases... name: chemistry-scripts # There currently is no way to do sub/super for n-ary number of args tag: [chemical-formula, chemical-nuclide] variables: # computing the number of postscripts is messy because of being optionally present -- we use "mod" to get the count right - Prescripts: "m:mprescripts/following-sibling::*" - NumChildren: "count(*)" # need to stash this since the count is wrong inside '*[...]' below - Postscripts: "*[position()>1 and position() < (last() + ($NumChildren mod 2) -count($Prescripts))]" match: . # should only be msubsup or mmultiscripts at this point replace: - test: if: "$Prescripts" # we have at least one pre sub/super then: # nuclide: speak the superscript first - test: if: "not($Prescripts[2][self::m:none])" then: - x: "$Prescripts[2]" - test: if: "$Verbosity='Verbose'" then: [{T: "trên"}] else_test: if: "$Verbosity='Medium'" then: [{T: ""}] #- x: "$Prescripts[2]" - pause: "short" - test: if: "not($Prescripts[1][self::m:none])" then: - x: "$Prescripts[1]" - test: if: "$Verbosity='Verbose'" then: [{T: "dưới"}] else_test: if: "$Verbosity='Medium'" then: [{T: ""}] #- x: "$Prescripts[1]" - pause: "short" - test: if: "count($Prescripts) > 2" # can this happen for chemistry??? we allow for one *extra* pre sub/super pair then: - test: if: "not($Prescripts[4][self::m:none])" then: - x: "$Prescripts[4]" - test: if: "$Verbosity='Verbose'" then: [{T: "trên"}] else_test: if: "$Verbosity='Medium'" then: [{T: ""}] #- x: "$Prescripts[4]" - pause: "short" - test: if: "not($Prescripts[3][self::m:none])" then: - x: "$Prescripts[3]" - test: if: "$Verbosity='Verbose'" then: [{T: "dưới"}] else_test: if: "$Verbosity='Medium'" then: [{T: ""}] #- x: "$Prescripts[3]" - pause: "short" - x: "*[1]" # base - test: if: "$Postscripts" then: - test: if: "not($Postscripts[1][self::m:none])" then: - x: "$Postscripts[1]" - test: if: "$Verbosity='Verbose' and not(self::m:chemical-formula)" then: [{T: "dưới"}] else_test: if: "$Verbosity='Medium'" then: [{T: ""}] #- x: "$Postscripts[1]" - pause: "short" - test: if: "not($Postscripts[2][self::m:none])" then: - x: "$Postscripts[2]" - test: if: "$Verbosity='Verbose' and not(self::m:chemical-formula)" then: [{T: "trên"}] else_test: if: "$Verbosity='Medium'" then: [{T: ""}] #- x: "$Postscripts[2]" - pause: "short" - test: if: "count($Postscripts) > 2" then: - test: if: "not($Postscripts[3][self::m:none])" then: - x: "$Postscripts[3]" - test: if: "$Verbosity='Verbose' and not(self::m:chemical-formula)" then: [{T: "dưới"}] else_test: if: "$Verbosity='Medium'" then: [{T: ""}] #- x: "$Postscripts[3]" - pause: "short" - test: if: "not($Postscripts[4][self::m:none])" then: - x: "$Postscripts[4]" - test: if: "$Verbosity='Verbose' and not(self::m:chemical-formula)" then: [{T: "trên"}] else_test: if: "$Verbosity='Medium'" then: [{T: ""}] #- x: "$Postscripts[4]" - pause: "short" - test: if: "count($Postscripts) > 4" then: - test: if: "not($Postscripts[5][self::m:none])" then: - x: "$Postscripts[5]" - test: if: "$Verbosity='Verbose' and not(self::m:chemical-formula)" then: [{T: "dưới"}] else_test: if: "$Verbosity='Medium'" then: [{T: ""}] #- x: "$Postscripts[5]" - pause: "short" - test: if: "not($Postscripts[6][self::m:none])" then: - x: "$Postscripts[6]" - test: if: "$Verbosity='Verbose' and not(self::m:chemical-formula)" then: [{T: "trên"}] else_test: if: "$Verbosity='Medium'" then: [{T: ""}] #- x: "$Postscripts[6]" - pause: "short" - test: if: "count($Postscripts) > 6" then: - test: if: "not($Postscripts[7][self::m:none])" then: - x: "$Postscripts[7]" - test: if: "$Verbosity='Verbose' and not(self::m:chemical-formula)" then: [{T: "dưới"}] else_test: if: "$Verbosity='Medium'" then: [{T: ""}] #- x: "$Postscripts[7]" - pause: "short" - test: if: "not($Postscripts[8][self::m:none])" then: - x: "$Postscripts[8]" - test: if: "$Verbosity='Verbose' and not(self::m:chemical-formula)" then: [{T: "trên"}] else_test: if: "$Verbosity='Medium'" then: [{T: ""}] #- x: "$Postscripts[8]" - pause: "short" - test: if: "$Postscripts[last()][not(self::m:none)] and following-sibling::*[1][text()='+' or text()='-']" then: [{pause: medium}] - name: chemistry tag: chemical-equation match: "." replace: - x: "*" - name: chemical-element tag: chemical-element match: "." replace: - bookmark: "@id" - spell: text() - pause: short - name: chemical-state tag: chemical-state match: "." replace: - bookmark: "*[1]/@id" - test: - if: ".='s'" then: [{T: "thể rắn"}] - else_if: ".='l'" then: [{T: "thể lỏng"}] - else_if: ".='g'" then: [{T: "thể khí"}] else: [{T: "thể lỏng"}] # (aq) - pause: short - name: chemical-formula-operator-bond tag: chemical-formula-operator match: "@data-chemical-bond" replace: # FIX: this might be better/more efficient if in unicode.yaml - bookmark: "@id" - test: - if: "text()='-' or text() = ':'" then: [{T: "nối đơn"}] # phrase(a 'single bond' is formed when two atoms share one pair of electrons) - else_if: "text()='=' or text() = '∷'" then: [{T: "nối đôi"}] # phrase(a 'double bond' may occur when two atoms share two pairs of electrons) - else_if: "text()='≡'" then: [{T: "nối ba"}] # phrase(a 'triple bond' occurs when two atoms share three pairs of electrons) - else_if: "text()='≣'" then: [{T: "nối bốn"}] # phrase(a 'quadruple bond' occurs when two atoms share four pairs of electrons) else: [{x: "text()"}] - name: chemical-formula-operator tag: chemical-formula-operator match: "." replace: x: "text()" - name: chemical-arrow-operator tag: chemical-arrow-operator match: "." replace: # FIX: this might be better/more efficient if in unicode.yaml - bookmark: "@id" - test: - if: ".='→' or .='⟶'" then_test: if: "$Verbosity='Terse'" then: [{T: "cho ra"}] # phrase(hydrogen and oxygen 'forms' water ) else: [{T: "phản ứng cho ra"}] # phrase(hydrogen and oxygen 'reacts to form' water) - else_if: ".='⇌' or .='\u1f8d2'" then: [{T: "mũi tên hai chiều"}] # phrase(a reactant 'is in equilibrium with' a product) - else_if: ".='\u1f8d4'" then: [{T: "mũi tên chiều bên trái"}] # phrase(the reactant 'is in equilibrium biased to the left with' the product) - else_if: ".='\u1f8d3'" then: [{T: "mũi tên chiều bên phải"}] # phrase(the reactant 'is in equilibrium biased to the right with' the product) else: [x: "*"] - name: chemical-equation-operator tag: chemical-equation-operator match: "." replace: - bookmark: "@id" - x: "text()" - name: none tag: none match: "../../*[self::m:chemical-formula or self::m:chemical-nuclide]" replace: - T: "" # don't say anything - name: ignore-intent-wrapper tag: intent-wrapper match: "." replace: - x: "*"