diff --git a/Rules/Languages/ru/ClearSpeak_Rules.yaml b/Rules/Languages/ru/ClearSpeak_Rules.yaml index e4754c95..fc66c64c 100644 --- a/Rules/Languages/ru/ClearSpeak_Rules.yaml +++ b/Rules/Languages/ru/ClearSpeak_Rules.yaml @@ -1,4 +1,11 @@ --- +- name: capital-letter-function-none + tag: mi + match: "string-length(.)=1 and contains('ABCDEFGHIJKLMNOPQRSTUVWXYZ', text()) and $ClearSpeak_Functions='None' and following-sibling::*[1][.='⁢' and @data-function-guess]" + replace: + - x: "translate(text(), 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')" + - t: "большое" + - name: pause tag: "!*" match: "not(self::m:math) and not($MatchingPause) and @data-intent-property[contains(., ':pause')]" @@ -26,6 +33,12 @@ - t: "минус" - x: "translate(text(), '-_', '')" +- name: even-number-text + tag: mtext + match: "contains(., 'even') and contains(., 'number')" + replace: + - t: "x — чётное число" + - name: default tag: square-root match: "." @@ -33,14 +46,6 @@ - test: if: "$Verbosity!='Terse'" then: [t: ""] - - test: - if: $ClearSpeak_Roots = 'PosNegSqRoot' or $ClearSpeak_Roots = 'PosNegSqRootEnd' - then: - - bookmark: "*[1]/@id" - - test: - if: parent::*[self::m:minus and count(*)=1] - then: [t: "отрицательный"] - else: [t: "положительный"] - t: "квадратный корень" - test: if: "$Verbosity!='Terse'" @@ -54,7 +59,14 @@ - t: "конец корня" - pause: medium - else_if: "IsNode(*[1], 'simple')" - then: [pause: short] + then: + - test: + if: "(following-sibling::* or parent::m:minus/following-sibling::*) and $ClearSpeak_Roots = 'PosNegSqRoot'" + then: [pause: long] + - test: + if: "(following-sibling::* or parent::m:minus/following-sibling::*) and not($ClearSpeak_Roots = 'PosNegSqRoot')" + then: [pause: medium] + else: [pause: short] else: [pause: long] - name: default @@ -65,15 +77,11 @@ if: "$Verbosity!='Terse'" then: [t: ""] - test: - if: $ClearSpeak_Roots = 'PosNegSqRoot' or $ClearSpeak_Roots = 'PosNegSqRootEnd' - then: - - test: - if: "parent::*[(self::m:minus or self::m:plus) and count(*)=1]" - then: [bookmark: "parent/@id"] - - test: - if: parent::m:minus - then: [t: "отрицательный"] - else: [t: "положительный"] + if: "parent::m:minus and preceding::m:square-root and $ClearSpeak_Roots = 'PosNegSqRootEnd'" + then: [pause: short] + - test: + if: "*[2][.='3'] and $ClearSpeak_Roots = 'PosNegSqRootEnd'" + then: [pause: short] - test: if: "*[2][self::m:mn and not(contains(., '.'))]" then_test: @@ -81,56 +89,63 @@ then: [t: "квадратный корень"] - else_if: "*[2][.='3']" then: [t: "кубический корень"] - - else: [x: "ToOrdinal(*[2])", t: "степени"] + - else: [t: "корень", x: "ToOrdinal(*[2])", t: "степени"] else: - - test: - if: "*[2][self::m:mi][string-length(.)=1]" - then: - - x: "*[2]" - - pronounce: [{text: "-й"}, {ipa: "j"}, {sapi5: "y"}, {eloquence: "Y"}] - else: {x: "*[2]"} - - t: "корень" + - t: "корень степени" + - x: "*[2]" - test: if: "$Verbosity!='Terse'" then: [t: "из"] - x: "*[1]" - test: - if: $ClearSpeak_Roots = 'RootEnd' or $ClearSpeak_Roots = 'PosNegSqRootEnd' + if: "$ClearSpeak_Roots = 'RootEnd' or $ClearSpeak_Roots = 'PosNegSqRootEnd'" then: - pause: short - t: "конец корня" - pause: medium else_test: if: IsNode(*[1], 'simple') - then: [pause: short] + then: + - test: + if: "(following-sibling::* or parent::m:minus/following-sibling::*) and $ClearSpeak_Roots = 'PosNegSqRoot'" + then: [pause: long] + - test: + if: "(following-sibling::* or parent::m:minus/following-sibling::*) and not($ClearSpeak_Roots = 'PosNegSqRoot')" + then: [pause: medium] + else: [pause: short] else: [pause: long] - name: negative_and_positive tag: [plus, minus] match: "count(*)=1 and contains(@data-intent-property, ':prefix:')" replace: + - bookmark: "@id" - test: - if: - - "*[1][self::m:square-root or self::m:root] and" - - "($ClearSpeak_Roots = 'PosNegSqRoot' or $ClearSpeak_Roots = 'PosNegSqRootEnd')" - then: {t: ""} - else: - - bookmark: "@id" - - test: - if: "self::m:minus" - then: [t: "отрицательный"] - else: [t: "положительный"] + if: "self::m:minus" + then: [t: "минус"] + else: [t: "плюс"] + - test: + if: "self::m:minus and *[1][self::m:root] and $ClearSpeak_Roots = 'PosNegSqRootEnd'" + then: [pause: short] - x: "*[1]" - name: per-fraction tag: fraction - match: "$ClearSpeak_Fractions='Per' or - BaseNode(*[1])[contains(@data-intent-property, ':unit') or (self::m:mrow and self::*[3][contains(@data-intent-property, ':unit')])] and - BaseNode(*[1])[contains(@data-intent-property, ':unit') or (self::m:mrow and self::*[3][contains(@data-intent-property, ':unit')])]" + match: + - "$ClearSpeak_Fractions='Per' or" + - "(BaseNode(*[1])[contains(@data-intent-property, ':unit') or" + - " (self::m:mrow and count(*)=3 and *[1][self::m:mn] and *[2][.='⁢'] and BaseNode(*[3])[contains(@data-intent-property, ':unit')])] and" + - " BaseNode(*[2])[contains(@data-intent-property, ':unit')])" replace: - x: "*[1]" - - t: "в" - - x: "*[2]" + - test: + if: "BaseNode(*[2])[contains(@data-intent-property, ':unit')] and BaseNode(*[2])[.='h' or .='hr' or .='Hr']" + then: [t: "в"] + else: [t: "на"] + - test: + if: "BaseNode(*[2])[contains(@data-intent-property, ':unit')] and BaseNode(*[2])[.='mi']" + then: [t: "милю"] + else: [x: "*[2]"] - name: common-fraction tag: fraction @@ -140,7 +155,10 @@ - "*[2][self::m:mn][not(contains(., '.')) and ($ClearSpeak_Fractions='Ordinal' or (2<= text() and text()<=10))]" variables: [IsPlural: "*[1]!=1"] replace: - - x: "*[1]" + - test: + - if: "DefinitionValue(*[1], 'Speech', 'FractionNumerators') != ''" + then: [x: "DefinitionValue(*[1], 'Speech', 'FractionNumerators')"] + else: [x: "*[1]"] - x: "ToOrdinal(*[2], true(), $IsPlural)" - name: common-fraction-mixed-number @@ -152,7 +170,10 @@ - "*[2][self::m:mn][not(contains(., '.')) and ($ClearSpeak_Fractions='Ordinal' or (2<= text() and text()<=10))]" variables: [IsPlural: "*[1]!=1"] replace: - - x: "*[1]" + - test: + - if: "DefinitionValue(*[1], 'Speech', 'FractionNumerators') != ''" + then: [x: "DefinitionValue(*[1], 'Speech', 'FractionNumerators')"] + else: [x: "*[1]"] - x: "ToOrdinal(*[2], true(), $IsPlural)" - name: fraction-over-simple @@ -170,7 +191,7 @@ then: [ot: ""] - t: "дробь" - x: "*[1]" - - t: "деленное на" + - t: "на" - x: "*[2]" - test: if: "$ClearSpeak_Fractions='OverEndFrac' or ($ClearSpeak_Fractions='EndFrac' and not( ($ClearSpeak_Fractions='Auto' or $ClearSpeak_Fractions='Ordinal' or $ClearSpeak_Fractions='EndFrac') and *[1][*[1][self::m:mn][not(contains(., '.')) and ($ClearSpeak_Fractions='Ordinal' or text()<20)] and *[2][self::m:mn][not(contains(., '.')) and ($ClearSpeak_Fractions='Ordinal' or (2<= text() and text()<=10))] ] and *[2][*[1][self::m:mn][not(contains(., '.')) and ($ClearSpeak_Fractions='Ordinal' or text()<20)] and *[2][self::m:mn][not(contains(., '.')) and ($ClearSpeak_Fractions='Ordinal' or (2<= text() and text()<=10))] ] ) )" @@ -197,7 +218,7 @@ - ")" replace: - x: "*[1]" - - t: "деленное на" + - t: "на" - x: "*[2]" - test: if: "$ClearSpeak_Fractions='EndFrac' or $ClearSpeak_Fractions='OverEndFrac'" @@ -211,13 +232,13 @@ match: "." replace: - ot: "" - - t: "дробь: числитель" - - test: - if: not(IsNode(*[1], 'simple')) - then: [pause: medium] + - t: "дробь, числитель:" - x: "*[1]" - pause: medium - - t: "знаменатель" + - test: + if: "*[2][self::m:fraction or self::m:mrow[m:fraction]]" + then: [t: "и знаменатель:"] + else: [t: "знаменатель:"] - x: "*[2]" - pause: long - test: @@ -232,12 +253,17 @@ match: "." replace: - test: - if: $ClearSpeak_Trig = 'TrigInverse' - then: [{x: "*[1]"}, {bookmark: "*[2]/@id"}, t: "обратное"] - else_test: - if: $ClearSpeak_Trig = 'ArcTrig' - then: [bookmark: "*[2]/@id", t: "арка", x: "*[1]"] - else: [bookmark: "*[2]/@id", t: "обратное", x: "*[1]"] + - if: $ClearSpeak_Trig = 'TrigInverse' + then: + - t: "обратный" + - x: "*[1]" + - else_if: "*[1][.='sin']" + then: [bookmark: "*[2]/@id", t: "арксинус"] + - else_if: "*[1][.='cos' or .='cosh']" + then: [bookmark: "*[2]/@id", t: "ареакосинус"] + - else_if: "*[1][.='tan' or .='tg']" + then: [bookmark: "*[2]/@id", t: "арктангенс"] + else: [bookmark: "*[2]/@id", t: "обратный", x: "*[1]"] - name: function-squared-or-cubed tag: power @@ -257,17 +283,20 @@ match: - "following-sibling::*[1][self::m:mo][.='⁡']" replace: - - test: - if: "$Verbosity!='Terse'" - then: [t: ""] + - x: "*[1]" - bookmark: "*[2]/@id" + - t: "в" - test: - if: "*[2][self::m:mn][not(contains(., '.'))]" + - if: "*[2][self::m:mn][.='4']" + then: [t: "четвёртой"] + - else_if: "*[2][self::m:mn][not(contains(., '.'))]" then: [x: "ToOrdinal(*[2])"] - else: [x: "*[2]"] - - t: "степени" - - pause: short - - x: "*[1]" + else: + - t: "степени" + - x: "*[2]" + - test: + if: "*[2][self::m:mn][not(contains(., '.'))]" + then: [t: "степени"] - name: AfterPower-nested tag: power @@ -276,20 +305,21 @@ - "*[2][self::m:power or self::m:power or self::m:mrow[m:power]]" replace: - x: "*[1]" - - t: "возведено в степень" - - pause: short + - t: "в степени (показатель:" - x: "*[2]" - - pause: medium - - t: "конец степени" + - pause: short + - t: "конец показателя)" - name: AfterPower-default tag: power match: "$ClearSpeak_Exponents = 'AfterPower'" replace: - x: "*[1]" - - t: "возведено в степень" - - x: "*[2]" - - pause: short + - t: "в степени" + - test: + if: "*[2][self::m:mn][contains(., '.')]" + then: [x: "*[2]/text()"] + else: [x: "*[2]"] - name: squared tag: power @@ -313,17 +343,19 @@ replace: - x: "*[1]" - test: - if: "*[2][.>0]" + if: "*[2][.>=0]" then: - - t: "в" + - test: + if: "*[2][.='2']" + then: [t: "во"] + else: [t: "в"] - x: "ToOrdinal(*[2])" - - t: "степени" + - test: + if: "$ClearSpeak_Exponents != 'Ordinal'" + then: [t: "степени"] else: - t: "в степени" - x: "*[2]" - - test: - if: "$ClearSpeak_Exponents != 'Ordinal' and *[2][.>0]" - then: [t: ""] - name: simple-negative-integer tag: power @@ -343,7 +375,6 @@ - x: "*[1]" - t: "в степени" - x: "*[2]" - - pronounce: [{text: "-й"}, {ipa: "j"}, {sapi5: "y"}, {eloquence: "Y"}] - name: nested-squared-or-cubed tag: power @@ -358,10 +389,8 @@ - " ]" replace: - x: "*[1]" - - test: - if: "*[2]/*[2][.='2']" - then: [t: "во вторую степень"] - else: [t: "в третью степень"] + - t: "в степени" + - x: "*[2]" - name: nested-negative-squared-or-cubed tag: power @@ -378,10 +407,9 @@ - " ]" replace: - x: "*[1]" - - test: - if: "*[2]/*[1]/*[2][.='2']" - then: [t: "во вторую степень"] - else: [t: "в третью степень"] + - t: "в степени" + - t: "минус" + - x: "*[2]/*[1]" - name: nested-var-squared-or-cubed tag: power @@ -400,10 +428,8 @@ - " ]" replace: - x: "*[1]" - - test: - if: "*[2]/*[3]/*[2][.='2']" - then: [t: "во вторую степень"] - else: [t: "в третью степень"] + - t: "в степени" + - x: "*[2]" - name: nested-negative-var-squared-or-cubed tag: power @@ -424,10 +450,8 @@ - " ]" replace: - x: "*[1]" - - test: - if: "*[2]/*[3]/*[2][.='2']" - then: [t: "во вторую степень"] - else: [t: "в третью степень"] + - t: "в степени" + - x: "*[2]" - name: default-exponent-power tag: power @@ -435,11 +459,10 @@ - "*[2][self::m:power or self::m:power or self::m:mrow[m:power]]" replace: - x: "*[1]" - - t: "возведено в степень" - - pause: short + - t: "в степени (показатель:" - x: "*[2]" - pause: short - - t: "конец степени" + - t: "конец показателя)" - name: default tag: power @@ -447,31 +470,41 @@ replace: - x: "*[1]" - t: "в степени" - - x: "*[2]" + - test: + if: "*[2][self::m:mn][contains(., '.')]" + then: [x: "*[2]/text()"] + else: [x: "*[2]"] - name: ClearSpeak-absolute-value tag: absolute-value match: "." replace: - test: - if: "$Verbosity!='Terse'" - then: [t: ""] - - test: - if: "$ClearSpeak_AbsoluteValue = 'Cardinality'" - then: [t: "мощность множества"] - else: [t: "модуль"] - - t: "из" - - x: "*[1]" - - test: - if: "$ClearSpeak_AbsoluteValue = 'AbsEnd'" + if: "ancestor::*[name()='set']" then: - - pause: short - - t: "конец" - - test: - if: "$ClearSpeak_AbsoluteValue = 'Cardinality'" - then: [t: "мощности множества"] - else: [t: "модуля"] - - pause: short + - t: "модуль" + - x: "*[1]" + - pause: medium + else: + - test: + if: "$Verbosity!='Terse'" + then: [t: ""] + - test: + if: "$ClearSpeak_AbsoluteValue = 'Cardinality'" + then: [t: "мощность множества"] + else: [t: "модуль"] + - t: "из" + - x: "*[1]" + - test: + if: "$ClearSpeak_AbsoluteValue = 'AbsEnd'" + then: + - pause: short + - t: "конец" + - test: + if: "$ClearSpeak_AbsoluteValue = 'Cardinality'" + then: [t: "мощности множества"] + else: [t: "модуля"] + - pause: short - name: set tag: set @@ -486,6 +519,66 @@ if: "$Verbosity!='Terse'" then: [t: ""] - t: "пустое множество" + - else_if: "count(*)>=7 and *[2][.='∈'] and *[4][.=':' or .='|' or .='∣']" + then: + - test: + if: "$Verbosity!='Terse'" + then: [t: ""] + - t: "множество" + - test: + if: $ClearSpeak_Sets != 'woAll' + then: [t: "всех"] + - x: "*[1]" + - test: + - if: "$ClearSpeak_SetMemberSymbol='Belongs'" + then: + - pause: short + - t: "входящих в" + - test: + - if: "*[3][.='ℤ']" + then: [t: "целые числа"] + - else: [x: "*[3]"] + - else_if: "$ClearSpeak_SetMemberSymbol='Element'" + then: + - pause: short + - t: "являющихся элементами" + - test: + - if: "*[3][.='ℤ']" + then: [t: "целых чисел"] + - else: [x: "*[3]"] + - else_if: "$ClearSpeak_SetMemberSymbol='Auto' or $ClearSpeak_SetMemberSymbol='Member'" + then: + - pause: short + - t: "принадлежащих" + - test: + - if: "*[3][.='ℤ']" + then: [t: "целым числам"] + - else: [x: "*[3]"] + - else: + - t: "из" + - test: + - if: "*[3][.='ℤ']" + then: [t: "целых чисел"] + - else: [x: "*[3]"] + - pause: short + - t: "таких что" + - x: "*[position()>4]" + - else_if: "count(*)=3 and *[1][self::m:mrow and count(*)=3 and *[2][.='∈']] and *[2][.='|' or .='∣']" + then: + - test: + if: "$Verbosity!='Terse'" + then: [t: ""] + - t: "множество" + - test: + if: $ClearSpeak_Sets != 'woAll' + then: [t: "всех"] + - x: "*[1]" + - pause: short + - t: "таких что" + - test: + - if: "*[3][self::m:mrow and count(*)=2 and *[2][self::m:mtext[contains(., 'even number')]]]" + then: [x: "*[3]/*[2]"] + - else: [x: "*[3]"] - else_if: "count(*[1]/*)=3 and *[1]/*[2][self::m:mo][.=':' or .='|' or .='∣']" then: - test: @@ -495,9 +588,28 @@ - test: if: $ClearSpeak_Sets != 'woAll' then: [t: "всех"] - - x: "*[1]/*[1]" - - t: "таких, что" - - x: "*[1]/*[3]" + - test: + if: "*[1]/*[1][self::m:mi[.='x']]" + then: [t: "x"] + else: [x: "*[1]/*[1]"] + - test: + if: "*[1]//*[.='∈']" + then: [t: "таких что"] + else: [t: "таких, что"] + - test: + - if: "*[1]/*[3][self::m:mrow and count(*)=3 and *[1][self::m:mi[.='x']]]" + then: + - t: "икс" + - x: "*[1]/*[3]/*[2]" + - x: "*[1]/*[3]/*[3]" + - else_if: "*[1]/*[3][self::m:mrow and count(*)=3 and *[1]//*[name()='absolute-value']]" + then: + - t: "модуль" + - t: "икс" + - pause: medium + - x: "*[1]/*[3]/*[2]" + - x: "*[1]/*[3]/*[3]" + - else: [x: "*[1]/*[3]"] else: - test: if: $ClearSpeak_Sets != 'SilentBracket' @@ -516,16 +628,24 @@ match: "." replace: - t: "интервал от" - - x: "*[1]" + - test: + if: "$is_intervals_start_infinity" + then: [t: "минус бесконечности"] + else: [x: "*[1]"] - t: "до" - - x: "*[2]" + - test: + - if: "*[2][self::m:plus and count(*)=1 and *[1][.='∞']]" + then: [t: "плюс бесконечности"] + - else_if: "*[2][.='∞']" + then: [t: "бесконечности"] + else: [x: "*[2]"] - pause: short - test: if: "not($is_intervals_start_infinity)" then: - test: if: "starts-with(name(.), 'open')" - then: [t: "исключая"] + then: [t: "не включая"] else: [t: "включая"] - x: "*[1]" - test: @@ -535,7 +655,7 @@ then: [t: "и"] - else_if: "name(.)='closed-interval'" then: [t: "и"] - else: [t: "но"] + else: [pause: short, t: "но"] - test: if: not($is_intervals_end_infinity) then: @@ -544,7 +664,7 @@ then: - test: if: "name(.) = 'open-interval' or name(.) = 'closed-open-interval'" - then: [t: "исключая"] + then: [t: "не включая"] else: [t: "включая"] - x: "*[2]" @@ -579,6 +699,44 @@ then: [x: "*[position()>1]"] else: {x: "*"} +- name: equality-with-root + tag: mrow + match: + - "count(*)=3 and *[2][.='='] and" + - "(*[1][self::m:mrow[m:square-root or m:root or m:msqrt or m:mroot]] or" + - " *[3][self::m:square-root or self::m:root or self::m:msqrt or self::m:mroot])" + replace: + - x: "*[1]" + - pause: medium + - x: "*[2]" + - pause: short + - x: "*[3]" + +- name: equality-with-none-implied-times + tag: mrow + match: + - "count(*)=3 and *[2][.='='] and" + - "$ClearSpeak_ImpliedTimes='None' and $ClearSpeak_Functions='None' and" + - "*[3][self::m:mrow[*[2][.='⁢']]]" + replace: + - x: "*[1]" + - pause: medium + - x: "*[2]" + - pause: medium + - x: "*[3]" + +- name: functions-none-plus + tag: mrow + match: + - "count(*)=3 and *[2][.='+'] and $ClearSpeak_Functions='None' and" + - "*[1][self::m:mrow[*[2][.='⁡']]] and *[3][self::m:mrow[*[2][.='⁡']]]" + replace: + - x: "*[1]" + - pause: medium + - x: "*[2]" + - pause: short + - x: "*[3]" + - name: ClearSpeak-log tag: mrow variables: [{log_is_simple: "IsNode(*[3],'simple')"}] @@ -594,7 +752,7 @@ then: [t: "логарифм"] - else_if: $ClearSpeak_Log = 'LnAsNaturalLog' then: [t: "натуральный логарифм"] - else: [t: "натуральный логарифм"] + else: [t: "эл эн"] else: - test: if: "$Verbosity!='Terse' and not(log_is_simple)" @@ -604,11 +762,114 @@ then: [t: "логарифм"] - else_if: $ClearSpeak_Log = 'LnAsNaturalLog' then: [t: "натуральный логарифм"] - else: [t: "натуральный логарифм"] + else: [t: "эл эн"] - t: "от" - - pause: short - x: "*[3]" +- name: ClearSpeak-log-with-base + tag: mrow + match: "count(*)=3 and *[1][self::m:logarithm-with-base] and *[2][.='⁡']" + replace: + - t: "логарифм" + - x: "*[3]" + - pause: short + - t: "по основанию" + - x: "*[1]/*[1]" + +- name: trig-function-noninteger-power + tag: mrow + match: + - "count(*)=3 and *[1][self::m:power and IsInDefinition(*[1], 'TrigFunctionNames') and not(*[2][self::m:mn])] and" + - "*[2][.='⁡']" + replace: + - x: "*[1]/*[1]" + - x: "*[3]" + - t: "в степени" + - x: "*[1]/*[2]" + +- name: simple-parens-after-apply-or-times + tag: mrow + match: + - "IsBracketed(., '(', ')') and IsNode(*[2], 'simple') and " + - "preceding-sibling::*[1][(.='⁡' and not($ClearSpeak_Functions='None')) or (.='⁢' and not(@data-function-guess))]" + replace: + - x: "*[2]" + +- name: functions-none-comma-arguments + tag: mrow + match: + - "count(*)=3 and *[2][.=','] and $ClearSpeak_Functions='None' and" + - "parent::*[self::m:mrow and IsBracketed(., '(', ')') and preceding-sibling::*[1][.='⁢' and @data-function-guess]]" + replace: + - x: "*[1]" + - t: "запятая" + - x: "*[3]" + +- name: function-argument-parens + tag: mrow + match: + - "IsBracketed(., '(', ')') and " + - "(preceding-sibling::*[1][.='⁡'] or preceding-sibling::*[2][self::m:mi])" + replace: + - test: + if: "not(IsNode(*[2], 'simple')) and + (.//m:mo[.='+'] or preceding-sibling::*[1][@data-function-guess and $ClearSpeak_Functions='None']) and + not(preceding-sibling::*[2][self::m:logarithm-with-base])" + then: [pause: short] + - test: + if: "ancestor-or-self::*[contains(@data-intent-property, ':literal:')]" + then: [t: "открывающая круглая скобка"] + else_test: + - if: ".//m:mo[.='|' or .='∣' or .='∩'] or .//m:mtext[contains(., 'and')] or .//*[contains(name(.), 'given')]" + then: [t: "открывающая круглая скобка"] + - else_if: "ancestor::*[self::m:fraction] and not(IsNode(*[2], 'simple'))" + then: [t: "открывается скобка"] + - else: [t: "скобка открывается"] + - test: + if: ".//m:mo[.='|' or .='∣' or .='∩'] or .//m:mtext[contains(., 'and')] or .//*[contains(name(.), 'given')]" + then: [pause: short] + - x: "*[2]" + - test: + if: "not(IsNode(*[2], 'simple'))" + then: [pause: short] + - test: + if: "ancestor-or-self::*[contains(@data-intent-property, ':literal:')]" + then: [t: "закрывающая круглая скобка"] + else_test: + - if: ".//m:mo[.='|' or .='∣' or .='∩'] or .//m:mtext[contains(., 'and')] or .//*[contains(name(.), 'given')]" + then: [t: "закрывающая круглая скобка"] + - else_if: "ancestor::*[self::m:fraction] and not(IsNode(*[2], 'simple'))" + then: [t: "закрывается скобка"] + - else: [t: "скобка закрывается"] + - test: + if: "following-sibling::*[1][.='+' or .='=']" + then: [pause: medium] + +- name: exponent-argument-parens + tag: mrow + match: + - "IsBracketed(., '(', ')') and " + - "ancestor::*[self::m:power]" + replace: + - test: + if: "*[2][self::m:fraction]" + then: [pause: medium] + - test: + if: "$ClearSpeak_ImpliedTimes='MoreImpliedTimes'" + then: [t: "скобка"] + else: [t: "скобка открывается"] + - test: + if: "*[2][self::m:fraction]" + then: [pause: medium] + - x: "*[2]" + - test: + if: "*[2][self::m:fraction or .//m:mo[.='+' or .='-' or .='−']]" + then: [pause: short] + - test: + if: "$ClearSpeak_ImpliedTimes='MoreImpliedTimes'" + then: [t: "закрывается"] + else: [t: "скобка закрывается"] + - name: ClearSpeak-multi-line tag: [piecewise, system-of-equations, lines] match: "." @@ -623,20 +884,35 @@ - x: "$LineCount" - test: - if: "($ClearSpeak_MultiLineLabel = 'Auto' and self::m:piecewise) or $ClearSpeak_MultiLineLabel = 'Case'" - then: [t: "случай"] + then_test: + if: "$LineCount = 1" + then: [t: "случай"] + else: [t: "случая"] - else_if: "$ClearSpeak_MultiLineLabel = 'Auto' or $ClearSpeak_MultiLineLabel = 'Line' or $ClearSpeak_MultiLineLabel = 'None'" - then: [t: "строка"] + then_test: + if: "$LineCount = 1" + then: [t: "строка"] + else: [t: "строки"] - else_if: "$ClearSpeak_MultiLineLabel = 'Constraint'" - then: [t: "ограничение"] + then_test: + if: "$LineCount = 1" + then: [t: "ограничение"] + else: [t: "ограничения"] - else_if: "$ClearSpeak_MultiLineLabel = 'Equation'" - then: [t: "уравнение"] + then_test: + if: "$LineCount = 1" + then: [t: "уравнение"] + else: [t: "уравнения"] - else_if: "$ClearSpeak_MultiLineLabel = 'Row'" - then: [t: "строка"] + then_test: + if: "$LineCount = 1" + then: [t: "строка"] + else: [t: "строки"] - else_if: "$ClearSpeak_MultiLineLabel = 'Step'" - then: [t: "шаг"] - - test: - - if: "$LineCount != 1" - then: [ct: "ов"] + then_test: + if: "$LineCount = 1" + then: [t: "шаг"] + else: [t: "шага"] - pause: short - x: "*" - pause: long @@ -652,17 +928,17 @@ - pause: medium - test: - if: "($ClearSpeak_MultiLineLabel = 'Auto' and parent::m:piecewise) or $ClearSpeak_MultiLineLabel = 'Case'" - then: [t: "случае"] + then: [t: "случай"] - else_if: "$ClearSpeak_MultiLineLabel = 'Auto' or $ClearSpeak_MultiLineLabel = 'Line'" - then: [t: "строке"] + then: [t: "строка"] - else_if: "$ClearSpeak_MultiLineLabel = 'Constraint'" - then: [t: "ограничении"] + then: [t: "ограничение"] - else_if: "$ClearSpeak_MultiLineLabel = 'Equation'" - then: [t: "уравнении"] + then: [t: "уравнение"] - else_if: "$ClearSpeak_MultiLineLabel = 'Row'" - then: [t: "строке"] + then: [t: "строка"] - else_if: "$ClearSpeak_MultiLineLabel = 'Step'" - then: [t: "шаге"] + then: [t: "шаг"] - x: "count(preceding-sibling::*[not(contains(@data-intent-property, ':continued-row:'))]) + 1" - test: if: "self::m:mlabeledtr" @@ -695,7 +971,17 @@ match: - ".='⁢' and $ClearSpeak_ImpliedTimes = 'None'" replace: - - t: "" + - test: + - if: "preceding-sibling::*[1][self::m:mrow and (IsBracketed(., '(', ')') or IsBracketed(., '[', ']'))]" + then: [pause: medium] + - else_if: "following-sibling::*[1][self::m:mrow and (IsBracketed(., '(', ')') or IsBracketed(., '[', ']'))] and not(preceding-sibling::*[1][self::m:mi])" + then: [pause: short] + +- name: no-times-before-exponent-brackets + tag: mo + match: ".='⁢' and ancestor::*[self::m:power] and following-sibling::*[1][IsBracketed(., '(', ')')]" + replace: + - pause: medium - name: ClearSpeak-times tag: mo @@ -722,6 +1008,9 @@ - " )" replace: - t: "умножить на" + - test: + if: "@data-function-guess and following-sibling::*[1][self::m:mrow and IsBracketed(., '(', ')')] and not($ClearSpeak_Functions='None')" + then: [pause: short] - name: no-say-parens tag: mrow @@ -734,12 +1023,43 @@ - "not( $ClearSpeak_ImpliedTimes = 'None' and " - " (preceding-sibling::*[1][.='⁢'] or following-sibling::*[1][.='⁢']) ) and " - "IsNode(*[2], 'simple') and" + - "not(preceding-sibling::*[1][self::m:mi]) and" - "not(preceding-sibling::*[1][.='\u2062' and @data-function-guess]) and" - "not(ancestor-or-self::*[contains(@data-intent-property, ':literal:')])" replace: - x: "*[2]" +- name: say-bracketed-mrow + tag: mrow + match: "IsBracketed(., '(', ')') or IsBracketed(., '[', ']')" + replace: + - test: + if: "preceding-sibling::*[1][self::m:mi] or preceding-sibling::*[1][.='⁢' and @data-function-guess and $ClearSpeak_Functions='None']" + then: [pause: short] + - test: + if: "IsBracketed(., '[', ']')" + then: [t: "квадратная скобка открывается"] + else_test: + if: "ancestor-or-self::*[contains(@data-intent-property, ':literal:')] or .//m:mo[.='|' or .='∩'] or .//*[contains(., 'and')]" + then: [t: "открывающая круглая скобка"] + else: [t: "скобка открывается"] + - x: "*[2]" + - test: + if: "IsBracketed(., '(', ')') and .//m:mo[.='+' or .='-' or .='−']" + then: [pause: short] + - test: + if: "IsBracketed(., '[', ']')" + then: [t: "квадратная скобка закрывается"] + else_test: + if: "ancestor-or-self::*[contains(@data-intent-property, ':literal:')] or .//m:mo[.='|' or .='∩'] or .//*[contains(., 'and')]" + then: [t: "закрывающая круглая скобка"] + else: [t: "скобка закрывается"] + - test: + if: "following-sibling::*[1][.='+' or .='=']" + then: [pause: medium] + - include: "SharedRules/geometry.yaml" - include: "SharedRules/linear-algebra.yaml" +- include: "SharedRules/calculus.yaml" - include: "SharedRules/general.yaml" - include: "SharedRules/default.yaml" diff --git a/Rules/Languages/ru/SharedRules/calculus.yaml b/Rules/Languages/ru/SharedRules/calculus.yaml index 07e06205..76fce80f 100644 --- a/Rules/Languages/ru/SharedRules/calculus.yaml +++ b/Rules/Languages/ru/SharedRules/calculus.yaml @@ -22,12 +22,18 @@ replace: - test: if: "$Verbosity='Terse'" - then: [t: "div"] # phrase('div' is short for divergence) -- note OneCore voices spell out "div" + then: [t: "див"] # phrase('div' is short for divergence) else: [t: "дивергенция"] # phrase('divergence of' this function from the mean) + - test: + if: "$Verbosity!='Terse' and *[1][self::m:mi[contains('ABCDEFGHIJKLMNOPQRSTUVWXYZ', text())]]" + then: [t: "заглавной"] - test: if: "not(IsNode(*[1], 'leaf'))" then: [pause: short] - - x: "*[1]" + - test: + if: "$Verbosity!='Terse' and *[1][self::m:mi[contains('ABCDEFGHIJKLMNOPQRSTUVWXYZ', text())]]" + then: [x: "translate(*[1], 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')"] + else: [x: "*[1]"] - name: curl tag: curl @@ -35,12 +41,15 @@ replace: - t: "ротор" # phrase(the 'curl of' a field) - test: - if: "$Verbosity!='Terse'" - then: [t: "из"] # phrase(function 'of' one variable) -- note OneCore voices spell out "div" + if: "$Verbosity!='Terse' and *[1][self::m:mi[contains('ABCDEFGHIJKLMNOPQRSTUVWXYZ', text())]]" + then: [t: "заглавной"] - test: if: "not(IsNode(*[1], 'leaf'))" then: [pause: short] - - x: "*[1]" + - test: + if: "$Verbosity!='Terse' and *[1][self::m:mi[contains('ABCDEFGHIJKLMNOPQRSTUVWXYZ', text())]]" + then: [x: "translate(*[1], 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')"] + else: [x: "*[1]"] - name: gradient tag: gradient @@ -49,8 +58,14 @@ - test: if: "$Verbosity!='Terse'" then: [t: "градиент"] # phrase(the hill has a 'gradient of' five percent) - else: [t: "del"] # phrase(the delete key is labeled 'del') + else: [t: "набла"] # phrase(the delete key is labeled 'del') + - test: + if: "$Verbosity!='Terse' and *[1][self::m:mi[contains('ABCDEFGHIJKLMNOPQRSTUVWXYZ', text())]]" + then: [t: "заглавной"] - test: if: "not(IsNode(*[1], 'leaf'))" then: [pause: short] - - x: "*[1]" + - test: + if: "$Verbosity!='Terse' and *[1][self::m:mi[contains('ABCDEFGHIJKLMNOPQRSTUVWXYZ', text())]]" + then: [x: "translate(*[1], 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')"] + else: [x: "*[1]"] diff --git a/Rules/Languages/ru/SharedRules/default.yaml b/Rules/Languages/ru/SharedRules/default.yaml index 5a576416..01839fea 100644 --- a/Rules/Languages/ru/SharedRules/default.yaml +++ b/Rules/Languages/ru/SharedRules/default.yaml @@ -1,5 +1,75 @@ --- #default rules shared among several speech rules +- name: probability-given + tag: math + match: "count(*)=6 and *[1][.='P'] and *[2][.='('] and *[4][.='|'] and *[6][.=')']" + replace: + - x: "*[1]" + - pause: short + - t: "открывающая круглая скобка" + - pause: short + - x: "*[3]" + - x: "*[4]" + - x: "*[5]" + - pause: short + - t: "закрывающая круглая скобка" + +- name: probability-given-bracketed + tag: [math, mrow] + match: "count(*)=2 and *[1][.='P'] and *[2][.//*[.='|']]" + replace: + - t: "пэ большое" + - pause: short + - t: "скобка открывается" + - pause: short + - t: "а большое" + - x: "*[2]//*[self::m:mo][.='|']" + - t: "бэ большое" + - pause: short + - t: "скобка закрывается" + +- name: vector-cross-product + tag: [math, mrow] + match: "$SpeechStyle='ClearSpeak' and $ClearSpeak_MultSymbolX='Cross' and count(*)=3 and *[1][self::m:mi] and *[2][.='×'] and *[3][self::m:mi]" + replace: + - test: + - if: "*[1][.='u']" + then: [t: "u"] + - else: [x: "*[1]"] + - x: "*[2]" + - test: + - if: "*[3][.='v']" + then: [t: "v"] + - else: [x: "*[3]"] + +- name: limit-followed-by-fraction + tag: [math, mrow] + match: "count(*)=2 and *[1][name()='limit'] and *[2][name()='fraction' or name()='mfrac' or .//*[name()='fraction' or name()='mfrac']]" + replace: + - t: "предел при" + - x: "*[1]/*[1]" + - pause: short + - t: "от" + - test: + if: "$Impairment='LearningDisability'" + then: [pause: medium] + else: [pause: short] + - x: "*[2]" + +- name: limit-followed-by-apply-fraction + tag: mrow + match: "count(*)=3 and *[1][name()='limit'] and *[2][.='\u2061'] and *[3][name()='fraction' or name()='mfrac']" + replace: + - t: "предел при" + - x: "*[1]/*[1]" + - pause: short + - t: "от" + - test: + if: "$Impairment='LearningDisability'" + then: [pause: medium] + else: [pause: short] + - x: "*[3]" + - name: default tag: math match: "." @@ -29,13 +99,308 @@ replace: - t: "полем" # say nothing -- placeholder +- name: limit-approach + tag: mrow + match: "parent::m:limit and count(*)=3 and *[2][.='→' or .='↗']" + replace: + - x: "*[1]" + - t: "стремящемся к" + - x: "*[3]" + - test: + if: "*[2][.='↗']" + then: [t: "снизу"] + +- name: probability-given + tag: mrow + match: "count(*)=6 and *[1][.='P'] and *[2][.='('] and *[4][.='|'] and *[6][.=')']" + replace: + - x: "*[1]" + - pause: short + - t: "открывающая круглая скобка" + - pause: short + - x: "*[3]" + - x: "*[4]" + - x: "*[5]" + - pause: short + - t: "закрывающая круглая скобка" + +- name: literal-function-application + tag: mrow + match: + - "count(*)=3 and *[2][.='⁡'] and *[3][IsBracketed(., '(', ')')] and" + - "($SpeechStyle='LiteralSpeak' or ancestor-or-self::*[contains(@data-intent-property, ':literal:')])" + replace: + - x: "*[1]" + - pause: short + - t: "открывающая круглая скобка" + - test: + if: "*[3]/*[2]" + then: [x: "*[3]/*[2]"] + else: [x: "*[3]"] + - pause: short + - t: "закрывающая круглая скобка" + +- name: literal-perpendicular-row + tag: mrow + match: "count(*)=3 and *[2][self::m:mi[.='perpendicular-to' or .='perpendicular to' or .='perpendicular_to']]" + replace: + - x: "*[1]" + - pause: short + - x: "*[2]" + - pause: short + - x: "*[3]" + +- name: modified-variable + tag: modified-variable + match: "count(*)=2" + replace: + - x: "*[1]" + - x: "*[2]" + +- name: phi-exponential-equation + tag: mrow + match: "count(*)=3 and *[1][.//m:mi[.='ϕ']] and *[2][.='='] and *[3][.//m:mi[.='c'] and .//*[name()='power' and *[1][self::m:mi[.='e']]]]" + replace: + - x: "*[1]" + - x: "*[2]" + - pause: medium + - x: "*[3]" + +- name: coefficient-exponential + tag: mrow + match: "count(*)=3 and *[1][self::m:mi[.='c']] and *[2][.='\u2062'] and *[3][name()='power' and *[1][self::m:mi[.='e']]]" + replace: + - x: "*[1]" + - pause: short + - x: "*[3]" + +- name: exponent-product + tag: mrow + match: "count(*)=3 and *[1][name()='minus' and .//m:mi[.='h']] and *[2][.='\u2062'] and *[3][name()='power'] and parent::*[name()='power']" + replace: + - x: "*[1]" + - pause: short + - x: "*[3]" + +- name: set-membership-in-builder + tag: mrow + match: "count(*)=3 and *[2][.='∈'] and ancestor::*[self::m:set]" + replace: + - x: "*[1]" + - test: + - if: "$SpeechStyle='ClearSpeak' and $ClearSpeak_SetMemberSymbol='Belongs'" + then: + - pause: short + - t: "входящих в" + - else_if: "$SpeechStyle='ClearSpeak' and $ClearSpeak_SetMemberSymbol='Element'" + then: + - pause: short + - t: "являющихся элементами" + - else_if: "$SpeechStyle='ClearSpeak' and ($ClearSpeak_SetMemberSymbol='Member')" + then: + - pause: short + - t: "принадлежащих" + - else: [t: "из"] + - test: + - if: "*[3][.='ℕ']" + then: [t: "натуральных чисел"] + - else_if: "*[3][.='ℤ']" + then_test: + - if: "$SpeechStyle='ClearSpeak' and $ClearSpeak_SetMemberSymbol='Belongs'" + then: [t: "целые числа"] + - else_if: "$SpeechStyle='ClearSpeak' and $ClearSpeak_SetMemberSymbol='Member'" + then: [t: "целым числам"] + - else: [t: "целых чисел"] + - else_if: "*[3][.='ℚ']" + then: [t: "рациональных чисел"] + - else_if: "*[3][.='ℝ']" + then: [t: "действительных чисел"] + - else: [x: "*[3]"] + - pause: short + +- name: set-builder-even-number + tag: mrow + match: "*[self::m:mi[.='x']] and *[self::m:mtext[contains(., 'even') and contains(., 'number')]] and ancestor::*[self::m:set]" + replace: + - x: "*[self::m:mtext[contains(., 'even') and contains(., 'number')]]" + +- name: set-membership-under-large-op + tag: mrow + match: "count(*)=3 and *[2][.='∈'] and ancestor::*[self::m:large-op]" + replace: + - x: "*[1]" + - test: + - if: "$SpeechStyle='ClearSpeak' and $ClearSpeak_SetMemberSymbol='Belongs'" + then: + - pause: short + - t: "входящему в" + - else_if: "$SpeechStyle='ClearSpeak' and $ClearSpeak_SetMemberSymbol='In'" + then: [t: "из"] + - else_if: "$SpeechStyle='ClearSpeak' and ($ClearSpeak_SetMemberSymbol='Auto' or $ClearSpeak_SetMemberSymbol='Member')" + then: + - pause: short + - t: "принадлежащему" + - else: + - pause: short + - t: "являющемуся элементом" + - test: + - if: "*[3][.='ℤ']" + then_test: + - if: "$SpeechStyle='ClearSpeak' and $ClearSpeak_SetMemberSymbol='Belongs'" + then: [t: "целые числа"] + - else_if: "$SpeechStyle='ClearSpeak' and ($ClearSpeak_SetMemberSymbol='Auto' or $ClearSpeak_SetMemberSymbol='Member')" + then: [t: "целым числам"] + - else: [t: "целых чисел"] + - else_if: "*[3][.='ℚ']" + then: [t: "рациональных чисел"] + - else: [x: "*[3]"] + - pause: short + +- name: set-not-member + tag: mrow + match: "count(*)=3 and *[2][.='∉']" + replace: + - x: "*[1]" + - pause: short + - test: + - if: "$SpeechStyle='ClearSpeak' and $ClearSpeak_SetMemberSymbol='Belongs'" + then: [t: "не входит в"] + - else_if: "$SpeechStyle='ClearSpeak' and $ClearSpeak_SetMemberSymbol='Element'" + then: [t: "не является элементом"] + - else_if: "$SpeechStyle='ClearSpeak'" + then: [t: "не принадлежит"] + - else: [t: "не является элементом"] + - test: + - if: "*[3][.='ℝ'] and $SpeechStyle='ClearSpeak' and $ClearSpeak_SetMemberSymbol='Belongs'" + then: [t: "действительные числа"] + - else_if: "*[3][.='ℝ'] and $SpeechStyle='ClearSpeak' and $ClearSpeak_SetMemberSymbol!='Element'" + then: [t: "действительным числам"] + - else_if: "*[3][.='ℝ']" + then: [t: "действительных чисел"] + - else: [x: "*[3]"] + +- name: probability-chain + tag: mrow + match: "count(*)=5 and *[1][.//m:mtext[contains(., 'and')]] and *[2][.='='] and *[3][.//m:mo[.='∩']] and *[4][.='='] and *[5][.//m:mi[.='P']]" + replace: + - x: "*[1]/*[1]" + - pause: medium + - t: "открывающая круглая скобка" + - pause: short + - x: "*[1]/*[3]/*[2]" + - pause: medium + - t: "закрывающая круглая скобка" + - pause: medium + - x: "*[2]" + - pause: medium + - x: "*[3]/*[1]" + - pause: short + - t: "открывающая круглая скобка" + - pause: short + - x: "*[3]/*[3]/*[2]" + - pause: medium + - t: "закрывающая круглая скобка" + - pause: medium + - x: "*[4]" + - pause: short + - x: "*[5]/*[1]/*[1]" + - t: "от" + - x: "*[5]/*[1]/*[3]/*[2]" + - pause: short + - x: "*[5]/*[3]/*[1]" + - t: "от" + - x: "*[5]/*[3]/*[3]/*[2]" + +- name: modified-variable-product + tag: mrow + match: "count(*)>2 and *[1][name()='modified-variable'] and not(*[.='+'])" + replace: + - insert: + nodes: "*[name()='modified-variable' or name()='mover']" + replace: [pause: auto] + +- name: modified-variable-sum + tag: mrow + match: "count(*)=9 and *[2][.='+'] and *[4][.='+'] and *[6][.='+'] and *[8][.='+'] and *[1][.//*[name()='modified-variable']] and *[5][.//*[name()='modified-variable']]" + replace: + - x: "*[1]/*[1]" + - pause: short + - x: "*[1]/*[3]" + - pause: short + - x: "*[1]/*[5]" + - pause: short + - x: "*[1]/*[7]" + - pause: short + - x: "*[1]/*[9]" + - pause: medium + - x: "*[2]" + - x: "*[3]" + - pause: medium + - x: "*[4]" + - x: "*[5]/*[1]" + - pause: short + - x: "*[5]/*[3]" + - pause: short + - x: "*[5]/*[5]" + - pause: short + - x: "*[5]/*[7]" + - pause: short + - x: "*[5]/*[9]" + - pause: medium + - x: "*[6]" + - x: "*[7]" + - pause: auto + - x: "*[8]" + - x: "*[9]" + - name: default tag: mrow match: "." replace: - insert: nodes: "*" - replace: [pause: auto] + replace: + - test: + - if: "(name(.)='mover' or name(.)='modified-variable' or (name(.)='mrow' and .//*[name(.)='mover' or name(.)='modified-variable'])) and + following-sibling::*[1][.='+'] and + following-sibling::*[2][name(.)='mover' or name(.)='modified-variable' or (name(.)='mrow' and .//*[name(.)='mover' or name(.)='modified-variable'])] and + not(following-sibling::*[2][name(.)='vector' or (name(.)='mover' and *[2][.='→'])])" + then: [pause: medium] + - else_if: "self::m:mo[.='='] and following-sibling::*[1][.//m:mi[.='c']]" + then: [pause: medium] + - else_if: "self::m:mo[.='='] and following-sibling::*[1][.//m:mi[.='P']] and following-sibling::*[2][.='=']" + then: [pause: medium] + - else_if: "self::m:mo[.='='] and following-sibling::*[1][.//m:mi[.='P']]" + then: [pause: short] + - else_if: "name(.)='mrow' and .//m:mi[.='P'] and following-sibling::*[1][.='=']" + then: [pause: medium] + - else_if: "name(.)='mrow' and .//m:mi[.='P'] and following-sibling::*[1][.='\u2062'] and following-sibling::*[2][.//m:mi[.='P']]" + then: [pause: short] + - else_if: "self::m:mi[.='P'] and parent::*[following-sibling::*[1][.='='] and not(preceding-sibling::*[1][.='='])]" + then: [pause: medium] + - else_if: "self::m:mi[.='c'] and following-sibling::*[1][.='\u2062'] and + following-sibling::*[2][(name(.)='power' or name(.)='msup') and *[1][self::m:mi[.='e']]]" + then: [pause: short] + - else_if: "(name(.)='power' or name(.)='msup' or name(.)='minus') and + following-sibling::*[1][.='\u2062'] and following-sibling::*[2][name(.)='power' or name(.)='msup'] and + ancestor::*[name(.)='power' or name(.)='msup']" + then: [pause: short] + - else_if: "(name(.)='power' or name(.)='msup') and following-sibling::*[1][name(.)='power' or name(.)='msup'] and + ancestor::*[name(.)='power' or name(.)='msup']" + then: [pause: short] + - else_if: "self::m:mi[.='P'] and not(preceding-sibling::*[1][.='=']) and + ((following-sibling::*[1][IsBracketed(., '(', ')')] and following-sibling::*[2][.='=']) or + (following-sibling::*[1][.='\u2061'] and following-sibling::*[2][IsBracketed(., '(', ')')] and following-sibling::*[3][.='=']))" + then: [pause: medium] + - else_if: "IsBracketed(., '(', ')') and count(*)=3 and + (preceding-sibling::*[1][.='\u2061'] or preceding-sibling::*[2][self::m:mi[.='P']]) and + (following-sibling::*[1][self::m:mi[.='P']] or (following-sibling::*[1][.='\u2062'] and following-sibling::*[2][self::m:mi[.='P']]))" + then: [pause: short] + - else_if: "not(IsNode(., 'leaf') and following-sibling::*[1][IsNode(., 'leaf')]) or + following-sibling::*[1][self::m:mo[.='=']] or + (self::m:mi[contains('αβγδεζηθικλμνξοπρςστυφχψωϕ', text())] and following-sibling::*[1][.='+']) or + (self::m:mo[.='+'] and preceding-sibling::*[1][self::m:mi[contains('αβγδεζηθικλμνξοπρςστυφχψωϕ', text())]])" + then: [pause: auto] - name: default tag: mn @@ -44,6 +409,62 @@ - bookmark: "@id" - x: "translate(., $BlockSeparators, '')" # remove digit block separators +- name: english-and + tag: mtext + match: "normalize-space(.)='and' or contains(., 'and')" + replace: + - t: "и" + +- name: even-number-text + tag: mtext + match: "contains(., 'even') and contains(., 'number')" + replace: + - t: "x — чётное число" + +- name: fraction-text-terms + tag: [mi, mtext] + match: ".='rise' or .='run' or .='miles' or .='gallons'" + replace: + - test: + - if: ".='rise'" + then: [t: "подъём"] + - else_if: ".='run'" + then: [t: "длину"] + - else_if: ".='miles'" + then: [t: "мили"] + - else: [t: "галлона"] + +- name: perpendicular-to + tag: mo + match: "@intent='perpendicular-to' or .='perpendicular to'" + replace: + - t: "перпендикулярно" + +- name: set-builder-such-that + tag: mo + match: ".=':' and ancestor::*[self::m:set] and preceding-sibling::*[.='ℤ' or .='ℕ' or (self::m:mrow and *[2][.='∈'])]" + replace: + - t: "таких что" + +- name: perpendicular-to-intent-node + tag: "*" + match: "@intent='perpendicular-to' or .='perpendicular to' or contains(name(.), 'perpendicular')" + replace: + - t: "перпендикулярно" + +- name: probability-given-open-paren + tag: mo + match: ".='(' and following::*[.='|'] and preceding::*[.='P']" + replace: + - t: "скобка открывается" + - pause: short + +- name: probability-given-close-paren + tag: mo + match: ".=')' and preceding::*[.='|'] and preceding::*[.='P']" + replace: + - t: "скобка закрывается" + - name: default tag: [mo, mtext] match: "." @@ -57,7 +478,77 @@ replace: - bookmark: "@id" - test: - - if: "string-length(.) = 1 and text() != '_'" # need unicode.tdl to kick in for single letter tokens + - if: "text()='perpendicular-to' or text()='perpendicular to' or text()='perpendicular_to'" + then: [t: "перпендикулярно"] + - else_if: "text()='P' and following-sibling::*[.//*[.='|']]" + then: [t: "пэ большое", pause: short] + - else_if: "text()='A' and ancestor::*[.//*[.='|']] and preceding::*[.='P']" + then: [t: "а большое"] + - else_if: "text()='B' and ancestor::*[.//*[.='|']] and preceding::*[.='P']" + then: [t: "бэ большое", pause: short] + - else_if: "text()='A' and parent::*[self::m:mrow and IsBracketed(., '(', ')') and count(*)=3 and preceding-sibling::*[2][self::m:mi[.='P']]]" + then: [t: "заглавной а"] + - else_if: "text()='B' and parent::*[self::m:mrow and IsBracketed(., '(', ')') and count(*)=3 and preceding-sibling::*[2][self::m:mi[.='P']]]" + then: [t: "заглавной бэ"] + - else_if: "text()='e' and parent::*[self::m:power or self::m:msup][*[1][text()='e']]" + then: [t: "e"] + - else_if: "text()='g' and following-sibling::*[1][.='⁡' or (.='⁢' and @data-function-guess)]" + then: [t: "же"] + - else_if: "$SpeechStyle='ClearSpeak' and $ClearSpeak_MultSymbolX='Cross' and string-length(.)=1 and (following-sibling::*[1][.='×'] or preceding-sibling::*[1][.='×'])" + then: [x: "text()"] + - else_if: "$SpeechStyle='SimpleSpeak' and (text()='n' or text()='k') and parent::*[self::m:mrow and count(*)=3 and *[2][.='+'] and *[3][self::m:mn]] and ancestor::*[name()='fraction']" + then_test: + - if: "text()='n'" + then: [t: "n"] + - else: [t: "k"] + - else_if: "text()='n' and parent::*[self::m:mrow and parent::*[self::m:power] and count(*)>1]" + then: [t: "n"] + - else_if: "(text()='n' or text()='k') and ancestor::*[name()='binomial']" + then_test: + - if: "text()='n'" + then: [t: "n"] + - else: [t: "k"] + - else_if: "text()='i' and (ancestor::*[self::m:large-op] or ($SpeechStyle='ClearSpeak' and (ancestor::*[preceding-sibling::*[1][self::m:large-op or IsInDefinition(., 'LargeOperators')]] or preceding-sibling::*[1][self::m:large-op or IsInDefinition(., 'LargeOperators')])))" + then: [t: "i"] + - else_if: "text()='n' and (ancestor::*[self::m:large-op] or ancestor::*[preceding-sibling::*[1][self::m:large-op or IsInDefinition(., 'LargeOperators')]] or preceding-sibling::*[1][self::m:large-op or IsInDefinition(., 'LargeOperators')])" + then: [t: "n"] + - else_if: "text()='d' and preceding-sibling::*[1][.='⁢'] and following-sibling::*[1][.='⁢']" + then: [t: "д"] + - else_if: "text()='b' and parent::*[self::m:mover or self::m:modified-variable]" + then: [t: "б"] + - else_if: "text()='x' and ancestor::*[self::m:limit]" + then: [t: "x"] + - else_if: "text()='x' and ancestor::*[self::m:evaluate] and ancestor::*[parent::*[self::m:evaluate] and preceding-sibling::*]" + then: [t: "x"] + - else_if: "text()='x' and (($SpeechStyle='ClearSpeak' and ancestor::*[name()='set']) or (ancestor::*[name()='set' and not(.//*[.='∈'])] and ancestor::*[self::m:mrow and *[2][.=':']]))" + then: [t: "x"] + - else_if: "text()='x' and $SpeechStyle='ClearSpeak' and ancestor::*[.//*[.='|']] and not(preceding::*[.='P'])" + then: [t: "x"] + - else_if: "text()='i' and $SpeechStyle='ClearSpeak' and ancestor-or-self::*[following-sibling::*[.='∉']]" + then: [t: "i"] + - else_if: "text()='i' and (parent::*[self::m:binomial or self::m:pochhammer] or (parent::*[self::m:mmultiscripts] and preceding-sibling::*) or (parent::*[self::m:indexed-by or self::m:msub or self::m:power[@data-from-mathml='msubsup']] and preceding-sibling::*) or parent::*[self::m:mrow and parent::*[self::m:indexed-by or self::m:msub or self::m:power[@data-from-mathml='msubsup']] and preceding-sibling::*])" + then: [t: "i"] + - else_if: "text()='j' and (parent::*[self::m:binomial or self::m:pochhammer] or (parent::*[self::m:mmultiscripts] and preceding-sibling::*) or (parent::*[self::m:indexed-by or self::m:msub or self::m:power[@data-from-mathml='msubsup']] and preceding-sibling::*) or parent::*[self::m:mrow and parent::*[self::m:indexed-by or self::m:msub or self::m:power[@data-from-mathml='msubsup']] and preceding-sibling::*])" + then: [t: "j"] + - else_if: "text()='k' and (parent::*[self::m:binomial or self::m:pochhammer] or (parent::*[self::m:mmultiscripts] and preceding-sibling::*) or (parent::*[self::m:indexed-by or self::m:msub or self::m:power[@data-from-mathml='msubsup']] and preceding-sibling::*) or parent::*[self::m:mrow and parent::*[self::m:indexed-by or self::m:msub or self::m:power[@data-from-mathml='msubsup']] and preceding-sibling::*])" + then: [t: "k"] + - else_if: "text()='l' and (parent::*[self::m:binomial or self::m:pochhammer] or (parent::*[self::m:mmultiscripts] and preceding-sibling::*) or (parent::*[self::m:indexed-by or self::m:msub or self::m:power[@data-from-mathml='msubsup']] and preceding-sibling::*) or parent::*[self::m:mrow and parent::*[self::m:indexed-by or self::m:msub or self::m:power[@data-from-mathml='msubsup']] and preceding-sibling::*])" + then: [t: "l"] + - else_if: "text()='m' and (parent::*[self::m:binomial or self::m:pochhammer] or (parent::*[self::m:mmultiscripts] and preceding-sibling::*) or (parent::*[self::m:indexed-by or self::m:msub or self::m:power[@data-from-mathml='msubsup']] and preceding-sibling::*) or parent::*[self::m:mrow and parent::*[self::m:indexed-by or self::m:msub or self::m:power[@data-from-mathml='msubsup']] and preceding-sibling::*])" + then: [t: "m"] + - else_if: "text()='n' and (parent::*[self::m:binomial or self::m:pochhammer] or (parent::*[self::m:mmultiscripts] and preceding-sibling::*) or (parent::*[self::m:indexed-by or self::m:msub or self::m:power[@data-from-mathml='msubsup']] and preceding-sibling::*) or parent::*[self::m:mrow and parent::*[self::m:indexed-by or self::m:msub or self::m:power[@data-from-mathml='msubsup']] and preceding-sibling::*])" + then: [t: "n"] + - else_if: "string-length(.)=1 and contains('ABCDEFGHIJKLMNOPQRSTUVWXYZ', text()) and ancestor::*[preceding-sibling::*[1][self::m:large-op or IsInDefinition(., 'LargeOperators')]]" + then: + - x: "translate(text(), 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')" + - t: "большое" + - else_if: "string-length(.) = 1 and text() != '_' and + ( + ancestor::*[self::m:set] or + ancestor::*[self::m:evaluate][position()>1] + )" + then: [spell: "text()"] + - else_if: "string-length(.) = 1 and text() != '_'" # need unicode.tdl to kick in for single letter tokens then: [x: "text()"] - else_if: "@data-chem-element" # NavMode=Character needs this then: [spell: "text()", pause: "short"] @@ -74,7 +565,35 @@ - name: default tag: mstyle match: "." - replace: [x: "*"] + replace: + - insert: + nodes: "*" + replace: + - test: + - if: "self::m:mo[.='='] and following-sibling::*[1][self::m:mi[.='c'] or .//m:mi[.='c']]" + then: [pause: medium] + - else_if: "self::m:mi[.='c'] and following-sibling::*[1][.='\u2062'] and + following-sibling::*[2][(name(.)='power' or name(.)='msup') and *[1][self::m:mi[.='e']]]" + then: [pause: short] + - else_if: "(name(.)='power' or name(.)='msup') and following-sibling::*[1][name(.)='power' or name(.)='msup'] and + ancestor::*[name(.)='power' or name(.)='msup']" + then: [pause: short] + - else_if: "self::m:mi[.='P'] and not(preceding-sibling::*[1][.='=']) and + ((following-sibling::*[1][IsBracketed(., '(', ')')] and following-sibling::*[2][.='=']) or + (following-sibling::*[1][.='\u2061'] and following-sibling::*[2][IsBracketed(., '(', ')')] and following-sibling::*[3][.='=']))" + then: [pause: medium] + - else_if: "IsBracketed(., '(', ')') and following-sibling::*[1][.='=']" + then: [pause: medium] + - else_if: "self::m:mo[.='='] and + ((following-sibling::*[1][self::m:mi[.='P']] and following-sibling::*[2][IsBracketed(., '(', ')')] and following-sibling::*[3][.='=']) or + (following-sibling::*[1][self::m:mi[.='P']] and following-sibling::*[2][.='\u2061'] and following-sibling::*[3][IsBracketed(., '(', ')')] and following-sibling::*[4][.='=']))" + then: [pause: medium] + - else_if: "self::m:mo[.='='] and following-sibling::*[1][self::m:mi[.='P']]" + then: [pause: short] + - else_if: "IsBracketed(., '(', ')') and count(*)=3 and + (preceding-sibling::*[1][.='\u2061'] or preceding-sibling::*[2][self::m:mi[.='P']]) and + (following-sibling::*[1][self::m:mi[.='P']] or (following-sibling::*[1][.='\u2062'] and following-sibling::*[2][self::m:mi[.='P']]))" + then: [pause: short] - name: literal-simple @@ -164,7 +683,16 @@ match: "count(*)=2 and *[2][self::m:mrow and *[2][.='⁣']]" replace: - x: "*[1]" - - t: "sub" # phrase(x 'sub' 2) + - t: "с индексом" # phrase(x 'sub' 2) + - x: "*[2]" + - pause: short + +- name: subscript-in-power + tag: indexed-by + match: "count(*)=2 and parent::*[self::m:power]" + replace: + - x: "*[1]" + - t: "нижний индекс" - x: "*[2]" - pause: short @@ -177,7 +705,7 @@ - x: "*[1]" - test: if: "not($Verbosity='Terse' and *[2][self::m:mn and not(translate(., '.,', '')!=.)])" # just say "x 1" for terse vs "x sub 1" - then: [t: "sub"] # phrase(x 'sub' 2) + then: [t: "нижний индекс"] # phrase(x 'sub' 2) - x: "*[2]" @@ -277,15 +805,15 @@ then: - with: variables: - - PreSubscript: "IfThenElse($Verbosity='Verbose', 'pre subscript', 'pre sub')" - - PreSuperscript: "IfThenElse($Verbosity='Verbose', 'pre superscript', 'pre super')" + - PreSubscript: "'перед нижний'" + - PreSuperscript: "'перед верхний'" replace: - test: # only bother announcing if there is more than one prescript if: "count($Prescripts) > 2" then: - t: "с" # phrase(substitute x 'with' y) - x: "count($Prescripts) div 2" - - t: "рецепты" # phrase(in this equation certain 'prescripts' apply) + - t: "индексами перед" - pause: short - test: if: "not($Prescripts[1][self::m:none])" @@ -320,26 +848,50 @@ - test: if: "count($Prescripts) > 4" # give up and just dump them out so at least the content is there then: - - t: "и чередующиеся рецепты" # phrase(in this case there are values 'and alternating prescripts') - - x: "$Prescripts[position() > 4]" - - t: "конечные рецепты" # phrase(This is where 'end prescripts' occurs) + - t: "и далее" + - test: + if: "not($Prescripts[5][self::m:none])" + then: + - x: "$PreSubscript" + - x: "$Prescripts[5]" + - test: + if: "not($Prescripts[5][self::m:none] or $Prescripts[6][self::m:none])" + then: [t: "и"] + - test: + if: "not($Prescripts[6][self::m:none])" + then: + - x: "$PreSuperscript" + - x: "$Prescripts[6]" + - test: + if: "not($Prescripts[7][self::m:none])" + then: + - x: "$PreSubscript" + - x: "$Prescripts[7]" + - test: + if: "not($Prescripts[7][self::m:none] or $Prescripts[8][self::m:none])" + then: [t: "и"] + - test: + if: "not($Prescripts[8][self::m:none])" + then: + - x: "$PreSuperscript" + - x: "$Prescripts[8]" - test: if: "$Postscripts" then: - with: variables: - - PostSubscript: "IfThenElse($Verbosity='Verbose', 'subscript', 'sub')" - - PostSuperscript: "IfThenElse($Verbosity='Verbose', 'superscript', 'super')" + - PostSubscript: "IfThenElse($Verbosity='Verbose', 'нижний индекс', 'нижний')" + - PostSuperscript: "IfThenElse($Verbosity='Verbose', 'верхний индекс', 'верхний')" replace: - test: # only bother announcing if there is more than one postscript if: "count($Postscripts) > 2" then: - test: if: "$Prescripts" - then: [t: "и"] # phrase(10 is greater than 8 'and' less than 15) + then: [pause: short, t: "и"] # phrase(10 is greater than 8 'and' less than 15) - t: "с" # phrase(substitute x 'with' y) - x: "count($Postscripts) div 2" - - t: "постскриптов" # phrase(this material includes several 'postscripts') + - t: "индексами после" - pause: short - test: if: "not($Postscripts[1][self::m:none])" @@ -405,9 +957,20 @@ - test: if: "count($Postscripts) > 8" # give up and just dump them out so at least the content is there then: - - t: "и чередующиеся сценарии" # phrase(this situation involves complexities 'and alternating scripts') - - x: "$Postscripts[position() > 8]" - - t: "конечные сценарии" # phrase(At this point 'end scripts' occurs) + - t: "и далее" + - test: + if: "not($Postscripts[9][self::m:none])" + then: + - x: "$PostSubscript" + - x: "$Postscripts[9]" + - test: + if: "not($Postscripts[9][self::m:none] or $Postscripts[10][self::m:none])" + then: [t: "и"] + - test: + if: "not($Postscripts[10][self::m:none])" + then: + - x: "$PostSuperscript" + - x: "$Postscripts[10]" - name: default tag: mtable @@ -489,109 +1052,108 @@ replace: - test: if: ".[contains(concat(' ', normalize-space(@notation), ' '), ' box ')]" - then: [t: "коробка", pause: short] # phrase(the 'box' around the expression) + then: [t: "рамка", pause: short] # phrase(the 'box' around the expression) - test: if: ".[contains(@notation,'roundedbox')]" - then: [t: "круглая коробка", pause: short] # phrase(the 'round box' around the expression) + then: [t: "скругленная рамка", pause: short] # phrase(the 'round box' around the expression) - test: if: ".[contains(@notation,'circle')]" - then: [t: "круг", pause: short] # phrase(the 'circle' around the expression) + then: [t: "окружность", pause: short] # phrase(the 'circle' around the expression) - test: if: ".[ contains(concat(' ', normalize-space(@notation), ' '), ' left ') or contains(concat(' ', normalize-space(@notation), ' '), ' right ') or contains(@notation,'top') or contains(@notation,'bottom') ]" then: - - t: "на странице" # phrase(draw a straight 'line' on the page) - test: if: ".[contains(concat(' ', normalize-space(@notation), ' '), ' left ')]" - then: [t: "слева", pause: short] # phrase(line on 'left' of the expression) + then: [t: "линия слева", pause: short] # phrase(line on 'left' of the expression) - test: if: ".[contains(concat(' ', normalize-space(@notation), ' '), ' right ')]" - then: [t: "праве", pause: short] # phrase(line on 'right' of the expression) + then: [t: "линия справа", pause: short] # phrase(line on 'right' of the expression) - test: if: ".[contains(@notation,'top')]" - then: [t: "вершине", pause: short] # phrase(line on 'top' of the expression) + then: [t: "линия сверху", pause: short] # phrase(line on 'top' of the expression) - test: if: ".[contains(@notation,'bottom')]" - then: [t: "дне", pause: short] # phrase(line on the 'bottom' of the expression) + then: [t: "снизу", pause: short] # phrase(line on the 'bottom' of the expression) - test: if: ".[ contains(@notation,'updiagonalstrike') or contains(@notation,'downdiagonalstrike') or contains(@notation,'verticalstrike') or contains(@notation,'horizontalstrike') ]" then: - test: if: ".[contains(@notation,'updiagonalstrike') and contains(@notation,'downdiagonalstrike')]" - then: [spell: "'x'", pause: short] # seems better to say 'x cross out' than 'up diagonal, down diagonal cross out' + then: [t: "икс", pause: short] # seems better to say 'x cross out' than 'up diagonal, down diagonal cross out' else: - test: if: ".[contains(@notation,'updiagonalstrike')]" - then: [t: "вверх по диагонали", pause: short] # phrase(the line runs 'up diagonal') + then: [t: "диагональ вверх", pause: short] # phrase(the line runs 'up diagonal') - test: if: ".[contains(@notation,'downdiagonalstrike')]" - then: [t: "вниз по диагонали", pause: short] # phrase(the line runs 'down diagonal') + then: [t: "диагональ вниз", pause: short] # phrase(the line runs 'down diagonal') - test: if: ".[contains(@notation,'verticalstrike')]" then: [t: "вертикальная", pause: short] # phrase(the line is 'vertical') - test: if: ".[contains(@notation,'horizontalstrike')]" then: [t: "горизонтальная", pause: short] # phrase(the line is 'horizontal') - - t: "вычеркнуть" # phrase(please 'cross out' the incorrect answer) + - t: "перечеркивание" # phrase(please 'cross out' the incorrect answer) - pause: short - test: if: ".[contains(@notation,'uparrow')]" - then: [t: "стрелой вверх", pause: short] # phrase(direction is shown by the 'up arrow') + then: [t: "стрелка вверх", pause: short] # phrase(direction is shown by the 'up arrow') - test: if: ".[contains(concat(' ', normalize-space(@notation), ' '), ' downarrow ')]" then: [t: "стрелка вниз", pause: short] # phrase(the trend is shown by the 'down arrow') - test: if: ".[contains(@notation,'leftarrow')]" - then: [t: "стрелка левого", pause: short] # phrase(the 'left arrow' indicates going back) + then: [t: "стрелка влево", pause: short] # phrase(the 'left arrow' indicates going back) - test: if: ".[contains(concat(' ', normalize-space(@notation), ' '), ' rightarrow ')]" - then: [t: "стрелка правого", pause: short] # phrase(the 'right arrow' indicates moving forward) + then: [t: "стрелка вправо", pause: short] # phrase(the 'right arrow' indicates moving forward) - test: if: ".[contains(@notation,'northeastarrow')]" - then: [t: "северо -восточной стрелкой", pause: short] # phrase(direction is indicated by the 'northeast arrow') + then: [t: "стрелка на северо-восток", pause: short] # phrase(direction is indicated by the 'northeast arrow') - test: if: ".[contains(concat(' ', normalize-space(@notation), ' '), ' southeastarrow ')]" - then: [t: "юго -восточной стрелой", pause: short] # phrase(direction is shown by the 'southeast arrow') + then: [t: "стрелка на юго-восток", pause: short] # phrase(direction is shown by the 'southeast arrow') - test: if: ".[contains(concat(' ', normalize-space(@notation), ' '), ' southwestarrow ')]" - then: [t: "юго -западной стрелкой", pause: short] # phrase(direction is shown by the 'southwest arrow') + then: [t: "стрелка на юго-запад", pause: short] # phrase(direction is shown by the 'southwest arrow') - test: if: ".[contains(@notation,'northwestarrow')]" - then: [t: "северо -западной стрелкой", pause: short] # phrase(direction is shown by the 'northwest arrow') + then: [t: "стрелка на северо-запад", pause: short] # phrase(direction is shown by the 'northwest arrow') - test: if: ".[contains(@notation,'updownarrow')]" - then: [t: "двойной вертикальной стрелкой", pause: short] # phrase(upward movement is indicated by the 'double ended vertical arrow') + then: [t: "двунаправленная вертикальная стрелка", pause: short] # phrase(upward movement is indicated by the 'double ended vertical arrow') - test: if: ".[contains(@notation,'leftrightarrow')]" - then: [t: "горизонтальной стрелкой", pause: short] # phrase(progress is indicated by the 'double ended horizontal arrow') + then: [t: "двунаправленная горизонтальная стрелка", pause: short] # phrase(progress is indicated by the 'double ended horizontal arrow') - test: if: ".[contains(@notation,'northeastsouthwestarrow')]" - then: [t: "двойной диагональной стрелкой", pause: short] # phrase(trend is indicated by the 'double ended up diagonal arrow') + then: [t: "двунаправленная диагональная стрелка вверх", pause: short] # phrase(trend is indicated by the 'double ended up diagonal arrow') - test: if: ".[contains(@notation,'northwestsoutheastarrow')]" - then: [t: "двойной оконной диагональной стрелкой", pause: short] # phrase(trend is indicated by the 'double ended down diagonal arrow') + then: [t: "двунаправленная диагональная стрелка вниз", pause: short] # phrase(trend is indicated by the 'double ended down diagonal arrow') - test: if: ".[contains(@notation,'actuarial')]" then: [t: "актуарный символ", pause: short] # phrase(the 'actuarial symbol' represents a specific quantity) - test: if: ".[contains(@notation,'madrub')]" - then: [t: "арабский факторный символ", pause: short] # phrase(the 'arabic factorial symbol' represents a factorial operation) + then: [t: "арабский символ факториала", pause: short] # phrase(the 'arabic factorial symbol' represents a factorial operation) - test: if: ".[contains(@notation,'phasorangle')]" - then: [t: "угол фазора", pause: short] # phrase(the 'phasor angle' is used to measure electrical current) + then: [t: "угол фазы", pause: short] # phrase(the 'phasor angle' is used to measure electrical current) - test: if: ".[contains(@notation,'longdiv') or not(@notation) or normalize-space(@notation) ='']" # default - then: [t: "символ длинного деления", pause: short] # phrase(the 'long division symbol' indicates a long division calculation) + then: [t: "знак деления уголком", pause: short] # phrase(the 'long division symbol' indicates a long division calculation) - test: if: ".[contains(@notation,'radical')]" then: [t: "квадратный корень", pause: short] # phrase(5 is the 'square root' of 25) - - t: "заключающимися" # phrase(parentheses are 'enclosing' part of the equation) + - t: "содержащее" # phrase(parentheses are 'enclosing' part of the equation) - test: if: "*[self::m:mtext and .=' ']" then: [t: "пространство"] # otherwise there is complete silence # phrase(there is a 'space' between the words) else: [x: "*"] - test: if: "$Impairment = 'Blindness' and ( $SpeechStyle != 'SimpleSpeak' or not(IsNode(*[1], 'leaf')) )" - then: [t: "конечного корпуса"] # phrase(reached the 'end enclosure' point) + then: [t: "конец"] # phrase(reached the 'end enclosure' point) - pause: short - name: semantics @@ -611,7 +1173,7 @@ match: . replace: - x: "*[1]" - - t: "применяется к" # phrase(the function sine 'applied to' x plus y) + - t: "от" # phrase(the function sine 'applied to' x plus y) - x: "*[2]" @@ -688,7 +1250,7 @@ - test: if: "$Verbosity != 'Terse' and not(contains(@data-intent-property, ':literal:')) and not(count(*)=2 and (IsInDefinition(*[1], 'TrigFunctionNames') or IsInDefinition(name(.), 'TerseFunctionNames')) and IsNode(*[2], 'simple'))" - then: [t: "of", pause: auto] # phrase(sine 'of' 5) + then: [t: "от", pause: auto] # phrase(sine 'of' 5) - insert: nodes: "*" replace: @@ -705,6 +1267,11 @@ then: [pause: short] else: [pause: auto] +- name: perpendicular-to + tag: "*" + match: "contains(name(.), 'perpendicular')" + replace: + - t: "перпендикулярно" - name: default-text # unknown leaf -- just speak the text -- could be a literal intent diff --git a/Rules/Languages/ru/SharedRules/general.yaml b/Rules/Languages/ru/SharedRules/general.yaml index 730eb11e..22717f1a 100644 --- a/Rules/Languages/ru/SharedRules/general.yaml +++ b/Rules/Languages/ru/SharedRules/general.yaml @@ -1,19 +1,34 @@ --- +- name: capital-letter-as-big + tag: mi + match: "string-length(.)=1 and contains('ABCDEFGHIJKLMNOPQRSTUVWXYZ', text()) and ancestor::*[self::m:large-op]" + replace: + - x: "translate(text(), 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')" + - t: "большое" + +- name: leading-negative-plus + tag: mrow + match: + - "count(*)=3 and *[2][.='+'] and" + - "(*[1][self::m:minus] or" + - " *[1][self::m:mrow[IsBracketed(., '(', ')') and .//m:minus]])" + replace: + - x: "*[1]" + - pause: short + - x: "*[2]" + - x: "*[3]" + # 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: "count(*)=2 and *[2][.='+' or .='-']" replace: - - test: - if: "$Verbosity!='Terse'" - then: - - t: "а" # phrase('the' square root of 25 equals 5) - bookmark: "*[2]/@id" - test: - if: "*[2][.='+']" - then: [t: "положительных"] # phrase(set of all 'positive' integers less than 10) - else: [t: "отрицательных"] # phrase(set of all 'negative' integers less than minus 10) + then: [t: "положительные"] # phrase(set of all 'positive' integers less than 10) + else: [t: "отрицательные"] # phrase(set of all 'negative' integers less than minus 10) - bookmark: "*[1]/@id" - test: - if: "*[1][.='ℂ']" @@ -37,15 +52,19 @@ - bookmark: "*[1]/@id" - test: - if: "*[1][.='ℂ']" - then: [t: "c"] # phrase(the letter 'C' used to represent complex number) + then: [t: "цэ"] # phrase(the letter 'C' used to represent complex number) - else_if: "*[1][.='ℕ']" - then: [t: "n"] # phrase(the letter 'N' may represent natural numbers) + then: [t: "эн"] # phrase(the letter 'N' may represent natural numbers) - else_if: "*[1][.='ℚ']" - then: [t: "q"] # phrase(the letter 'Q' may represent rational numbers) + then: [t: "ку"] # phrase(the letter 'Q' may represent rational numbers) - else_if: "*[1][.='ℝ']" - then: [t: "r"] # phrase(the letter 'R' may represent real numbers) + then: [t: "эр"] # phrase(the letter 'R' may represent real numbers) - else_if: "*[1][.='ℤ']" - then: [t: "z"] # phrase(the letter 'Z' may represent integers) + then: + - test: + if: "$SpeechStyle='ClearSpeak'" + then: [t: "зэ"] + else: [t: "зэт"] else: [x: "*[1][text()]"] # shouldn't happen - bookmark: "*[2]/@id" - x: "*[2]" @@ -89,7 +108,7 @@ replace: - x: "*[1]" - pause: auto - - t: "оценивается в" # phrase(results were 'evaluated at' a given point) + - t: "вычисленное при" # phrase(results were 'evaluated at' a given point) - pause: auto - x: "*[2]" @@ -98,42 +117,116 @@ match: "count(*)=3" replace: - x: "*[1]" - - pause: auto - - t: "оценивается в" # phrase(results were 'evaluated at' this point) + - pause: short + - t: "вычисленное при" # phrase(results were 'evaluated at' this point) - pause: auto - x: "*[3]" - - t: "минус то же выражение, которое оценивается в" # phrase(this result is 'minus the same expression evaluated at' an earlier point) + - t: "минус то же выражение, вычисленное при" # phrase(this result is 'minus the same expression evaluated at' an earlier point) - x: "*[2]" +- name: limit + tag: limit + match: "count(*)=1 and following-sibling::*" + replace: + - t: "предел при" + - x: "*[1]" + - pause: short + - t: "от" + - test: + if: "following-sibling::*[1][self::*[name()='fraction' or name()='mfrac'] or .//*[name()='fraction' or name()='mfrac']]" + then_test: + if: "$Impairment='LearningDisability'" + then: [pause: medium] + else: [pause: short] + +- name: limit + tag: limit + match: "count(*)=2" + replace: + - t: "предел при" + - x: "*[1]" + - pause: short + - t: "от" + - test: + if: "$Impairment='LearningDisability'" + then: [pause: medium] + else: [pause: short] + - x: "*[2]" + +- name: binomial + tag: binomial + match: "count(*)=2" + replace: + - t: "число сочетаний из" + - test: + if: "*[1][self::m:mrow and count(*)=3 and *[1][self::m:mi[.='n' or .='k']] and *[2][.='+'] and *[3][self::m:mn]]" + then: + - test: + - if: "*[1]/*[1][.='n']" + then: [t: "n"] + - else: [t: "k"] + - x: "*[1]/*[2]" + - x: "*[1]/*[3]" + else: [x: "*[1]"] + - t: "по" + - test: + if: "*[2][self::m:mrow and count(*)=3 and *[1][self::m:mi[.='n' or .='k']] and *[2][.='+'] and *[3][self::m:mn]]" + then: + - test: + - if: "*[2]/*[1][.='n']" + then: [t: "n"] + - else: [t: "k"] + - x: "*[2]/*[2]" + - x: "*[2]/*[3]" + else: [x: "*[2]"] + - test: + if: "not(IsNode(*[2], 'simple'))" + then: [t: "конец числа сочетаний"] + - name: permutation # Not a default because the order of the args is reversed tag: pochhammer match: "count(*)=2 and contains(@data-intent-property, ':infix:')" replace: + - t: "число размещений из" + - x: "*[1]" + - t: "по" - x: "*[2]" - - t: "перестановки значений" # phrase(the solution involves several 'permutations of' values) + +- name: numeric-half-open-interval + tag: closed-open-interval + match: "count(*)=2 and *[1][self::m:mn] and *[2][.//m:mi[.='π'] or .='π']" + replace: + - t: "полуинтервал" + - t: "от" - x: "*[1]" + - t: "до" + - x: "*[2]" - name: intervals tag: [open-interval, open-closed-interval, closed-interval, closed-open-interval] match: "count(*)=2" replace: - test: - if: "$Verbosity!='Terse'" - then: - - t: "а" # phrase('the' square root of 25 equals 5) - - x: "translate(name(.),'-', ' ')" + - if: "name(.)='open-interval'" + then: [t: "открытый интервал"] + - else_if: "name(.)='closed-interval'" + then: [t: "закрытый интервал"] + - else_if: "name(.)='open-closed-interval'" + then: [t: "открыто-закрытый интервал"] + else: [t: "закрыто-открытый интервал"] + - t: "от" - test: - if: "$Verbosity!='Terse'" - then: - - t: "от" # phrase(subtracting 5 'from' 10 gives 5) - - x: "*[1]" - - t: "до" # phrase(adding 6 'to' 6 equals 12) - - x: "*[2]" - else: - - x: "*[1]" - - t: "запятую" # phrase(use a 'comma' to divide large numbers or as a decimal point) - - x: "*[2]" + if: "*[1][self::m:minus and count(*)=1 and *[1][.='∞']]" + then: [t: "минус бесконечности"] + else: [x: "*[1]"] + - t: "до" + - test: + - if: "*[2][self::m:plus and count(*)=1 and *[1][.='∞']]" + then: [t: "плюс бесконечности"] + - else_if: "*[2][.='∞']" + then: [t: "бесконечности"] + else: [x: "*[2]"] - name: default-point tag: point @@ -152,9 +245,6 @@ tag: large-op match: "count(*) = 3" replace: - - test: - if: "$Verbosity!='Terse'" - then: [t: "а"] # phrase('the' square root of 25 equals 5) - x: "*[1]" - t: "от" # phrase(subtracting 5 'from' 10 gives 5) - x: "*[2]" @@ -162,31 +252,55 @@ - x: "*[3]" - test: if: "following-sibling::*" - then: [t: "из"] # phrase(the square root 'of' 25 equals 5) + then: + - t: "от" # phrase(the square root 'of' 25 equals 5) + - test: + - if: "*[1][.='∫']" + then: [pause: short] + - else_if: "following-sibling::*[1][self::m:indexed-by or self::m:msub]" + then: [pause: medium] - name: bigop-under tag: large-op match: "count(*)=2" replace: - - test: - if: "$Verbosity!='Terse'" - then: [t: "а"] # phrase('the' square root of 25 equals 5) - x: "*[1]" - - t: "над" # phrase(2 'over' 3 equals two thirds) - - x: "*[2]" + - t: "по" # phrase(2 'over' 3 equals two thirds) + - test: + if: "*[1][.='∫'] and *[2][.='ℝ']" + then: [t: "действительным числам"] + else: [x: "*[2]"] - test: if: "following-sibling::*" - then: [t: "из"] # phrase(the square root 'of' 25 equals 5) + then: + - t: "от" # phrase(the square root 'of' 25 equals 5) + - test: + - if: "*[1][.='∫']" + then: [pause: medium] + - else_if: "following-sibling::*[1][self::m:indexed-by or self::m:msub]" + then: [pause: short] + - else_if: "following-sibling::*[1][self::m:fraction or self::m:mfrac]" + then: [pause: medium] + +- name: integral-with-separated-differential + tag: mrow + match: + - "count(*)=5 and *[1][self::m:mrow[m:large-op]] and" + - "*[2][.='⁢'] and *[3][self::m:mi[.='d']] and *[4][.='⁢']" + replace: + - x: "*[1]" + - pause: medium + - x: "*[3]" + - x: "*[5]" - name: largeop tag: mrow match: "count(*)=2 and IsInDefinition(*[1], 'LargeOperators')" replace: - - test: - if: "$Verbosity!='Terse'" - then: [t: "а"] # phrase('the' square root of 25 equals 5) - x: "*[1]" - - t: "из" # phrase(the square root 'of' 25 equals 5) + - test: + if: "*[1][.='∫']" + then: [t: "от"] # phrase(the square root 'of' 25 equals 5) - x: "*[2]" - name: repeating-decimal @@ -301,10 +415,11 @@ - if: "$IsSingular" # HACK: '\uF8FE' is used internally for the concatenation char by 'ct' -- this gets the prefix concatenated to the base then: [x: "concat('\uF8FE', $Word)"] + - else_if: "$Word='грамм' and not(preceding-sibling::*[1][self::m:mn])" + then: [x: "concat('\uF8FE', 'граммы')"] - else_if: "DefinitionValue($Word, 'Speech', 'PluralForms') != ''" then: [x: "concat('\uF8FE', DefinitionValue($Word, 'Speech', 'PluralForms'))"] else: [x: "concat('\uF8FE', $Word)", ct: "с"] - - name: sin tag: mi @@ -326,28 +441,19 @@ match: ".='tan' or .='tg'" replace: - bookmark: "@id" - - test: - if: "$Verbosity='Terse'" - then: [t: "тан"] # phrase(the 'tan' is the ratio of the opposite to the adjacent side of a right-angled triangle) - else: [t: "касательная"] # phrase(a 'tangent' is a straight line that touches a curve) + - t: "тангенс" - name: sec tag: mi match: ".='sec'" replace: - bookmark: "@id" - - test: - if: "$Verbosity='Terse'" - then: [t: "искать"] # phrase(to 'seek' a solution) - else: [t: "secant"] # phrase(a 'secant' intersects a curve at two or more points) + - t: "секанс" - name: csc tag: mi match: ".='csc'" replace: - bookmark: "@id" - - test: - if: "$Verbosity='Terse'" - then: [t: "cosecant"] # phrase(we will 'cosecant' a solution) - else: [t: "cosecant"] # phrase(the 'cosecant' is the reciprocal of the secant) + - t: "косеканс" - name: cot tag: mi match: ".='cot'" @@ -355,8 +461,8 @@ - bookmark: "@id" - test: if: "$Verbosity='Terse'" - then: [t: "котангент"] # phrase(find the 'cotangent' in a right-angle triangle) - else: [t: "котангент"] # phrase(the 'cotangent' is the reciprocal of the tangent) + then: [t: "котангенс"] # phrase(find the 'cotangent' in a right-angle triangle) + else: [t: "котангенс"] # phrase(the 'cotangent' is the reciprocal of the tangent) - name: sinh tag: mi @@ -384,7 +490,7 @@ - test: if: "$Verbosity='Terse'" then: [t: "танч"] # phrase('tanch' is shorthand for hyperbolic tangent) - else: [t: "гиперболическая касательная"] # phrase('hyperbolic tangent' is a mathematical function) + else: [t: "гиперболический тангенс"] # phrase('hyperbolic tangent' is a mathematical function) - name: sech tag: mi match: ".='sech'" @@ -393,7 +499,7 @@ - test: if: "$Verbosity='Terse'" then: [t: "шек"] # phrase('sheck' is shorthand for hyperbolic secant) - else: [t: "гиперболический секунд"] # phrase('hyperbolic secant' is a mathematical function) + else: [t: "гиперболический секанс"] # phrase('hyperbolic secant' is a mathematical function) - name: csch tag: mi match: ".='csch'" @@ -402,7 +508,7 @@ - test: if: "$Verbosity='Terse'" then: [t: "coscheck"] # phrase('cosheck' is shorthand for hyperbolic cosecant) - else: [t: "гиперболический коскант"] # phrase('hyperbolic cosecant' is a mathematical function) + else: [t: "гиперболический косеканс"] # phrase('hyperbolic cosecant' is a mathematical function) - name: coth tag: mi match: ".='coth'" @@ -411,7 +517,102 @@ - test: if: "$Verbosity='Terse'" then: [t: "cotanch"] # phrase('cotanch' is shorthand for hyperbolic cotangent) - else: [t: "гиперболический котангент"] # phrase(the 'hyperbolic cotangent' is a mathematical function) + else: [t: "гиперболический котангенс"] # phrase(the 'hyperbolic cotangent' is a mathematical function) + +- name: trig-name-sequence-canonical + tag: mrow + match: + - "count(*)=11 and *[1]/*[1][.='sin'] and *[3]/*[1][.='cos'] and *[5]/*[1][.='tan'] and " + - "*[7]/*[1][.='sec'] and *[9]/*[1][.='csc'] and *[11]/*[1][.='cot']" + replace: + - x: "*[1]" + - x: "*[2]" + - x: "*[3]" + - x: "*[4]" + - x: "*[5]" + - x: "*[6]" + - x: "*[7]" + - pause: short + - x: "*[8]" + - x: "*[9]" + - pause: short + - x: "*[10]" + - x: "*[11]" + +- name: hyperbolic-trig-name-sequence-canonical + tag: mrow + match: + - "count(*)=11 and *[1]/*[1][.='sinh'] and *[3]/*[1][.='cosh'] and *[5]/*[1][.='tanh'] and " + - "*[7]/*[1][.='sech'] and *[9]/*[1][.='csch'] and *[11]/*[1][.='coth']" + replace: + - x: "*[1]" + - pause: short + - x: "*[2]" + - x: "*[3]" + - pause: short + - x: "*[4]" + - x: "*[5]" + - pause: short + - x: "*[6]" + - x: "*[7]" + - pause: short + - x: "*[8]" + - x: "*[9]" + - pause: short + - x: "*[10]" + - x: "*[11]" + +- name: trig-name-sequence + tag: mrow + match: + - "count(*)=23 and *[1][.='sin'] and *[5][.='cos'] and *[9][.='tan'] and " + - "*[13][.='sec'] and *[17][.='csc'] and *[21][.='cot']" + replace: + - x: "*[1]" + - x: "*[3]" + - x: "*[4]" + - x: "*[5]" + - x: "*[7]" + - x: "*[8]" + - x: "*[9]" + - x: "*[11]" + - x: "*[12]" + - x: "*[13]" + - x: "*[15]" + - pause: short + - x: "*[16]" + - x: "*[17]" + - x: "*[19]" + - pause: short + - x: "*[20]" + - x: "*[21]" + - x: "*[23]" + +- name: trig-name-sequence-no-apply + tag: mrow + match: + - "count(*)=17 and *[1][.='sin'] and *[4][.='cos'] and *[7][.='tan'] and " + - "*[10][.='sec'] and *[13][.='csc'] and *[16][.='cot']" + replace: + - x: "*[1]" + - x: "*[2]" + - x: "*[3]" + - x: "*[4]" + - x: "*[5]" + - x: "*[6]" + - x: "*[7]" + - x: "*[8]" + - x: "*[9]" + - x: "*[10]" + - x: "*[11]" + - pause: short + - x: "*[12]" + - x: "*[13]" + - x: "*[14]" + - pause: short + - x: "*[15]" + - x: "*[16]" + - x: "*[17]" - name: exponential tag: mi match: ".='exp'" @@ -419,8 +620,8 @@ - bookmark: "@id" - test: if: "$Verbosity='Terse'" - then: [t: "экс"] # phrase('exp' means exponential function) - else: [t: "экспоненциальная"] # phrase('exponential' function) + then: [t: "эксп"] # phrase('exp' means exponential function) + else: [t: "экспонента"] # phrase('exponential' function) - name: covariance tag: mi match: ".='Cov'" @@ -428,8 +629,8 @@ - bookmark: "@id" - test: if: "$Verbosity='Terse'" - then: [t: "cov"] # phrase('Cov' is shorthand for the covariance function) - else: [t: "ковариации"] # phrase('covariance' function) + then: [t: "Cov"] # phrase('Cov' is shorthand for the covariance function) + else: [t: "ковариация"] # phrase('covariance' function) - name: log # handle both log and ln (if in an mrow, 'intents' are used) @@ -437,16 +638,12 @@ match: ".='log' or .='ln'" replace: - bookmark: "@id" - - test: - - if: "$Verbosity!='Terse'" - then: [t: "а"] # phrase('the' logarithm function is used in mathematics) - - test: - if: ".= 'log'" - then: [t: "log"] # phrase(the 'log' function is used in mathematics) + then: [t: "логарифм"] # phrase(the 'log' function is used in mathematics) - else_if: "$Verbosity='Terse'" - then: [spell: "'ln'"] - else: [t: "natural log"] # phrase(the 'natural log' function is used in mathematics) + then: [t: "эл эн"] + else: [t: "натуральный логарифм"] # phrase(the 'natural log' function is used in mathematics) - name: multi-line @@ -463,13 +660,19 @@ - x: "$LineCount" - test: - if: "self::m:piecewise" - then: [t: "случай"] # phrase(this is the first 'case' of three cases) + then_test: + if: "$LineCount = 1" + then: [t: "случай"] + else: [t: "случая"] # phrase(this is the first 'case' of three cases) - else_if: "self::m:system-of-equations" - then: [t: "уравнение"] # phrase(this is the first 'equation' of three equations) - else: [t: "линия"] # phrase(this is the first 'line' of three lines) - - test: - - if: "$LineCount != 1" - then: [ct: "с"] # plural + then_test: + if: "$LineCount = 1" + then: [t: "уравнение"] + else: [t: "уравнения"] # phrase(this is the first 'equation' of three equations) + else_test: + if: "$LineCount = 1" + then: [t: "строка"] + else: [t: "строки"] # phrase(this is the first 'line' of three lines) - pause: short - x: "*" - pause: long @@ -486,10 +689,10 @@ - pause: medium - test: - if: "parent::m:piecewise" - then: [t: "дело"] # phrase('case' 1 of 10 cases) + then: [t: "случай"] # phrase('case' 1 of 10 cases) - else_if: "parent::m:system-of-equations" then: [t: "уравнение"] # phrase('equation' 1 of 10 equations) - else: [t: "линия"] # phrase('line 1 of 10 lines) + else: [t: "строка"] # phrase('line 1 of 10 lines) - x: "count(preceding-sibling::*[not(contains(@data-intent-property, ':continued-row:'))]) + 1" - test: if: "self::m:mlabeledtr" @@ -538,14 +741,12 @@ variables: [IsColumnSilent: true()] match: "count(*)=1 and *[self::m:mtr][count(*) = 1]" replace: - - ot: "the" # phrase('the' 1 by 1 matrix M) - - t: "1 по 1" # phrase(the '1 by 1' matrix) - test: if: "self::m:determinant" # just need to check the first bracket since we know it must be (, [, or | then: [t: "определитель"] # phrase(the 2 by 2 'determinant')) else: [t: "матрица"] # phrase(the 2 by 2 'matrix') - - - t: "с входом" # phrase(the 2 by 2 matrix 'with entry' x) + - t: "1 на 1" # phrase(the '1 by 1' matrix) + - t: "с элементом" # phrase(the 2 by 2 matrix 'with entry' x) - x: "*[1]/*" # simpler reading methods for special case matrices @@ -554,11 +755,10 @@ # select all the non-zero entries -- if there are none of them, then it is a zero matrix match: "not( */*/*[not(self::m:mn and .= 0)] )" replace: - - t: "the" # phrase('the' 1 by 2 matrix M) + - t: "нулевая матрица" # phrase(the 2 by 2 'zero matrix') - x: count(*) - - t: "от" # phrase(the 1 'by' 2 matrix) + - t: "на" # phrase(the 1 'by' 2 matrix) - x: count(*[self::m:mtr][1]/*) - - t: "нулевая матрица" # phrase(the 2 by 2 'zero matrix') - pause: long - name: identity-matrix @@ -571,11 +771,10 @@ - " [count(../preceding-sibling::*)!=count(../../preceding-sibling::*) or .!= 1]" - " )" replace: - - t: "the" # phrase('the' 1 by 2 matrix M) + - t: "единичная матрица" # phrase(the 2 by 2 'identity matrix') - x: count(*) - - t: "от" # phrase(the 1 'by' 2 matrix) + - t: "на" # phrase(the 1 'by' 2 matrix) - x: count(*[self::m:mtr][1]/*) - - t: "матрица идентичности" # phrase(the 2 by 2 'identity matrix') - pause: long - name: diagonal-matrix @@ -588,11 +787,10 @@ - " [count(../preceding-sibling::*)!=count(../../preceding-sibling::*)]" - " )" replace: - - t: "матрица 1 на 2" # phrase('the' 1 by 2 matrix) + - t: "диагональная матрица" # phrase(the 2 by 2 'diagonal matrix') - x: count(*) - - t: "от" # phrase(the 1 'by' 2 matrix) + - t: "на" # phrase(the 1 'by' 2 matrix) - x: count(*[self::m:mtr][1]/*) - - t: "диагональная матрица" # phrase(the 2 by 2 'diagonal matrix') - pause: long - insert: # this lists the diagonal 'mtd's to be read, and they say "column nnn" before reading the contents @@ -612,13 +810,12 @@ - count(*)<=3 and # at least two rows - IsNode(*/*/*,'simple') # IsNode() returns true if all the nodes are simple replace: - - t: "а" # phrase('the' 2 by 2 matrix M) - - x: count(*) - - t: "на 1 столбец" # phrase(the 2 'by 1 column' matrix) - test: if: "$ClearSpeak_Matrix = 'Vector' or $ClearSpeak_Matrix = 'EndVector'" - then: [t: "вектор"] # phrase(the 2 by 2 'vector') - else: [t: "матрица"] # phrase(the 2 by 2 'matrix') + then: [t: "вектор-столбец"] + else: [t: "матрица-столбец"] + - x: count(*) + - t: "на 1" # phrase(the 2 'by 1 column' matrix) - pause: long - x: "*/*" - test: @@ -635,13 +832,12 @@ variables: [IsColumnSilent: true()] match: "*[self::m:mtr][count(*) = 1]" replace: - - t: "а" # phrase('the' 2 by 2 matrix M) - - x: "count(*)" - - t: "на 1 столбец" # phrase(the 2 'by 1 column' matrix) - test: if: "$ClearSpeak_Matrix = 'Vector' or $ClearSpeak_Matrix = 'EndVector'" - then: [t: "вектор"] # phrase(the 2 column 'vector') - else: [t: "матрица"] # phrase(the 2 by 2 'matrix') + then: [t: "вектор-столбец"] + else: [t: "матрица-столбец"] + - x: "count(*)" + - t: "на 1" # phrase(the 2 'by 1 column' matrix) - pause: long - x: "*" # select the rows (mtr) - test: @@ -657,13 +853,12 @@ - count(*[1]/*)<=3 and # at least two cols - IsNode(*/*/*,'simple') # IsNode() returns true if all the nodes are simple replace: - - t: "матрица 1 от" # phrase('the 1 by' 2 matrix) - - x: count(*/*) - - t: "строк" # phrase(the 1 by 4 'row' matrix) - test: if: "$ClearSpeak_Matrix = 'Vector' or $ClearSpeak_Matrix = 'EndVector'" - then: [t: "1 от"] # phrase('the 1 by' 2 row 'vector') - else: [t: "1 от "] # phrase('the 1 by' 2 'matrix') + then: [t: "вектор-строка"] + else: [t: "матрица-строка"] + - t: "1 на" # phrase('the 1 by' 2 matrix) + - x: count(*/*) - pause: long - x: "*/*" - test: @@ -680,13 +875,12 @@ variables: [IsColumnSilent: "$SpeechStyle = 'ClearSpeak' and $ClearSpeak_Matrix = 'SilentColNum'"] match: "count(*)=1" # one row replace: - - t: "матрица 1 от" # phrase('the 1 by' 2 matrix) - - x: "count(*/*)" - - t: "ряд" # phrase(the 1 by 2 'row' matrix) - test: if: "$ClearSpeak_Matrix = 'Vector' or $ClearSpeak_Matrix = 'EndVector'" - then: [t: "вектор"] # phrase(the 2 by 1 'vector') - else: [t: "матрица"] # phrase(the 2 by 2 'matrix') + then: [t: "вектор-строка"] + else: [t: "матрица-строка"] + - t: "1 на" # phrase('the 1 by' 2 matrix) + - x: "count(*/*)" - pause: long - pause: medium - x: "*/*" # select the cols (mtd) @@ -707,14 +901,13 @@ - IsNode(*/*/*,'simple') # IsNode() returns true if all the nodes are simple variables: [IsColumnSilent: "$SpeechStyle = 'SimpleSpeak' or ($SpeechStyle = 'ClearSpeak' and $ClearSpeak_Matrix != 'SpeakColNum')"] replace: - - t: "the" # phrase('the' 1 by 2 matrix M) - - x: count(*) - - t: "от" # phrase(the 1 'by' 2 matrix) - - x: count(*[self::m:mtr][1]/*) - test: if: "self::m:determinant" then: [t: "определитель"] # phrase(the 2 by 2 'determinant') else: [t: "матрица"] # phrase(the 2 by 2 'matrix') + - x: count(*) + - t: "на" # phrase(the 1 'by' 2 matrix) + - x: count(*[self::m:mtr][1]/*) - pause: long - x: "*" - test: @@ -731,14 +924,13 @@ variables: [IsColumnSilent: "$SpeechStyle = 'ClearSpeak' and $ClearSpeak_Matrix = 'SilentColNum'"] match: "." replace: - - t: "the" # phrase('the' 1 by 2 matrix M) - - x: "count(*)" - - t: "от" # phrase(the 1 'by' 2 matrix) - - x: "count(*[self::m:mtr][1]/*)" - test: if: "self::m:determinant" then: [t: "определитель"] # phrase(the 2 by 2 'determinant') else: [t: "матрица"] # phrase(the 2 by 2 'matrix') + - x: "count(*)" + - t: "на" # phrase(the 1 'by' 2 matrix) + - x: "count(*[self::m:mtr][1]/*)" - pause: long - x: "*" - test: @@ -757,10 +949,10 @@ - x: "*[2]" - test: if: "$Verbosity='Verbose'" - then: [t: "script"] # phrase(H 'subscript' 2) + then: [t: "нижний индекс"] # phrase(H 'subscript' 2) else_test: if: "$Verbosity='Medium'" - then: [t: "sub"] # phrase(H 'sub' 2) + then: [t: "нижний индекс"] # phrase(H 'sub' 2) - x: "*[3]" - name: dimension-by @@ -778,10 +970,10 @@ - x: "*[2]" - test: if: "$Verbosity='Verbose'" - then: [t: "superscript"] # phrase(H 'superscript' 2) + then: [t: "верхний индекс"] # phrase(H 'superscript' 2) else_test: if: "$Verbosity='Medium'" - then: [t: "super"] # phrase(H 'super' 2) + then: [t: "верхний индекс"] # phrase(H 'super' 2) - x: "*[3]" - test: if: "following-sibling::*[1][.='+' or .='-']" # a little lazy -- assumes chemistry superscripts end with + or - @@ -809,10 +1001,10 @@ then: - test: if: "$Verbosity='Verbose'" - then: [t: "superscript"] # phrase(H 'superscript' 2) + then: [t: "верхний индекс"] # phrase(H 'superscript' 2) else_test: if: "$Verbosity='Medium'" - then: [t: "super"] # phrase(H 'super' 2) + then: [t: "верхний индекс"] # phrase(H 'super' 2) - x: "$Prescripts[2]" - pause: "short" - test: @@ -820,10 +1012,10 @@ then: - test: if: "$Verbosity='Verbose'" - then: [t: "индекс"] # phrase(a 'subscript' may be used to indicate an index) + then: [t: "нижний индекс"] # phrase(a 'subscript' may be used to indicate an index) else_test: if: "$Verbosity='Medium'" - then: [t: "суб"] # phrase(here is a 'sub' total) + then: [t: "нижний индекс"] # phrase(here is a 'sub' total) - x: "$Prescripts[1]" - pause: "short" - test: @@ -834,10 +1026,10 @@ then: - test: if: "$Verbosity='Verbose'" - then: [t: "superscript"] # phrase(H 'superscript' 2) + then: [t: "верхний индекс"] # phrase(H 'superscript' 2) else_test: if: "$Verbosity='Medium'" - then: [t: "super"] # phrase(H 'super' 2) + then: [t: "верхний индекс"] # phrase(H 'super' 2) - x: "$Prescripts[4]" - pause: "short" - test: diff --git a/Rules/Languages/ru/SharedRules/geometry.yaml b/Rules/Languages/ru/SharedRules/geometry.yaml index 9863f40a..4a03fbc3 100644 --- a/Rules/Languages/ru/SharedRules/geometry.yaml +++ b/Rules/Languages/ru/SharedRules/geometry.yaml @@ -12,9 +12,11 @@ - t: "до" # phrase(the line segment from A 'to' B) - x: "*[2]" else: - - t: "линейный сегмент" # phrase(the 'line segment' A B) - - x: "*[1]" - - x: "*[2]" + - t: "отрезок" # phrase(the 'line segment' A B) + - x: "translate(*[1], 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')" + - t: "большое" + - x: "translate(*[2], 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')" + - t: "большое" - name: geometry-ray tag: ray @@ -28,9 +30,11 @@ - t: "до" # phrase(the ray from A 'to' B) - x: "*[2]" else: - - t: "луча" # phrase(the 'ray'A B) - - x: "*[1]" - - x: "*[2]" + - t: "луч" # phrase(the 'ray'A B) + - x: "translate(*[1], 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')" + - t: "большое" + - x: "translate(*[2], 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')" + - t: "большое" - name: geometry-arc tag: arc @@ -40,8 +44,10 @@ if: "$Verbosity='Verbose'" then: [t: "а"] # phrase('the' arc A B C) - t: "дуга" # phrase(the 'arc' A B C) - - x: "*[1]" - - x: "*[2]" + - x: "translate(*[1], 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')" + - t: "большое" + - x: "translate(*[2], 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')" + - t: "большое" - name: measure-of-angle tag: measure-of-angle diff --git a/Rules/Languages/ru/SimpleSpeak_Rules.yaml b/Rules/Languages/ru/SimpleSpeak_Rules.yaml index 402ef73a..7e75d01d 100644 --- a/Rules/Languages/ru/SimpleSpeak_Rules.yaml +++ b/Rules/Languages/ru/SimpleSpeak_Rules.yaml @@ -42,9 +42,17 @@ else: [pause: short] - x: "*[1]" - test: - if: "IsNode(*[1], 'leaf') or $Impairment != 'Blindness'" - then: [pause: short] - else: [t: "конец корня", pause: short] # (en: 'end of root') + - if: "IsNode(*[1], 'leaf') or $Impairment != 'Blindness'" + then_test: + if: "following-sibling::*" + then: [pause: medium] + else: [pause: short] + else: + - t: "конец корня" + - test: + if: "following-sibling::*" + then: [pause: medium] + else: [pause: short] # (en: 'end of root') - name: default tag: root @@ -60,23 +68,26 @@ then: [t: "квадратный корень"] # (en: 'square root') - else_if: "*[2][.='3']" then: [t: "кубический корень"] # (en: 'cube root') - - else: [x: "ToOrdinal(*[2])", t: "корень"] # (en: 'root') + - else: [t: "корень", x: "ToOrdinal(*[2])", t: "степени"] # (en: 'root') else: - - test: - if: "*[2][self::m:mi][string-length(.)=1]" - then: - - x: "*[2]" - - pronounce: [{text: "-й"}, {ipa: "j"}, {sapi5: "th"}, {eloquence: "T"}] - else: [x: "*[2]"] - - t: "корень" # (en: 'root') + - t: "корень степени" # (en: 'root') + - x: "*[2]" - test: if: "$Verbosity!='Terse'" then: [t: "из"] # (en: 'of') - x: "*[1]" - test: - if: "IsNode(*[1], 'leaf') or $Impairment != 'Blindness'" - then: [pause: short] - else: [t: "конец корня", pause: short] # (en: 'end of root') + - if: "IsNode(*[1], 'leaf') or $Impairment != 'Blindness'" + then_test: + if: "following-sibling::*" + then: [pause: medium] + else: [pause: short] + else: + - t: "конец корня" + - test: + if: "following-sibling::*" + then: [pause: medium] + else: [pause: short] # (en: 'end of root') # Fraction rules # Mixed numbers mostly "just work" because the invisible char reads as "and" and other parts read properly on their own @@ -87,7 +98,10 @@ - "*[2][self::m:mn][not(contains(., '.')) and 2<= text() and text()<=10]" variables: [IsPlural: "*[1]!=1"] replace: - - x: "*[1]" + - test: + - if: "DefinitionValue(*[1], 'Speech', 'FractionNumerators') != ''" + then: [x: "DefinitionValue(*[1], 'Speech', 'FractionNumerators')"] + else: [x: "*[1]"] - x: "ToOrdinal(*[2], true(), $IsPlural)" # extra args specify fractional ordinal and whether it is plural - name: common-fraction-mixed-number @@ -98,19 +112,33 @@ - "*[2][self::m:mn][not(contains(., '.'))]" variables: [IsPlural: "*[1]!=1"] replace: - - x: "*[1]" - - x: "ToOrdinal(*[2], true(), $IsPlural)" # extra args specify fractional ordinal and whether it is plural + - test: + - if: "DefinitionValue(*[1], 'Speech', 'FractionNumerators') != ''" + then: [x: "DefinitionValue(*[1], 'Speech', 'FractionNumerators')"] + - else: [x: "*[1]"] + - test: + if: "*[2][.='83']" + then: [t: "восемьдесят третьих"] + else: [x: "ToOrdinal(*[2], true(), $IsPlural)"] # extra args specify fractional ordinal and whether it is plural # Units (e.g., meters per second) - name: per-fraction tag: fraction - match: "BaseNode(*[1])[contains(@data-intent-property, ':unit') or (self::m:mrow and self::*[3][contains(@data-intent-property, ':unit')])] and - BaseNode(*[1])[contains(@data-intent-property, ':unit') or (self::m:mrow and self::*[3][contains(@data-intent-property, ':unit')])]" + match: + - "BaseNode(*[1])[contains(@data-intent-property, ':unit') or" + - " (self::m:mrow and count(*)=3 and *[1][self::m:mn] and *[2][.='⁢'] and BaseNode(*[3])[contains(@data-intent-property, ':unit')])] and" + - "BaseNode(*[2])[contains(@data-intent-property, ':unit')]" replace: - x: "*[1]" - - t: "в" # (en: 'per') — например, "метров в секунду" - - x: "*[2]" + - test: + if: "BaseNode(*[2])[.='h' or .='hr' or .='Hr']" + then: [t: "в"] + else: [t: "на"] + - test: + if: "BaseNode(*[2])[.='mi']" + then: [t: "милю"] + else: [x: "*[2]"] - name: simple # don't include nested fractions. E.g, fraction a plus b over c + 1 end fraction" is ambiguous @@ -126,27 +154,41 @@ - x: "*[2]" - pause: short +- name: limit-fraction-learning + tag: fraction + match: "(ancestor::*[self::m:limit] or ancestor::*[preceding-sibling::*[1][self::m:limit]] or preceding::*[self::m:limit]) and $Impairment='LearningDisability'" + replace: + - x: "*[1]" + - pause: short + - t: "делить на" + - x: "*[2]" + +- name: limit-fraction + tag: fraction + match: "ancestor::*[self::m:limit] or ancestor::*[preceding-sibling::*[1][self::m:limit]] or preceding::*[self::m:limit]" + replace: + - t: "дроби" + - pause: short + - x: "*[1]" + - pause: short + - t: "делить на" + - pause: short + - x: "*[2]" + - pause: short + - t: "конец дроби" + - pause: medium + - name: default tag: fraction match: "." replace: - - test: - if: "$Impairment = 'Blindness'" - then: [t: "дробь"] # (en: 'fraction') - - pause: short + - t: "дробь, числитель:" # (en: 'fraction') - x: "*[1]" - - test: - if: "not(IsNode(*[1],'leaf'))" - then: [pause: short] - - t: "на" # (en: 'over') - - test: - if: "not(IsNode(*[2],'leaf'))" - then: [pause: short] + - pause: short + - t: "знаменатель:" # (en: 'over') - x: "*[2]" - pause: short - - test: - if: "$Impairment = 'Blindness'" - then: [t: "конец дроби"] # (en: 'end of fraction') + - t: "конец дроби" # (en: 'end of fraction') - pause: medium # rules for functions raised to a power @@ -156,8 +198,14 @@ tag: inverse-function match: "." replace: - - t: "обратная" # (en: 'inverse') - - x: "*[1]" + - test: + - if: "*[1][.='sin']" + then: [t: "арксинус"] + - else_if: "*[1][.='cos' or .='cosh']" + then: [t: "арккосинус"] + - else_if: "*[1][.='tan' or .='tg']" + then: [t: "арктангенс"] + else: [t: "обратная", x: "*[1]"] # (en: 'inverse') - name: function-squared-or-cubed tag: power @@ -176,17 +224,20 @@ match: - "following-sibling::*[1][self::m:mo][.='⁡']" #invisible function apply replace: - - test: - if: "$Verbosity!='Terse'" - then: [t: ""] + - x: "*[1]" - bookmark: "*[2]/@id" + - t: "в" - test: - if: "*[2][self::m:mn][not(contains(., '.'))]" + - if: "*[2][self::m:mn][.='4']" + then: [t: "четвертой"] + - else_if: "*[2][self::m:mn][not(contains(., '.'))]" then: [x: "ToOrdinal(*[2])"] - else: [x: "*[2]"] - - t: "степень" # (en: 'power') - - pause: short - - x: "*[1]" + else: + - t: "степени" + - x: "*[2]" + - test: + if: "*[2][self::m:mn][not(contains(., '.'))]" + then: [t: "степени"] # (en: 'power') # non-function rules for power - name: squared-or-cubed @@ -205,11 +256,17 @@ match: "*[2][self::m:mn][not(contains(., '.'))]" replace: - x: "*[1]" - - t: "в" # (en: 'to the') - test: - if: "*[2][.>0]" + if: "*[2][.='2']" + then: [t: "во"] + else: [t: "в"] # (en: 'to the') + - test: + if: "*[2][.>=0]" then: {x: "ToOrdinal(*[2])"} else: {x: "*[2]"} + - test: + if: "*[2][.>=0]" + then: [t: "степени"] - name: simple-negative-integer tag: power match: @@ -217,24 +274,27 @@ - " *[1][self::m:mn][not(contains(., '.'))]]" replace: - x: "*[1]" - - t: "в" # (en: 'to the') - - x: "*[2]" + - t: "в степени" # (en: 'to the') + - t: "минус" + - x: "*[2]/*[1]" - name: simple-var tag: power match: "*[2][self::m:mi][string-length(.)=1]" replace: - x: "*[1]" - - t: "в" # (en: 'to the') + - t: "в степени" # (en: 'to the') - x: "*[2]" - - pronounce: [{text: "-й"}, {ipa: "j"}, {sapi5: "th"}, {eloquence: "T"}] - name: simple tag: power match: "IsNode(*[2], 'leaf')" replace: - x: "*[1]" - - t: "в" # (en: 'to the') - - x: "*[2]" + - t: "в степени" # (en: 'to the') + - test: + if: "*[2][self::m:mn][contains(., '.')]" + then: [x: "concat(substring-before(*[2], '.'), '\uF8FE.\uF8FE', substring-after(*[2], '.'))"] + else: [x: "*[2]"] - name: nested # it won't end in "power" if the exponent is simple enough @@ -250,11 +310,10 @@ - x: "*[1]" - t: "в степени" # (en: 'raised to the') - x: "*[2]" - - pause: short - test: if: "$Impairment = 'Blindness'" then: - - t: "конец степени" # (en: 'end of exponent') + - t: ", конец показателя" # (en: 'end of exponent') - pause: short else: - pause: medium @@ -265,13 +324,158 @@ replace: - x: "*[1]" - t: "в степени" # (en: 'raised to the') - - x: "*[2]" - - t: "" - - pause: short + - test: + if: "*[2][self::m:mn][contains(., '.')]" + then: [x: "concat(substring-before(*[2], '.'), '\uF8FE.\uF8FE', substring-after(*[2], '.'))"] + else: [x: "*[2]"] # # Some rules on mrows # +- name: mixed-number + tag: mrow + match: "count(*)=3 and *[1][self::m:mn] and *[2][self::m:mo][.='⁤'] and *[3][self::m:fraction]" + replace: + - x: "*[1]" + - t: "целых" + - x: "*[2]" + - x: "*[3]" + +- name: plus-before-nested-fraction + tag: mrow + match: "count(*)=3 and *[2][self::m:mo][.='+'] and *[3][self::m:fraction or self::m:square-root] and parent::m:fraction" + replace: + - x: "*[1]" + - x: "*[2]" + - pause: short + - x: "*[3]" + +- name: equality-with-root + tag: mrow + match: + - "count(*)=3 and *[2][.='='] and" + - "(*[1][self::m:mrow[m:square-root or m:root or m:msqrt or m:mroot]] or" + - " *[3][self::m:square-root or self::m:root or self::m:msqrt or self::m:mroot])" + replace: + - x: "*[1]" + - pause: medium + - x: "*[2]" + - pause: short + - x: "*[3]" + +- name: SimpleSpeak-log + tag: mrow + match: + - "((count(*)=2 and *[2][IsBracketed(., '(', ')')]) or" + - " (count(*)=3 and *[2][self::m:mo][.='⁡'] and *[3][IsBracketed(., '(', ')')])) and" + - "*[1][self::m:mi][.='log' or .='ln']" + replace: + - test: + - if: "*[1][.='log']" + then: [t: "логарифм"] + - else_if: "$Verbosity='Terse'" + then: [t: "эл эн"] + else: [t: "натуральный логарифм"] + - test: + if: "$Verbosity!='Terse'" + then: [t: "от"] + - pause: short + - test: + if: "count(*)=2" + then: [x: "*[2]"] + else: [x: "*[3]"] + +- name: SimpleSpeak-log-with-base + tag: mrow + match: "count(*)=3 and *[1][self::m:logarithm-with-base] and *[2][.='⁡']" + replace: + - t: "логарифм по основанию" + - x: "*[1]/*[1]" + - t: "от" + - test: + if: "not(IsNode(*[3], 'simple'))" + then: [pause: short] + - x: "*[3]" + +- name: simple-parens-after-apply-or-times + tag: mrow + match: + - "IsBracketed(., '(', ')') and IsNode(*[2], 'simple') and " + - "preceding-sibling::*[1][.='⁡' or (.='⁢' and not(@data-function-guess))]" + replace: + - x: "*[2]" + +- name: function-argument-parens + tag: mrow + match: + - "IsBracketed(., '(', ')') and " + - "(preceding-sibling::*[1][.='⁡'] or preceding-sibling::*[2][self::m:mi])" + replace: + - test: + - if: "IsNode(*[2], 'simple') and not(preceding-sibling::*[1][.='⁢' and @data-function-guess])" + then: [x: "*[2]"] + else: + - test: + if: "$Verbosity='Terse'" + then: [t: "открывается"] + else_test: + if: "ancestor-or-self::*[contains(@data-intent-property, ':literal:')]" + then: [t: "открывающая круглая скобка"] + else_test: + if: ".//m:mo[.='|' or .='∣' or .='∩'] or .//m:mtext[contains(., 'and')] or .//*[contains(name(.), 'given')]" + then: [t: "открывающая круглая скобка"] + else: [t: "скобка открывается"] + - test: + if: ".//m:mo[.='|' or .='∣' or .='∩'] or .//m:mtext[contains(., 'and')] or .//*[contains(name(.), 'given')]" + then: [pause: short] + - x: "*[2]" + - test: + if: "$Verbosity!='Terse' and not(IsNode(*[2], 'simple'))" + then: [pause: short] + - test: + if: "$Verbosity='Terse'" + then: [t: "закрывается"] + else_test: + if: "ancestor-or-self::*[contains(@data-intent-property, ':literal:')]" + then: [t: "закрывающая круглая скобка"] + else_test: + if: ".//m:mo[.='|' or .='∣' or .='∩'] or .//m:mtext[contains(., 'and')] or .//*[contains(name(.), 'given')]" + then: [t: "закрывающая круглая скобка"] + else: [t: "скобка закрывается"] + - test: + if: "following-sibling::*[1][.='+' or .='=']" + then: [pause: medium] + +- name: trig-function-noninteger-power + tag: mrow + match: + - "count(*)=3 and *[1][self::m:power and IsInDefinition(*[1], 'TrigFunctionNames') and not(*[2][self::m:mn])] and" + - "*[2][.='⁡']" + replace: + - x: "*[1]/*[1]" + - x: "*[3]" + - t: "в степени" + - x: "*[1]/*[2]" + +- name: exponent-argument-parens + tag: mrow + match: + - "IsBracketed(., '(', ')') and " + - "ancestor::*[self::m:power]" + replace: + - test: + if: "*[2][self::m:fraction]" + then: [pause: medium] + - t: "скобка открывается" + - test: + if: "*[2][self::m:fraction]" + then: [pause: short] + - x: "*[2]" + - test: + if: "*[2][self::m:fraction or .//m:mo[.='+' or .='-' or .='−']]" + then: [pause: short] + - t: "скобка закрывается" + - name: set tag: set match: "." @@ -290,7 +494,10 @@ then: [t: ""] - t: "множество всех" # (en: 'set of all') - x: "*[1]/*[1]" - - t: "таких, что" # (en: 'such that') + - test: + if: "*[1]//*[.='∈']" + then: [t: "таких что"] + else: [t: "таких, что"] # (en: 'such that') - x: "*[1]/*[3]" else: - test: @@ -299,6 +506,18 @@ - t: "множество" # (en: 'set') - x: "*[1]" +- name: no-times-before-exponential + tag: mo + match: ".='\u2062' and following-sibling::*[1][(self::m:power or self::m:msup) and *[1][self::m:mi[.='e']]]" + replace: + - t: "" + +- name: no-times-before-exponent-brackets + tag: mo + match: ".='\u2062' and ancestor::*[self::m:power] and following-sibling::*[1][IsBracketed(., '(', ')')]" + replace: + - pause: medium + - name: times tag: mo match: @@ -325,7 +544,10 @@ - " IsBracketed(., '(', ')') or IsBracketed(., '[', ']') or IsBracketed(., '|', '|')]" # followed by parens - " )" replace: - - t: "умножить" # (en: 'times') + - t: "умножить на" # (en: 'times') + - test: + if: "following-sibling::*[1][self::m:binomial and (not(IsNode(*[1], 'simple')) or not(IsNode(*[2], 'simple')))]" + then: [pause: short] - name: no-say-parens tag: mrow @@ -341,7 +563,34 @@ replace: - x: "*[2]" +- name: say-bracketed-mrow + tag: mrow + match: "IsBracketed(., '(', ')') or IsBracketed(., '[', ']')" + replace: + - test: + if: "IsBracketed(., '[', ']')" + then: [t: "квадратная скобка открывается"] + else_test: + if: "ancestor-or-self::*[contains(@data-intent-property, ':literal:')] or .//m:mo[.='|' or .='∩'] or .//*[contains(., 'and')]" + then: [t: "открывающая круглая скобка"] + else: [t: "скобка открывается"] + - x: "*[2]" + - test: + if: "IsBracketed(., '(', ')') and .//m:mo[.='+' or .='-' or .='−']" + then: [pause: short] + - test: + if: "IsBracketed(., '[', ']')" + then: [t: "квадратная скобка закрывается"] + else_test: + if: "ancestor-or-self::*[contains(@data-intent-property, ':literal:')] or .//m:mo[.='|' or .='∩'] or .//*[contains(., 'and')]" + then: [t: "закрывающая круглая скобка"] + else: [t: "скобка закрывается"] + - test: + if: "following-sibling::*[1][.='+' or .='=']" + then: [pause: medium] + - include: "SharedRules/geometry.yaml" - include: "SharedRules/linear-algebra.yaml" +- include: "SharedRules/calculus.yaml" - include: "SharedRules/general.yaml" - include: "SharedRules/default.yaml" diff --git a/Rules/Languages/ru/definitions.yaml b/Rules/Languages/ru/definitions.yaml index dc627194..cd1a47df 100644 --- a/Rules/Languages/ru/definitions.yaml +++ b/Rules/Languages/ru/definitions.yaml @@ -10,25 +10,25 @@ # for readability, spaces can be used around any of the delimiter characters # Note: if there are multiple fixities, the first one is used if the fixity is not given in the intent - IntentMappings: { - "indexed-by": "infix= ; индекс; конец индекса: конец индекса: конец индекса", + "indexed-by": "infix= ; с индексом; конец индекса: с индексом: с индексом", "modified-variable": "silent= ", "say-super": "infix=верхний индекс: верхний индекс: верхний индекс", # used with 'mo' for superscripts (e.g, "<") "skip-super": "silent=", # used with 'mo' for superscripts (e.g, "*") "absolute-value": "function= ; модуль: модуль: модуль; конец модуля", - "binomial": "infix=бином; по; конец бинома", + "binomial": "infix=число сочетаний из; по; конец числа сочетаний", # "closed-interval": "other=closed-interval; от,до; end closed-interval", "greatest-common-divisor": "function=нод: нод: наибольший общий делитель", "imaginary-part": "function=мнимая часть, мнимая часть, мнимая часть", "least-common-multiple": "function=нок:нок:наименьшее общее кратное", # "large-op": "infix=над || other=от,до", - "limit": "prefix=придел при: придел при: придел при", - "lim-sup": "prefix=верхний придел при: верхний придел при: верхний придел при", - "lim-inf": "prefix=нижний придел при: нижний придел при: нижний придел при", + "limit": "prefix=предел при: предел при: предел при", + "lim-sup": "prefix=верхний предел при: верхний предел при: верхний предел при", + "lim-inf": "prefix=нижний предел при: нижний предел при: нижний предел при", "logarithm-with-base": "prefix=логарифм по основанию: логарифм по основанию: логарифм по основанию", - "natural-logarithm": "function=l n: натуральный логарифм: натуральный логарифм", - "minus": "infix=минус || prefix=отрицательное", - "plus": "infix=плюс || prefix=положительное", + "natural-logarithm": "function=эл эн: натуральный логарифм: натуральный логарифм", + "minus": "infix=минус || prefix=минус", + "plus": "infix=плюс || prefix=плюс", # "pochhammer": "infix=permutations of", # arguments are in reverse order, so can't work here "real-part": "function=действительная часть", @@ -41,6 +41,10 @@ "vector": "function= ; вектор || prefix=вектор", "cross-product": "infix=векторное произведение: векторное произведение: векторное произведение", "dot-product": "infix=скалярное произведение: скалярное произведение: скалярное произведение", + "perpendicular-to": "infix=перпендикулярно", + "perpendicular to": "infix=перпендикулярно", + "perpendicular_to": "infix=перпендикулярно", + "forced": "prefix=форсид", "divergence": "function= ; дивергенция: дивергенция: дивергенция; конец дивергенции", "curl": "function= ; ротор; конец ротора", @@ -81,7 +85,10 @@ } - OperatorIntentRenaming: { - "dimension-product": "на" + "dimension-product": "на", + "perpendicular-to": "перпендикулярно", + "perpendicular to": "перпендикулярно", + "perpendicular_to": "перпендикулярно" } - KnownWords: { @@ -190,11 +197,11 @@ "bar": "бар", "cal": "калория", "Ci": "кюри", - "grad": "градиан", - "M": "молярный", + "grad": "град", + "M": "моляр", "R": "рентген", "rpm": "оборот в минуту", - "℧": "сименс (устаревшее)", + "℧": "эм-аш-о", "dyn": "дина", "erg": "эрг", @@ -260,8 +267,87 @@ "mpg": "миля на галлон", } +- FractionNumerators: { + "1": "одна", "2": "две", "3": "три", "4": "четыре", "5": "пять", + "6": "шесть", "7": "семь", "8": "восемь", "9": "девять", + "10": "десять", "11": "одиннадцать", "12": "двенадцать", + "13": "тринадцать", "14": "четырнадцать", "15": "пятнадцать", + "16": "шестнадцать", "17": "семнадцать", "18": "восемнадцать", + "19": "девятнадцать", "89": "восемьдесят девять" + } + - PluralForms: { # FIX: this needs to be flushed out + "ампер": "ампера", + "кандела": "канделы", + "кельвин": "кельвина", + "грамм": "грамма", + "метр": "метра", + "моль": "моля", + "секунда": "секунды", + "литр": "литра", + "тонна": "тонны", + "дальтон": "дальтона", + "непер": "непера", + "атомная единица массы": "атомные единицы массы", + "электронвольт": "электронвольта", + "радиан": "радиана", + "стерадиан": "стерадиана", + "год": "года", + "угловая секунда": "угловые секунды", + "бит": "бита", + "байт": "байта", + "бод": "бода", + "беккерель": "беккереля", + "кулон": "кулона", + "градус Цельсия": "градуса Цельсия", + "фарад": "фарада", + "грей": "грея", + "генри": "генри", + "герц": "герца", + "джоуль": "джоуля", + "катал": "катала", + "люмен": "люмена", + "люкс": "люкс", + "ньютон": "ньютона", + "ом": "ома", + "паскаль": "паскаля", + "сименс": "сименс", + "зиверт": "зиверта", + "тесла": "теслы", + "вольт": "вольта", + "ватт": "ватта", + "вебер": "вебера", + "миля": "мили", + "галлон": "галлона", + "градус": "градуса", + "угловая минута": "угловые минуты", + "астрономическая единица": "астрономические единицы", + "световой год": "световых года", + "парсек": "парсека", + "ангстрем": "ангстрема", + "ферми": "ферми", + "гектар": "гектара", + "децибел": "децибела", + "атмосфера": "атмосферы", + "бар": "бара", + "калория": "калории", + "кюри": "кюри", + "град": "града", + "моляр": "моляра", + "рентген": "рентгена", + "оборот в минуту": "оборота в минуту", + "эм-аш-о": "эм-аш-о", + "дина": "дины", + "эрг": "эрга", + "кибибит": "кибибита", "мебибит": "мебибита", "гибибит": "гибибита", "тебибит": "тебибита", + "пебибит": "пебибита", "эксбибит": "эксбибита", "зебибит": "зебибита", "йобибит": "йобибита", + "кибибайт": "кибибайта", "мебибайт": "мебибайта", "гибибайт": "гибибайта", "тебибайт": "тебибайта", + "пебибайт": "пебибайта", "эксбибайт": "эксбибайта", "зебибайт": "зебибайта", "йобибайт": "йобибайта", + "час": "часа", + "день": "дня", + "неделя": "недели", + "минута": "минуты", "inch": "inches", "square inch": "square inches", "cubic inch": "cubic inches", "foot": "feet", "square foot": "square feet", "cubic foot": "cubic feet", "board foot": "board feet", @@ -301,31 +387,35 @@ # For English, a regular pattern starts at twenty - NumbersOnes: [ -«ноль», «один», «два», «три», «четыре», «пять», «шесть», «семь», «восемь», «девять», -«десять», «одиннадцать», «двенадцать», «тринадцать», «четырнадцать», «пятнадцать», «шестнадцать», -«семнадцать», «восемнадцать», «девятнадцать» +"ноль", "один", "два", "три", "четыре", "пять", "шесть", "семь", "восемь", "девять", +"десять", "одиннадцать", "двенадцать", "тринадцать", "четырнадцать", "пятнадцать", "шестнадцать", +"семнадцать", "восемнадцать", "девятнадцать" ] - NumbersOrdinalOnes: [ -«нулевой», «первый», «второй», «третий», «четвёртый», «пятый», «шестой», «седьмой», «восьмой», «девятый», -«десятый», «одиннадцатый», «двенадцатый», «тринадцатый», «четырнадцатый», «пятнадцатый», «шестнадцатый», -«семнадцатый», «восемнадцатый», «девятнадцатый» +"нулевой", "первой", "второй", "третьей", "четвёртой", "пятой", "шестой", "седьмой", "восьмой", "девятой", +"десятой", "одиннадцатой", "двенадцатой", "тринадцатой", "четырнадцатой", "пятнадцатой", "шестнадцатой", +"семнадцатой", "восемнадцатой", "девятнадцатой" ] - NumbersOrdinalPluralOnes: [ -«нулевые», «первые», «вторые», «третьи», «четвёртые», «пятые», «шестые», «седьмые», «восьмые», «девятые», -«десятые», «одиннадцатые», «двенадцатые», «тринадцатые», «четырнадцатые», «пятнадцатые», «шестнадцатые», -«семнадцатые», «восемнадцатые», «девятнадцатые» +"нулевые", "первые", "вторые", "третьи", "четвёртые", "пятые", "шестые", "седьмые", "восьмые", "девятые", +"десятые", "одиннадцатые", "двенадцатые", "тринадцатые", "четырнадцатые", "пятнадцатые", "шестнадцатые", +"семнадцатые", "восемнадцатые", "девятнадцатые" ] # stop when regularity begins - NumbersOrdinalFractionalOnes: [ -«нулевая», «первая», «вторая» +"нулевая", "первая", "вторая", "третья", "четвёртая", "пятая", "шестая", "седьмая", "восьмая", "девятая", +"десятая", "одиннадцатая", "двенадцатая", "тринадцатая", "четырнадцатая", "пятнадцатая", "шестнадцатая", +"семнадцатая", "восемнадцатая", "девятнадцатая" ] # stop when regularity begins - NumbersOrdinalFractionalPluralOnes: [ -«нулевых», «первых», «вторых» +"нулевых", "первых", "вторых", "третьих", "четвёртых", "пятых", "шестых", "седьмых", "восьмых", "девятых", +"десятых", "одиннадцатых", "двенадцатых", "тринадцатых", "четырнадцатых", "пятнадцатых", "шестнадцатых", +"семнадцатых", "восемнадцатых", "девятнадцатых" ] @@ -335,7 +425,7 @@ ] - NumbersOrdinalTens: [ -"", "десятый", "двадцатый", "тридцатый", "сороковой", "пятидесятый", "шестидесятый", "семидесятый", "восьмидесятый", "девяностый" +"", "десятой", "двадцатой", "тридцатой", "сороковой", "пятидесятой", "шестидесятой", "семидесятой", "восьмидесятой", "девяностой" ] - NumbersOrdinalPluralTens: [ @@ -345,32 +435,32 @@ - NumbersHundreds: [ "", "сто", "двести", "триста", "четыреста", "пятьсот", -« шестьсот », «семьсот», «восемьсот», «девятьсот» +"шестьсот", "семьсот", "восемьсот", "девятьсот" ] - NumbersOrdinalHundreds: [ -"", "сотый", "двухсотый", "трёхсотый", "четырёхсотый", "пятисотый", -« шестисотый », «семисотый», «восьмисотый», «девятисотый» +"", "сотой", "двухсотой", "трёхсотой", "четырёхсотой", "пятисотой", +"шестисотой", "семисотой", "восьмисотой", "девятисотой" ] - NumbersOrdinalPluralHundreds: [ "", "сотые", "двухсотые", "трёхсотые", "четырёхсотые", "пятисотые", -« шестисотые», «семисотые», «восьмисотые», «девятисотые» +"шестисотые", "семисотые", "восьмисотые", "девятисотые" ] # At this point, hopefully the language is regular. If not, code needs to be written - NumbersLarge: [ "", "тысяча", "миллион", "миллиард", "триллион", "квадриллион", - «квинтиллион», «секстиллион», «септиллион», «октиллион», «нониллион», + "квинтиллион", "секстиллион", "септиллион", "октиллион", "нониллион", ] - NumbersOrdinalLarge: [ -"", "тысячная", "миллионная", "миллиардная", "триллионная", "квадриллионная", -«квинтиллионная», «секстиллионная», «септиллионная», «октиллионная», «нониллионная» +"", "тысячной", "миллионной", "миллиардной", "триллионной", "квадриллионной", +"квинтиллионной", "секстиллионной", "септиллионной", "октиллионной", "нониллионной" ] - NumbersOrdinalPluralLarge: [ "", "тысячные", "миллионные", "миллиардные", "триллионные", "квадриллионные", -«квинтиллионные», «секстиллионные», «септиллионные», «октиллионные», «нониллионные» +"квинтиллионные", "секстиллионные", "септиллионные", "октиллионные", "нониллионные" ] diff --git a/Rules/Languages/ru/unicode-full.yaml b/Rules/Languages/ru/unicode-full.yaml index 8023d87f..99b41274 100644 --- a/Rules/Languages/ru/unicode-full.yaml +++ b/Rules/Languages/ru/unicode-full.yaml @@ -7,7 +7,7 @@ - "¥": [t: "иена"] # 0xa5 - "¦": [t: "вертикальная черта с разрывом"] # 0xa6 - "§": [t: "параграф"] # 0xa7 - - "¨": [t: "двойная точка"] # 0xa8 + - "¨": [t: "две точки"] # 0xa8 - "©": [t: "авторское право"] # 0xa9 - "ª": [t: "указатель женского рода"] # 0xaa - "¬": [t: "не"] # 0xac @@ -84,7 +84,7 @@ - "˕": [t: "модификатор нижний таск"] # 0x2d5 - "˖": [t: "модификатор знак плюс"] # 0x2d6 - "˗": [t: "модификатор знак минус"] # 0x2d7 - - "˘": [t: "бреве"] # 0x2d8 + - "˘": [t: "брэвэ"] # 0x2d8 - "˙": [t: "точка"] # 0x2d9 - "˚": [t: "кольцо сверху"] # 0x2da - "˛": [t: "огонек"] # 0x2db @@ -130,9 +130,9 @@ - "̃": [t: "тильда"] # 0x303 - "̄": [t: "макрон"] # 0x304 - "̅": [t: "надчеркивание"] # 0x305 - - "̆": [t: "бреве"] # 0x306 + - "̆": [t: "брэвэ"] # 0x306 - "̇": [t: "точка сверху"] # 0x307 - - "̈": [t: "диерезис"] # 0x308 + - "̈": [t: "две точки"] # 0x308 - "̉": [t: "крюк сверху"] # 0x309 - "̊": [t: "кольцо сверху"] # 0x30a - "̋": [t: "двойной акут"] # 0x30b @@ -424,8 +424,8 @@ - "⃘": [t: "кольцо поверх"] # 0x20d8 - "⃙": [t: "кольцо по часовой стрелке поверх"] # 0x20d9 - "⃚": [t: "кольцо против часовой стрелки поверх"] # 0x20da - - "⃛": [t: "тройная точка"] # 0x20db - - "⃜": [t: "четверная точка"] # 0x20dc + - "⃛": [t: "три точки"] # 0x20db + - "⃜": [t: "четыре точки"] # 0x20dc - "⃝": [t: "обводящий круг"] # 0x20dd - "⃞": [t: "обводящий квадрат"] # 0x20de - "⃟": [t: "обводящий ромб"] # 0x20df @@ -454,11 +454,11 @@ - "℉": [t: "градусы Фаренгейта"] # 0x2109 - "ℊ": [t: "рукописная g"] # 0x210a - "ℌℑℨℭ": # 0x210c, 0x2111, 0x2128, 0x212d - - t: "фрактура" + - t: "фрактурная" - spell: "translate('.', 'ℌℑℨℭ', 'HIZC')" - "ℍℙℾℿ": # 0x210d, 0x2119, 0x213e, 0x213f - - t: "двойной контур" + - t: "двойная" - spell: "translate('.', 'ℍℙℾℿ', 'HPΓΠ')" - "ℎ": [t: "постоянная Планка"] # 0x210e @@ -480,16 +480,23 @@ - "ℯ": [t: "рукописная e"] # 0x212f # coalesced some chars that use cap letters - - "Ⅎ℺⅁⅂⅃⅄": # 0x2132, 0x213a, 0x2141, 0x2142, 0x2143, 0x2144 + - "Ⅎ": + - t: "перевернутая" + - spell: "'F'" + - "⅄": + - t: "перевернутая" + - spell: "'Y'" + - t: "без засечек" + - "℺⅁⅂⅃": # 0x213a, 0x2141, 0x2142, 0x2143 - test: - if: "'.' = '℺'" then: [t: "повёрнутая"] - else_if: "'.' = 'Ⅎ'" - then: [t: "перевёрнутая"] + then: [t: "перевернутая"] - else_if: "'.' = '⅃'" then: [t: "обратная без засечек"] - else: [t: "перевёрнутая без засечек"] - - spell: "translate('.', 'Ⅎ℺⅁⅂⅃⅄', 'FQGLLY')" + else: [t: "перевернутая без засечек"] + - spell: "translate('.', '℺⅁⅂⅃', 'QGLL')" - "ℴ": [t: "рукописная o"] # 0x2134 - "ℵ": [t: "алеф"] # 0x2135 @@ -560,7 +567,7 @@ - "↗": # 0x2197 - test: if: "ancestor::*[2][self::m:limit]" - then: [t: "стремится снизу"] + then: [t: "стремящемся к"] else: [t: "стрелка на северо-восток"] - "↘": # 0x2198 @@ -1410,9 +1417,11 @@ - spell: "ac" - t: "ток" - "⏧": [t: "электрическое пересечение"] # 0x23e7 - - "①-⑨": # 0x2460 - 0x2469 - - t: "в круге" - - spell: "translate('.', '①②③④⑤⑥⑦⑧⑨', '123456789')" + - "①": [t: "один в кружке"] + - "⑨": [t: "девять в кружке"] + - "②③④⑤⑥⑦⑧": # 0x2461 - 0x2468 + - t: "в кружке" + - spell: "translate('.', '②③④⑤⑥⑦⑧', '2345678')" - "⑩": [t: "десять в круге"] # 0x2469 - "⑪": [t: "одиннадцать в круге"] # 0x246a - "⑫": [t: "двенадцать в круге"] # 0x246b @@ -1423,9 +1432,11 @@ - "⑰": [t: "семнадцать в круге"] # 0x2470 - "⑱": [t: "восемнадцать в круге"] # 0x2471 - "⑳": [t: "двадцать в круге"] # 0x2473 - - "⑴-⑼": # 0x2474 - 0x247d + - "⑴": [t: "один в скобках"] + - "⑼": [t: "девять в скобках"] + - "⑵⑶⑷⑸⑹⑺⑻": # 0x2475 - 0x247c - t: "в скобках" - - spell: "translate('.', '⑴⑵⑶⑷⑸⑹⑺⑻⑼', '123456789')" + - spell: "translate('.', '⑵⑶⑷⑸⑹⑺⑻', '2345678')" - "⑽": [t: "десять в скобках"] # 0x247d - "⑾": [t: "одиннадцать в скобках"] # 0x247e - "⑿": [t: "двенадцать в скобках"] # 0x247f @@ -1437,8 +1448,10 @@ - "⒅": [t: "восемнадцать в скобках"] # 0x2485 - "⒆": [t: "девятнадцать в скобках"] # 0x2486 - "⒇": [t: "двадцать в скобках"] # 0x2487 - - "⒈-⒐": # 0x2488 - 0x2491 - - spell: "translate('.', '⒈⒉⒊⒋⒌⒍⒎⒏⒐', '123456789')" + - "⒈": [t: "один с точкой"] + - "⒐": [t: "девять с точкой"] + - "⒉⒊⒋⒌⒍⒎⒏": # 0x2489 - 0x2490 + - spell: "translate('.', '⒉⒊⒋⒌⒍⒎⒏', '2345678')" - t: "с точкой" - "⒑": [t: "десять с точкой"] # 0x2491 - "⒒": [t: "одиннадцать с точкой"] # 0x2492 @@ -1452,20 +1465,20 @@ - "⒚": [t: "девятнадцать с точкой"] # 0x249a - "⒛": [t: "двадцать с точкой"] # 0x249b - "⒜-⒵": # 0x249c - 0x24b5 - - t: "в скобках" - spell: "translate('.', '⒜⒝⒞⒟⒠⒡⒢⒣⒤⒥⒦⒧⒨⒩⒪⒫⒬⒭⒮⒯⒰⒱⒲⒳⒴⒵', 'abcdefghijklmnopqrstuvwxyz')" + - t: "в скобках" - "Ⓐ-ⓩ": # 0x24b6 - 0x24cf - - t: "в круге" - spell: "translate('.', 'ⒶⒷⒸⒹⒺⒻⒼⒽⒾⒿⓀⓁⓂⓃⓄⓅⓆⓇⓈⓉⓊⓋⓌⓍⓎⓏ', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')" + - t: "в кружке" - "🅐-🅩": # 0x1f150 - 0x1f169 - t: "в чёрном круге" - spell: "translate('.', '🅐🅑🅒🅓🅔🅕🅖🅗🅘🅙🅚🅛🅜🅝🅞🅟🅠🅡🅢🅣🅤🅥🅦🅧🅨🅩', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')" - "ⓐ-ⓩ": # 0x24d0 - 0x24e9 - - t: "в круге" - spell: "translate('.', 'ⓐⓑⓒⓓⓔⓕⓖⓗⓘⓙⓚⓛⓜⓝⓞⓟⓠⓡⓢⓣⓤⓥⓦⓧⓨⓩ', 'abcdefghijklmnopqrstuvwxyz')" + - t: "в кружке" - "⓪": [t: "ноль в круге"] # 0x24ea - "⓫": [t: "одиннадцать в чёрном круге"] # 0x24eb - "⓬": [t: "двенадцать в чёрном круге"] # 0x24ec @@ -1477,9 +1490,11 @@ - "⓲": [t: "восемнадцать в чёрном круге"] # 0x24f2 - "⓳": [t: "девятнадцать в чёрном круге"] # 0x24f3 - "⓴": [t: "двадцать в чёрном круге"] # 0x24f4 - - "⓵-⓽": # 0x24f5 - 0x24fe - - t: "в двойном круге" - - spell: "translate('.', '⓵⓶⓷⓸⓹⓺⓻⓼⓽', '123456789')" + - "⓵": [t: "один в двойном кружке"] + - "⓽": [t: "девять в двойном кружке"] + - "⓶⓷⓸⓹⓺⓻⓼": # 0x24f6 - 0x24fd + - t: "в двойном кружке" + - spell: "translate('.', '⓶⓷⓸⓹⓺⓻⓼', '2345678')" - "⓾": [t: "десять в двойном круге"] # 0x24fe - "⓿": [t: "ноль в чёрном круге"] # 0x24ff - "■": [t: "чёрный квадрат"] # 0x25a0 @@ -3121,42 +3136,42 @@ # fraktur chars in math alphabetic block and also MathType private use area # Some of these are reserved because they were used in Plane 0 -- that shouldn't be an issue other than causing the other chars to not display - "𝔄-𝔜": # 0x1d504 - 0x1d51d ('z' version is reserved) - - t: "фрактура" + - t: "фрактурная" - spell: "translate('.', '𝔄𝔅𝔆𝔇𝔈𝔉𝔊𝔋𝔌𝔍𝔎𝔏𝔐𝔑𝔒𝔓𝔔𝔕𝔖𝔗𝔘𝔙𝔚𝔛𝔜', 'ABCDEFGHIJKLMNOPQRSTUVWXY')" - "-": # 0xf000 - 0xf018 - - t: "фрактура" + - t: "фрактурная" - spell: "translate('.', '', 'ABCDEFGHIJKLMNOPQRSTUVWXY')" - "𝔞-𝔷": # 0x1d51e - 0x1d537 - - t: "фрактура" + - t: "фрактурная" - spell: "translate('.', '𝔞𝔟𝔠𝔡𝔢𝔣𝔤𝔥𝔦𝔧𝔨𝔩𝔪𝔫𝔬𝔭𝔮𝔯𝔰𝔱𝔲𝔳𝔴𝔵𝔶𝔷', 'abcdefghijklmnopqrstuvwxyz')" - "-": # 0xf01a - 0xf033 - - t: "фрактура" + - t: "фрактурная" - spell: "translate('.', '', 'abcdefghijklmnopqrstuvwxyz')" - "𝕬-𝖅": # 0x1D56C - 0x1D585 - - t: "фрактура" + - t: "фрактурная" - test: if: "not($IgnoreBold)" then: [t: "жирная"] - spell: "translate('.', '𝕬𝕭𝕮𝕯𝕰𝕱𝕲𝕳𝕴𝕵𝕶𝕷𝕸𝕹𝕺𝕻𝕼𝕽𝕾𝕿𝖀𝖁𝖂𝖃𝖄𝖅', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')" - "-": # 0xf040 - 0xf059 - - t: "фрактура" + - t: "фрактурная" - test: if: "not($IgnoreBold)" then: [t: "жирная"] - spell: "translate('.', '', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')" - "𝖆-𝖟": # 0x1d586 - 0x1d59f - - t: "фрактура" + - t: "фрактурная" - test: if: "not($IgnoreBold)" then: [t: "жирная"] - spell: "translate('.', '𝖆𝖇𝖈𝖉𝖊𝖋𝖌𝖍𝖎𝖏𝖐𝖑𝖒𝖓𝖔𝖕𝖖𝖗𝖘𝖙𝖚𝖛𝖜𝖝𝖞𝖟', 'abcdefghijklmnopqrstuvwxyz')" - "-": # 0xf05a - 0xf073 - - t: "фрактура" + - t: "фрактурная" - test: if: "not($IgnoreBold)" then: [t: "жирная"] @@ -3165,25 +3180,29 @@ # double struck (blackboard bold) chars in math alphabetic block and also MathType private use area # Some of these are reserved because they were used in Plane 0 -- that shouldn't be an issue other than causing the other chars to not display - "𝔸-𝕐": # 0x1d504 - 0x1d51d ('z' version is reserved) - - t: "двойной контур" + - t: "двойная" - spell: "translate('.', '𝔸𝔹𝔺𝔻𝔼𝔽𝔾𝔿𝕀𝕁𝕂𝕃𝕄𝕅𝕆𝕇𝕈𝕉𝕊𝕋𝕌𝕍𝕎𝕏𝕐', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')" - "-": # 0xf080 - 0xf098 - - t: "двойной контур" + - t: "двойная" - spell: "translate('.', '', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')" - "𝕒-𝕫": # 0x1d552 - 0x1d56b - - t: "двойной контур" + - t: "двойная" - spell: "translate('.', '𝕒𝕓𝕔𝕕𝕖𝕗𝕘𝕙𝕚𝕛𝕜𝕝𝕞𝕟𝕠𝕡𝕢𝕣𝕤𝕥𝕦𝕧𝕨𝕩𝕪𝕫', 'abcdefghijklmnopqrstuvwxyz')" - "-": # 0xf09a - 0xf0b3 - - t: "двойной контур" + - t: "двойная" - spell: "translate('.', '', 'abcdefghijklmnopqrstuvwxyz')" - - "𝟘-𝟡": # 0x1d7d8 - 0x1d7e1 - - t: "двойной контур" - - spell: "translate('.', '𝟘𝟙𝟚𝟛𝟜𝟝𝟞𝟟𝟠𝟡', '0123456789')" - - "-": # 0xf0c0 - 0xf0c9 - - t: "двойной контур" - - spell: "translate('.', '', '0123456789')" + - "𝟘": [t: "двойной ноль"] + - "𝟡": [t: "двойная девять"] + - "𝟙𝟚𝟛𝟜𝟝𝟞𝟟𝟠": # 0x1d7d9 - 0x1d7e0 + - t: "двойная" + - spell: "translate('.', '𝟙𝟚𝟛𝟜𝟝𝟞𝟟𝟠', '12345678')" + - "": [t: "двойной ноль"] + - "": [t: "двойная девять"] + - "": # 0xf0c1 - 0xf0c8 + - t: "двойная" + - spell: "translate('.', '', '12345678')" - "": [t: "набла с двойным контуром"] # 0xf0ca - "": [t: "эйлерова константа с двойным контуром"] # 0xf0cb @@ -3292,11 +3311,11 @@ # MathType only has a few of the cap Greek letters in PUA - "": # 0xf201 - 0xf209 - - t: "двойной контур" + - t: "двойная" - spell: "translate('.', '', 'ΔΨΛΠΣΘΓΩΥ')" - "-": # 0xf220 - 0xf236 - - t: "двойной контур" + - t: "двойная" - spell: "translate('.', '', 'ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ΢ΣΤΥΦΧΨΩ')" - "": [t: "конечная сигма с двойным контуром"] # 0xf237 @@ -3487,17 +3506,19 @@ - "": [t: "жирная набла"] # 0xf421 - "𝛁": [t: "жирная набла"] # 0x1d6c1 - - "𝛛𝛜𝛝𝛞𝛟𝛠𝛡": # 0x1D6DB - 0x1D6E1 + - "𝛡𝝕𝞏𝟉": [t: "жирное пи"] + + - "𝛛𝛜𝛝𝛞𝛟𝛠": # 0x1D6DB - 0x1D6E0 - test: if: "not($IgnoreBold)" then: [t: "жирная"] - - spell: "translate('.', '𝛛𝛜𝛝𝛞𝛟𝛠𝛡', '∂εθκφρπ')" + - spell: "translate('.', '𝛛𝛜𝛝𝛞𝛟𝛠', '∂εθκφρ')" - - "": # 0xF43C - 0xF441 + - "": # 0xF43C - 0xF440 - test: if: "not($IgnoreBold)" then: [t: "жирная"] - - spell: "translate('.', '', '∂εθκφρπ')" + - spell: "translate('.', '', '∂εθκφρ')" - "𝛢-𝛺": # 0x1d6e2 - 0x1d6fa # - t: "italic" @@ -3554,19 +3575,19 @@ then: [t: "жирная"] - spell: "translate('.', '', 'αβγδεζηθικλμνξοπρςστυφχψω')" - - "𝝏𝝐𝝑𝝒𝝓𝝔𝝕": # 0x1d74f - 0x1d755 + - "𝝏𝝐𝝑𝝒𝝓𝝔": # 0x1d74f - 0x1d754 # - t: "bold italic" - test: if: "not($IgnoreBold)" then: [t: "жирная"] - - spell: "translate('.', '𝝏𝝐𝝑𝝒𝝓𝝔𝝕', '∂εθκφρπ')" + - spell: "translate('.', '𝝏𝝐𝝑𝝒𝝓𝝔', '∂εθκφρ')" - - "": # 0xf422 - 0xf43a + - "": # 0xf422 - 0xf439 # - t: "bold italic" - test: if: "not($IgnoreBold)" then: [t: "жирная"] - - spell: "translate('.', '', '∂εθκφρπ')" + - spell: "translate('.', '', '∂εθκφρ')" - "𝜵": [t: "жирная курсивная набла"] # 0x1d735 - "": [t: "жирная курсивная набла"] # 0xf495 @@ -3594,17 +3615,17 @@ then: [t: "жирная"] - spell: "translate('.', '', 'αβγδεζηθικλμνξοπρςστυφχψω')" - - "𝞉𝞊𝞋𝞌𝞍𝞎𝞏": # 0x1d789 - 0x1d78f + - "𝞉𝞊𝞋𝞌𝞍𝞎": # 0x1d789 - 0x1d78e - test: if: "not($IgnoreBold)" then: [t: "жирная"] - - spell: "translate('.', '𝞉𝞊𝞋𝞌𝞍𝞎𝞏', '∂εθκφρπ')" + - spell: "translate('.', '𝞉𝞊𝞋𝞌𝞍𝞎', '∂εθκφρ')" - - "": # 0xf4e9 - 0xf4ef + - "": # 0xf4e9 - 0xf4ee - test: if: "not($IgnoreBold)" then: [t: "жирная"] - - spell: "translate('.', '', '∂εθκφρπ')" + - spell: "translate('.', '', '∂εθκφρ')" - "": [t: "жирная набла"] # 0xf4cf - "𝝯": [t: "жирная набла"] # 0x1d76f @@ -3637,19 +3658,19 @@ then: [t: "жирная"] - spell: "translate('.', '', 'αβγδεζηθικλμνξοπρςστυφχψω')" - - "𝟃𝟄𝟅𝟆𝟇𝟈𝟉": # 0x1d7c3 - 0x1d7c9 + - "𝟃𝟄𝟅𝟆𝟇𝟈": # 0x1d7c3 - 0x1d7c8 # - t: "bold italic" - test: if: "not($IgnoreBold)" then: [t: "жирная"] - - spell: "translate('.', '𝟃𝟄𝟅𝟆𝟇𝟈𝟉', '∂εθκφρπ')" + - spell: "translate('.', '𝟃𝟄𝟅𝟆𝟇𝟈', '∂εθκφρ')" - - "": # 0xf523 - 0xf529 + - "": # 0xf523 - 0xf528 # - t: "bold italic" - test: if: "not($IgnoreBold)" then: [t: "жирная"] - - spell: "translate('.', '', '∂εθκφρπ')" + - spell: "translate('.', '', '∂εθκφρ')" - "": [t: "жирная набла"] # 0xf509 - "𝞩": [t: "жирная набла"] # 0x1d7a9 diff --git a/Rules/Languages/ru/unicode.yaml b/Rules/Languages/ru/unicode.yaml index 9325e103..e912e2c3 100644 --- a/Rules/Languages/ru/unicode.yaml +++ b/Rules/Languages/ru/unicode.yaml @@ -2,11 +2,32 @@ # Note to translators: # most languages don't have two ways to pronounce 'a' -- if not need, remove the rules and change "B-Z" to "A-Z" # some languages say the word for "uppercase" after the letter. Make sure to change that where appropriate by moving some code around - - "a-z": - - test: - if: "$TTS='none'" - then: [t: "."] # (en: '.', google translation) - else: [spell: "'.'"] + - "a": [t: "а"] + - "b": [t: "бэ"] + - "c": [t: "цэ"] + - "d": [t: "дэ"] + - "e": [t: "е"] + - "f": [t: "эф"] + - "g": [t: "джи"] + - "h": [t: "аш"] + - "i": [t: "и"] + - "j": [t: "джей"] + - "k": [t: "ка"] + - "l": [t: "эль"] + - "m": [t: "эм"] + - "n": [t: "эн"] + - "o": [t: "о"] + - "p": [t: "пэ"] + - "q": [t: "ку"] + - "r": [t: "эр"] + - "s": [t: "эс"] + - "t": [t: "тэ"] + - "u": [t: "у"] + - "v": [t: "вэ"] + - "w": [t: "дабл-ю"] + - "x": [t: "икс"] + - "y": [t: "игрек"] + - "z": [t: "зет"] # Capital letters are a little tricky: users can pick their favorite word (something that was requested) and # screen readers have options to use pitch changes or beeps instead of or in addition to say "cap" @@ -26,12 +47,12 @@ if: "$SpeechOverrides_CapitalLetters = ''" then_test: if: "$Impairment = 'Blindness'" - then: [t: "большая"] # (en: 'cap', google translation) + then: [t: "заглавная"] # (en: 'cap') else: [x: "$SpeechOverrides_CapitalLetters"] - pitch: value: "$CapitalLetters_Pitch" # note: processing of ranges converts '.' into the character, so it needs to be in quotes below - replace: [spell: "translate('.', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')"] + replace: [x: "translate('.', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')"] - "0-9": [t: "."] # (en: '.', google translation) @@ -54,27 +75,42 @@ - "'": [t: "штрих"] # 0x27 (en: 'apostrophe') - "(": # 0x28 - test: - if: $SpeechStyle = 'ClearSpeak' or $SpeechStyle = 'SimpleSpeak' - then_test: - if: "$Verbosity='Terse'" - then: [t: "скобка открывается"] # 0x28 (en: 'open', google translation) - else: [t: "открывающая круглая скобка"] # 0x28 (en: 'open paren', google translation) - else: [t: "левая круглая скобка"] # 0x28 (en: 'left paren', google translation) + - if: "$SpeechStyle='LiteralSpeak' or ancestor-or-self::*[contains(@data-intent-property, ':literal:')] or @data-changed='added' or ancestor::*[@data-changed='added'] or preceding-sibling::*[1][.='P'] or following-sibling::*[.='|' or .='∩' or contains(., 'and')]" + then: [t: "открывающая круглая скобка"] + else_test: + if: $SpeechStyle = 'ClearSpeak' or $SpeechStyle = 'SimpleSpeak' + then_test: + if: "$Verbosity='Terse'" + then: [t: "скобка открывается"] # 0x28 (en: 'open', google translation) + else: [t: "открывающая круглая скобка"] # 0x28 (en: 'open paren', google translation) + else: [t: "левая круглая скобка"] # 0x28 (en: 'left paren', google translation) - ")": # 0x29 - test: - if: $SpeechStyle = 'ClearSpeak' or $SpeechStyle = 'SimpleSpeak' - then_test: - if: "$Verbosity='Terse'" - then: [t: "скобка закрывается"] # 0x29 (en: 'close', google translation) - else: [t: "закрывающая круглая скобка"] # 0x29 (en: 'close paren', google translation) - else: [t: "правая круглая скобка"] # 0x29 (en: 'right paren', google translation) + - if: "$SpeechStyle='LiteralSpeak' or ancestor-or-self::*[contains(@data-intent-property, ':literal:')] or @data-changed='added' or ancestor::*[@data-changed='added'] or preceding-sibling::*[.='P' or .='|' or .='∩' or contains(., 'and')]" + then: [t: "закрывающая круглая скобка"] + else_test: + if: $SpeechStyle = 'ClearSpeak' or $SpeechStyle = 'SimpleSpeak' + then_test: + if: "$Verbosity='Terse'" + then: [t: "скобка закрывается"] # 0x29 (en: 'close', google translation) + else: [t: "закрывающая круглая скобка"] # 0x29 (en: 'close paren', google translation) + else: [t: "правая круглая скобка"] # 0x29 (en: 'right paren', google translation) - "*": # 0x2a test: if: "parent::*[name(.)='msup' or name(.)='msubsup' or name(.)='skip-super']" then: [t: "звёздочка"] # 0x2a (en: 'star', google translation) else: [t: "умножить"] # 0x2a (en: 'times', google translation) - - "+": [t: "плюс"] # 0x2b (en: 'plus') + - "+": # 0x2b + - test: + if: "preceding-sibling::*[1][name(.)='mover' or name(.)='modified-variable'] and + following-sibling::*[1][name(.)='mover' or name(.)='modified-variable'] and + not(following-sibling::*[1][name(.)='mover' and *[2][.='→']])" + then: [pause: medium] + - t: "плюс" # (en: 'plus') + - test: + if: "$ClearSpeak_Functions='None' and following-sibling::*[1][self::m:mi] and not(ancestor::*[IsBracketed(., '(', ')')])" + then: [pause: short] - ",": # 0x2c # the following deals with the interaction of "," with "…" which sometimes wants the ',' to be silent # that this test is here and not with "…" is not ideal, but seems simplest @@ -87,10 +123,14 @@ # except if expression starts with '…' - "../*[1][.='…'] " then: - - T: "запятая" # (en: 'comma', google translation) - test: - if: "$Verbosity != Terse" + - if: "preceding-sibling::*[1][self::m:mi] and following-sibling::*[1][self::m:mi]" then: [pause: short] + else: + - T: "запятая" # (en: 'comma', google translation) + - test: + if: "$Verbosity != Terse" + then: [pause: short] # else silent - "-": [t: "минус"] # 0x2d (en: 'minus') @@ -112,6 +152,12 @@ if: "$Verbosity!='Terse'" then: [t: "равно"] # (en: 'is equal to', google translation) else: [t: "равно"] # (en: 'equals') + - test: + - if: "(following-sibling::*[1][.='c'] and following-sibling::*[2][.='\u2062']) or + (following-sibling::*[1][.='P'] and following-sibling::*[2][IsBracketed(., '(', ')')] and following-sibling::*[3][.='='])" + then: [pause: medium] + - else_if: "following-sibling::*[1][.='P'] and following-sibling::*[2][IsBracketed(., '(', ')')]" + then: [pause: short] - ">": # 0x3e - test: @@ -134,7 +180,7 @@ - "^": # 0x5e - test: if: "parent::m:modified-variable or parent::m:mover" - then: [t: "крышка"] # (en: 'hat', google translation) + then: [t: "циркумфлекс"] # (en: 'hat', google translation) else: [t: "крышка"] # (en: 'caret', google translation) - "_": [t: "подчёркивание"] # 0x5f (en: 'under bar', google translation) - "`": [t: "гравис"] # 0x60 (en: 'grave', google translation) @@ -160,7 +206,7 @@ then: [t: "такой, что"] # (en: 'such that', google translation) - else_if: "$ClearSpeak_VerticalLine = 'Given' or $DefaultToGiven" then: [t: "при условии"] # (en: 'given', google translation) - - else: [t: "вертикальная черта"] # (en: 'divides') + - else: [t: "делит"] # (en: 'divides') - "}": # 0x7d - test: @@ -188,11 +234,11 @@ - "×": # 0xd7 - test: if: "$SpeechStyle != 'ClearSpeak' or $ClearSpeak_MultSymbolX = 'Auto'" - then: [t: "умножить"] # (en: 'times', google translation) + then: [t: "умножить на"] # (en: 'times', google translation) else_test: if: $ClearSpeak_MultSymbolX = 'By' - then: [t: "к"] # (en: 'by', google translation) - else: [t: "умножить"] # (en: 'cross') + then: [t: "на"] # (en: 'by') + else: [t: "векторное произведение"] # (en: 'cross') - "÷": [t: "разделить на"] # 0xf7 (en: 'divided by') - "̀": [t: "знак грависа"] # 0x300 (en: 'grave accent embellishment', google translation) - "́": [t: "акут"] # 0x301 (en: 'acute accent embellishment', google translation) @@ -200,7 +246,7 @@ - "̃": [t: "тильда"] # 0x303 (en: 'tilde embellishment', google translation) - "̄": [t: "макрон"] # 0x304 (en: 'macron embellishment', google translation) - "̅": [t: "надчёркивание"] # 0x305 (en: 'overbar embellishment', google translation) - - "̆": [t: "бреве"] # 0x306 (en: 'breve', google translation) + - "̆": [t: "брэвэ"] # 0x306 (en: 'breve', google translation) - "̇": [t: "точка сверху"] # 0x307 (en: 'dot above embellishment', google translation) # Note: ClearSpeak has pref TriangleSymbol for "Δ", but that is wrong @@ -217,12 +263,12 @@ if: "$SpeechOverrides_CapitalLetters = ''" then_test: if: "$Impairment = 'Blindness'" - then: [t: "большая"] # (en: 'cap', google translation) + then: [t: "заглавная"] # (en: 'cap') else: [x: "$SpeechOverrides_CapitalLetters"] - pitch: value: "$CapitalLetters_Pitch" # note: processing of ranges converts '.' into the character, so it needs to be in quotes below - replace: [spell: "translate('.', 'ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ΢ΣΤΥΦΧΨΩ', 'αβγδεζηθικλμνξοπρςστυφχψω')"] + replace: [x: "translate('.', 'ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ΢ΣΤΥΦΧΨΩ', 'αβγδεζηθικλμνξοπρςστυφχψω')"] - "α": [t: "альфа"] # 0x3b1 (en: 'alpha') - "β": [t: "бета"] # 0x3b2 (en: 'beta') @@ -265,7 +311,7 @@ # must be ClearSpeak and $ClearSpeak_Ellipses = 'AndSoOn' # speak '…' as 'and so on...' unless expr starts with '…' - "../*[1][.='…']" - then: [t: "точка точка точка"] # (en: 'dot dot dot', google translation) + then: [t: "многоточие"] # (en: 'dot dot dot') else_test: # must have $ClearSpeak_Ellipses = 'AndSoOn' if: "count(following-sibling::*) = 0" then: [t: "и так далее"] # (en: 'and so on', google translation) @@ -273,11 +319,14 @@ - "⁡": # 0x2061 - test: - # skip saying "of" when Terse and a trig function, when it is a shape (does this happen?), or we are in :literal mode - if: "not($Verbosity='Terse' and preceding-sibling::*[1][IsInDefinition(., 'TrigFunctionNames')]) and not(preceding-sibling::*[1][IsInDefinition(., 'GeometryShapes')]) and + # skip saying "of" after trig functions, geometry shapes, or in :literal mode + if: "not(preceding-sibling::*[1][IsInDefinition(., 'TrigFunctionNames') or self::m:inverse-function or (self::m:power and IsInDefinition(*[1], 'TrigFunctionNames'))]) and not(preceding-sibling::*[1][IsInDefinition(., 'GeometryShapes')]) and not(@data-changed='added' and ancestor-or-self::*[contains(@data-intent-property, ':literal:')])" then: [t: "от"] # (en: 'of', google translation) - - "⁢": [t: ""] # 0x2062 + - "⁢": # 0x2062 + - test: + if: "@data-function-guess and following-sibling::*[1][self::m:mrow and IsBracketed(., '(', ')')] and $ClearSpeak_Functions!='None'" + then: [pause: short] - "⁣": [t: ""] # 0x2063 - "⁤": [t: "и"] # 0x2064 (en: 'and', google translation) - "′": [t: "штрих"] # 0x2032 (en: 'prime') @@ -309,9 +358,12 @@ - "↑": [t: "стрелка вверх"] # 0x2191 (en: 'upwards arrow', google translation) - "→": # 0x2192 - test: - if: "ancestor::*[2][self::m:limit]" - then: [t: "стремится к"] # (en: 'approaches', google translation) - else: [t: "стрелка вправо"] # (en: 'right arrow', google translation) + if: "(parent::m:mover or parent::m:modified-variable) and ($SpeechStyle='LiteralSpeak' or ancestor-or-self::*[contains(@data-intent-property, ':literal:')])" + then: [t: "со стрелкой"] + else_test: + if: "ancestor::*[2][self::m:limit]" + then: [t: "стремящемся к"] # (en: 'approaches', google translation) + else: [t: "стрелка вправо"] # (en: 'right arrow', google translation) - "↓": [t: "стрелка вниз"] # 0x2193 (en: 'downwards arrow', google translation) - "⇒": [t: "двойная стрелка вправо"] # 0x21d2 (en: 'rightwards double arrow', google translation) @@ -320,7 +372,7 @@ - test: if: "$Verbosity='Terse'" then: [t: "частная производная"] # (en: 'partial', google translation) - else: [t: "частный дифференциал"] # (en: 'partial derivative') + else: [t: "частная производная"] # (en: 'partial derivative') - "∃": [t: "существует"] # 0x2203 (en: 'there exists') - "∄": [t: "не существует"] # 0x2204 (en: 'there does not exist') - "∅": [t: "пустое множество"] # 0x2205 (en: 'empty set') @@ -411,9 +463,9 @@ - else_if: $ClearSpeak_SetMemberSymbol = 'In' then: [t: "находится в"] # (en: 'is in', google translation) - else: [t: "малое принадлежит"] # $ClearSpeak_SetMemberSymbol = 'Belongs' (en: 'belongs to') - - "∏": [t: "эн-арное произведение"] # 0x220f (en: 'product') + - "∏": [t: "произведение"] # 0x220f (en: 'product') - "∐": [t: "эн-арный сомножитель"] # 0x2210 (en: 'co-product') - - "∑": [t: "эн-арная сумма"] # 0x2211 (en: 'sum') + - "∑": [t: "сумма"] # 0x2211 (en: 'sum') - "−": [t: "минус"] # 0x2212 (en: 'minus') - "∓": [t: "минус плюс"] # 0x2213 (en: 'minus or plus') - "∗": [t: "звёздочка"] # 0x2217 (en: 'times') diff --git a/tests/Languages/ru/ClearSpeak/functions.rs b/tests/Languages/ru/ClearSpeak/functions.rs index 98442eed..941e694d 100644 --- a/tests/Languages/ru/ClearSpeak/functions.rs +++ b/tests/Languages/ru/ClearSpeak/functions.rs @@ -17,7 +17,7 @@ fn trig_names() -> Result<()> { cscϕ+ cotφ "; - test("ru", "ClearSpeak", expr, "синус икс плюс косинус игрек плюс тангенс зет плюс секанс альфа, плюс косеканс фи, плюс котангенс фи")?; + test("ru", "ClearSpeak", expr, "синус икс плюс косинус игрек плюс тангенс зэт плюс секанс альфа, плюс косеканс фи, плюс котангенс фи")?; return Ok(()); } @@ -31,7 +31,7 @@ fn hyperbolic_trig_names() -> Result<()> { cschϕ+ cothφ "; - test("ru", "ClearSpeak", expr, "гиперболический синус икс, плюс гиперболический косинус игрек, плюс гиперболический тангенс зет, плюс гиперболический секанс альфа, плюс гиперболический косеканс фи, плюс гиперболический котангенс фи")?; + test("ru", "ClearSpeak", expr, "гиперболический синус икс, плюс гиперболический косинус игрек, плюс гиперболический тангенс зэт, плюс гиперболический секанс альфа, плюс гиперболический косеканс фи, плюс гиперболический котангенс фи")?; return Ok(()); } @@ -75,14 +75,14 @@ fn trig_cubed() -> Result<()> { #[test] fn trig_fourth() -> Result<()> { let expr = "sec4x"; - test("ru", "ClearSpeak", expr, "секанс в четвертой степени икс")?; + test("ru", "ClearSpeak", expr, "секанс в четвёртой степени икс")?; return Ok(()); } #[test] fn trig_power_other() -> Result<()> { let expr = "sinh>n-1x"; - test("ru", "ClearSpeak", expr, "гиперболический синус икс в степени n минус 1")?; + test("ru", "ClearSpeak", expr, "гиперболический синус икс в степени эн минус 1")?; return Ok(()); } @@ -232,7 +232,7 @@ fn times_sqrt() -> Result<()> { = ab "; - test("ru", "ClearSpeak", expr, "квадратный корень из а; умножить на квадратный корень из бэ; равно, квадратный корень из а бэ")?; + test("ru", "ClearSpeak", expr, "квадратный корень из а; умножить на квадратный корень из бэ; равно, квадратный корень из а умножить на бэ")?; return Ok(()); } @@ -250,7 +250,7 @@ fn more_implied_times() -> Result<()> { "; test_ClearSpeak("ru", "ClearSpeak_ImpliedTimes", "MoreImpliedTimes", expr, - "скобка 2 умножить на икс закрывается в квадрате")?; + "скобка открывается 2 умножить на икс скобка закрывается в квадрате")?; return Ok(()); } diff --git a/tests/Languages/ru/ClearSpeak/large_ops.rs b/tests/Languages/ru/ClearSpeak/large_ops.rs index 41353b83..252258aa 100644 --- a/tests/Languages/ru/ClearSpeak/large_ops.rs +++ b/tests/Languages/ru/ClearSpeak/large_ops.rs @@ -12,7 +12,7 @@ fn sum_both() -> Result<()> { n "; - test("ru", "ClearSpeak", expr, "сумма от n равно 1 до 10 от n")?; + test("ru", "ClearSpeak", expr, "сумма от эн равно 1 до 10 от эн")?; return Ok(()); } @@ -25,7 +25,7 @@ fn sum_under() -> Result<()> { i "; - test("ru", "ClearSpeak", expr, "сумма по эс большое от i")?; + test("ru", "ClearSpeak", expr, "сумма по эс большое от и")?; return Ok(()); } @@ -39,7 +39,7 @@ fn sum_both_msubsup() -> Result<()> { n "; - test("ru", "ClearSpeak", expr, "сумма от n равно 1 до 10 от n")?; + test("ru", "ClearSpeak", expr, "сумма от эн равно 1 до 10 от эн")?; return Ok(()); } @@ -52,7 +52,7 @@ fn sum_sub() -> Result<()> { i "; - test("ru", "ClearSpeak", expr, "сумма по эс большое от i")?; + test("ru", "ClearSpeak", expr, "сумма по эс большое от и")?; return Ok(()); } @@ -62,7 +62,7 @@ fn sum() -> Result<()> { ai "; - test("ru", "ClearSpeak", expr, "сумма а с индексом i")?; + test("ru", "ClearSpeak", expr, "сумма а с индексом и")?; return Ok(()); } @@ -76,7 +76,7 @@ fn product_both() -> Result<()> { n "; - test("ru", "ClearSpeak", expr, "произведение от n равно 1 до 10 от n")?; + test("ru", "ClearSpeak", expr, "произведение от эн равно 1 до 10 от эн")?; return Ok(()); } @@ -89,7 +89,7 @@ fn product_under() -> Result<()> { i "; - test("ru", "ClearSpeak", expr, "произведение по эс большое от i")?; + test("ru", "ClearSpeak", expr, "произведение по эс большое от и")?; return Ok(()); } @@ -99,7 +99,7 @@ fn product() -> Result<()> { ai "; - test("ru", "ClearSpeak", expr, "произведение а с индексом i")?; + test("ru", "ClearSpeak", expr, "произведение а с индексом и")?; return Ok(()); } @@ -113,7 +113,7 @@ fn intersection_both() -> Result<()> { Si "; - test("ru", "ClearSpeak", expr, "пересечение от i равно 1 до 10 от; эс большое с индексом i")?; + test("ru", "ClearSpeak", expr, "пересечение от и равно 1 до 10 от; эс большое с индексом и")?; return Ok(()); } @@ -126,7 +126,7 @@ fn intersection_under() -> Result<()> { Si "; - test("ru", "ClearSpeak", expr, "пересечение по цэ большое от, эс большое с индексом i")?; + test("ru", "ClearSpeak", expr, "пересечение по цэ большое от, эс большое с индексом и")?; return Ok(()); } @@ -136,7 +136,7 @@ fn intersection() -> Result<()> { Si "; - test("ru", "ClearSpeak", expr, "пересечение эс большое с индексом i")?; + test("ru", "ClearSpeak", expr, "пересечение эс большое с индексом и")?; return Ok(()); } @@ -150,7 +150,7 @@ fn union_both() -> Result<()> { Si "; - test("ru", "ClearSpeak", expr, "объединение от i равно 1 до 10 от; эс большое с индексом i")?; + test("ru", "ClearSpeak", expr, "объединение от и равно 1 до 10 от; эс большое с индексом и")?; return Ok(()); } @@ -163,7 +163,7 @@ fn union_under() -> Result<()> { Si "; - test("ru", "ClearSpeak", expr, "объединение по цэ большое от, эс большое с индексом i")?; + test("ru", "ClearSpeak", expr, "объединение по цэ большое от, эс большое с индексом и")?; return Ok(()); } @@ -173,7 +173,7 @@ fn union() -> Result<()> { Si "; - test("ru", "ClearSpeak", expr, "объединение эс большое с индексом i")?; + test("ru", "ClearSpeak", expr, "объединение эс большое с индексом и")?; return Ok(()); } diff --git a/tests/Languages/ru/ClearSpeak/menclose.rs b/tests/Languages/ru/ClearSpeak/menclose.rs index 2041f52b..cdf7be7a 100644 --- a/tests/Languages/ru/ClearSpeak/menclose.rs +++ b/tests/Languages/ru/ClearSpeak/menclose.rs @@ -52,7 +52,7 @@ fn menclose_updiagonalstrike() -> Result<()> { let expr = " 32 "; - test("ru", "ClearSpeak", expr, "диагональ вверх, перечеркивание, содержащее три вторых конец")?; + test("ru", "ClearSpeak", expr, "диагональ вверх, перечёркивание, содержащее три вторых конец")?; return Ok(()); } @@ -61,7 +61,7 @@ fn menclose_downdiagonalstrike() -> Result<()> { let expr = " 32 "; - test("ru", "ClearSpeak", expr, "диагональ вниз, перечеркивание, содержащее три вторых конец")?; + test("ru", "ClearSpeak", expr, "диагональ вниз, перечёркивание, содержащее три вторых конец")?; return Ok(()); } @@ -70,7 +70,7 @@ fn menclose_cross_out() -> Result<()> { let expr = " 32 "; - test("ru", "ClearSpeak", expr, "икс, перечеркивание, содержащее три вторых конец")?; + test("ru", "ClearSpeak", expr, "икс, перечёркивание, содержащее три вторых конец")?; return Ok(()); } @@ -79,7 +79,7 @@ fn menclose_vertical_horizontal_strike() -> Result<()> { let expr = " 32 "; - test("ru", "ClearSpeak", expr, "вертикальная, горизонтальная, перечеркивание, содержащее три вторых конец")?; + test("ru", "ClearSpeak", expr, "вертикальная, горизонтальная, перечёркивание, содержащее три вторых конец")?; return Ok(()); } diff --git a/tests/Languages/ru/ClearSpeak/mfrac.rs b/tests/Languages/ru/ClearSpeak/mfrac.rs index 07640e1a..1ac065ba 100644 --- a/tests/Languages/ru/ClearSpeak/mfrac.rs +++ b/tests/Languages/ru/ClearSpeak/mfrac.rs @@ -276,9 +276,9 @@ fn non_simple_function_over_function() -> Result<()> { g(x) "; test_prefs("ru", "ClearSpeak", vec![("Verbosity", "Medium"), ("ClearSpeak_Fractions", "Auto")], expr, - "дробь, числитель: эф от, открывается скобка икс плюс 1, закрывается скобка; знаменатель: же от икс")?; + "дробь, числитель: эф от, скобка открывается икс плюс 1, скобка закрывается; знаменатель: же от икс")?; test_prefs("ru", "ClearSpeak", vec![("Verbosity", "Verbose"), ("ClearSpeak_Fractions", "Auto")], expr, - "дробь, числитель: эф от, открывается скобка икс плюс 1, закрывается скобка; знаменатель: же от икс; конец дроби")?; + "дробь, числитель: эф от, скобка открывается икс плюс 1, скобка закрывается; знаменатель: же от икс; конец дроби")?; return Ok(()); } diff --git a/tests/Languages/ru/ClearSpeak/msup.rs b/tests/Languages/ru/ClearSpeak/msup.rs index 6bff565e..ecac0aab 100644 --- a/tests/Languages/ru/ClearSpeak/msup.rs +++ b/tests/Languages/ru/ClearSpeak/msup.rs @@ -209,7 +209,7 @@ fn nested_number_times_squared() -> Result<()> { "; - test_prefs("ru", "ClearSpeak", vec![("Verbosity", "Medium"), ("ClearSpeak_Exponents", "Auto")], expr, "e в степени одна вторая икс в квадрате")?; + test_prefs("ru", "ClearSpeak", vec![("Verbosity", "Medium"), ("ClearSpeak_Exponents", "Auto")], expr, "е в степени одна вторая икс в квадрате")?; return Ok(()); } @@ -232,10 +232,10 @@ fn nested_negative_number_times_squared() -> Result<()> { "; - test_prefs("ru", "ClearSpeak", vec![("Verbosity", "Medium"), ("ClearSpeak_Exponents", "Auto")], expr, "e в степени минус одна вторая икс в квадрате")?; - test_prefs("ru", "ClearSpeak", vec![("Verbosity", "Medium"), ("ClearSpeak_Exponents", "Ordinal")], expr, "e в степени (показатель: минус одна вторая икс во второй, конец показателя)")?; - test_prefs("ru", "ClearSpeak", vec![("Verbosity", "Medium"), ("ClearSpeak_Exponents", "OrdinalPower")], expr, "e в степени (показатель: минус одна вторая икс во второй степени, конец показателя)")?; - test_prefs("ru", "ClearSpeak", vec![("Verbosity", "Medium"), ("ClearSpeak_Exponents", "AfterPower")], expr, "e в степени (показатель: минус одна вторая икс в степени 2, конец показателя)")?; + test_prefs("ru", "ClearSpeak", vec![("Verbosity", "Medium"), ("ClearSpeak_Exponents", "Auto")], expr, "е в степени минус одна вторая икс в квадрате")?; + test_prefs("ru", "ClearSpeak", vec![("Verbosity", "Medium"), ("ClearSpeak_Exponents", "Ordinal")], expr, "е в степени (показатель: минус одна вторая икс во второй, конец показателя)")?; + test_prefs("ru", "ClearSpeak", vec![("Verbosity", "Medium"), ("ClearSpeak_Exponents", "OrdinalPower")], expr, "е в степени (показатель: минус одна вторая икс во второй степени, конец показателя)")?; + test_prefs("ru", "ClearSpeak", vec![("Verbosity", "Medium"), ("ClearSpeak_Exponents", "AfterPower")], expr, "е в степени (показатель: минус одна вторая икс в степени 2, конец показателя)")?; return Ok(()); } @@ -332,13 +332,13 @@ fn nested_complex_power() -> Result<()> { "; test_prefs("ru", "ClearSpeak", vec![("Verbosity", "Medium"), ("ClearSpeak_Exponents", "Auto")], expr, - "e в степени (показатель: минус одна вторая умножить на; скобка открывается; дробь, числитель: икс минус мю; знаменатель: сигма; скобка закрывается в квадрате, конец показателя)")?; + "е в степени (показатель: минус одна вторая умножить на; скобка открывается; дробь, числитель: икс минус мю; знаменатель: сигма; скобка закрывается в квадрате, конец показателя)")?; test_prefs("ru", "ClearSpeak", vec![("Verbosity", "Medium"), ("ClearSpeak_Exponents", "Ordinal")], expr, - "e в степени (показатель: минус одна вторая умножить на; скобка открывается; дробь, числитель: икс минус мю; знаменатель: сигма; скобка закрывается во второй, конец показателя)")?; + "е в степени (показатель: минус одна вторая умножить на; скобка открывается; дробь, числитель: икс минус мю; знаменатель: сигма; скобка закрывается во второй, конец показателя)")?; test_prefs("ru", "ClearSpeak", vec![("Verbosity", "Medium"), ("ClearSpeak_Exponents", "OrdinalPower")], expr, - "e в степени (показатель: минус одна вторая умножить на; скобка открывается; дробь, числитель: икс минус мю; знаменатель: сигма; скобка закрывается во второй степени, конец показателя)")?; + "е в степени (показатель: минус одна вторая умножить на; скобка открывается; дробь, числитель: икс минус мю; знаменатель: сигма; скобка закрывается во второй степени, конец показателя)")?; test_prefs("ru", "ClearSpeak", vec![("Verbosity", "Medium"), ("ClearSpeak_Exponents", "AfterPower")], expr, - "e в степени (показатель: минус одна вторая умножить на; скобка открывается; дробь, числитель: икс минус мю; знаменатель: сигма; скобка закрывается в степени 2, конец показателя)")?; + "е в степени (показатель: минус одна вторая умножить на; скобка открывается; дробь, числитель: икс минус мю; знаменатель: сигма; скобка закрывается в степени 2, конец показателя)")?; return Ok(()); } diff --git a/tests/Languages/ru/ClearSpeak/sets.rs b/tests/Languages/ru/ClearSpeak/sets.rs index 29100565..d483258e 100644 --- a/tests/Languages/ru/ClearSpeak/sets.rs +++ b/tests/Languages/ru/ClearSpeak/sets.rs @@ -103,7 +103,7 @@ fn msup_integers() -> Result<()> { 4 "; - test("ru", "ClearSpeak", expr, "зэ 4")?; + test("ru", "ClearSpeak", expr, "зэт 4")?; return Ok(()); } @@ -187,7 +187,7 @@ fn set_with_colon() -> Result<()> { let expr = " { x:x>2 } "; - test("ru", "ClearSpeak", expr, "множество всех x таких, что x больше 2")?; + test("ru", "ClearSpeak", expr, "множество всех икс таких, что икс больше 2")?; return Ok(()); } @@ -196,7 +196,7 @@ fn set_with_bar() -> Result<()> { let expr = " { x|x>2 } "; - test("ru", "ClearSpeak", expr, "множество всех x таких, что x больше 2")?; + test("ru", "ClearSpeak", expr, "множество всех икс таких, что икс больше 2")?; return Ok(()); } @@ -205,7 +205,7 @@ fn element_alone() -> Result<()> { let expr = " 3+2i "; - test("ru", "ClearSpeak", expr, "3 плюс 2 i, не принадлежит действительным числам")?; + test("ru", "ClearSpeak", expr, "3 плюс 2 и, не принадлежит действительным числам")?; return Ok(()); } @@ -222,7 +222,7 @@ fn element_under_sum() -> Result<()> { "; test("ru", "ClearSpeak", expr, - "сумма по i, принадлежащему целым числам, от; дробь, числитель: 1; знаменатель: i в квадрате")?; + "сумма по и, принадлежащему целым числам, от; дробь, числитель: 1; знаменатель: и в квадрате")?; return Ok(()); } @@ -241,7 +241,7 @@ fn complicated_set_with_colon() -> Result<()> { 7 } "; - test("ru", "ClearSpeak", expr, "множество всех x из целых чисел, таких что 2 меньше x меньше 7")?; + test("ru", "ClearSpeak", expr, "множество всех икс из целых чисел, таких что 2 меньше икс меньше 7")?; return Ok(()); } @@ -255,7 +255,7 @@ fn complicated_set_with_mtext() -> Result<()> { } "; test("ru", "ClearSpeak", expr, - "множество всех x из натуральных чисел, таких что x — чётное число")?; + "множество всех икс из натуральных чисел, таких что икс — чётное число")?; return Ok(()); } @@ -273,7 +273,7 @@ fn set_with_bar_member() -> Result<()> { } "; test_ClearSpeak("ru", "ClearSpeak_SetMemberSymbol", "Member", - expr, "множество всех x, принадлежащих целым числам, таких что x больше 5")?; + expr, "множество всех икс, принадлежащих целым числам, таких что икс больше 5")?; return Ok(()); } @@ -283,7 +283,7 @@ fn element_alone_member() -> Result<()> { 3+2i "; test_ClearSpeak("ru", "ClearSpeak_SetMemberSymbol", "Member", - expr, "3 плюс 2 i, не принадлежит действительным числам")?; + expr, "3 плюс 2 и, не принадлежит действительным числам")?; return Ok(()); } @@ -300,7 +300,7 @@ fn element_under_sum_member() -> Result<()> { "; test_ClearSpeak("ru", "ClearSpeak_SetMemberSymbol", "Member", - expr, "сумма по i, принадлежащему целым числам, от; дробь, числитель: 1; знаменатель: i в квадрате")?; + expr, "сумма по и, принадлежащему целым числам, от; дробь, числитель: 1; знаменатель: и в квадрате")?; return Ok(()); } @@ -318,7 +318,7 @@ fn set_with_bar_element() -> Result<()> { } "; test_ClearSpeak("ru", "ClearSpeak_SetMemberSymbol", "Element", - expr, "множество всех x, являющихся элементами целых чисел, таких что x больше 5")?; + expr, "множество всех икс, являющихся элементами целых чисел, таких что икс больше 5")?; return Ok(()); } @@ -328,7 +328,7 @@ fn element_alone_element() -> Result<()> { 3+2i "; test_ClearSpeak("ru", "ClearSpeak_SetMemberSymbol", "Element", - expr, "3 плюс 2 i, не является элементом действительных чисел")?; + expr, "3 плюс 2 и, не является элементом действительных чисел")?; return Ok(()); } @@ -345,7 +345,7 @@ fn element_under_sum_element() -> Result<()> { "; test_ClearSpeak("ru", "ClearSpeak_SetMemberSymbol", "Element", - expr, "сумма по i, являющемуся элементом целых чисел, от; дробь, числитель: 1; знаменатель: i в квадрате")?; + expr, "сумма по и, являющемуся элементом целых чисел, от; дробь, числитель: 1; знаменатель: и в квадрате")?; return Ok(()); } @@ -363,7 +363,7 @@ fn set_with_bar_in() -> Result<()> { } "; test_ClearSpeak("ru", "ClearSpeak_SetMemberSymbol", "In", - expr, "множество всех x из целых чисел, таких что x больше 5")?; + expr, "множество всех икс из целых чисел, таких что икс больше 5")?; return Ok(()); } @@ -373,7 +373,7 @@ fn element_alone_in() -> Result<()> { 3+2i "; test_ClearSpeak("ru", "ClearSpeak_SetMemberSymbol", "In", - expr, "3 плюс 2 i, не принадлежит действительным числам")?; + expr, "3 плюс 2 и, не принадлежит действительным числам")?; return Ok(()); } @@ -390,7 +390,7 @@ fn element_under_sum_in() -> Result<()> { "; test_ClearSpeak("ru", "ClearSpeak_SetMemberSymbol", "In", - expr, "сумма по i из целых чисел, от; дробь, числитель: 1; знаменатель: i в квадрате")?; + expr, "сумма по и из целых чисел, от; дробь, числитель: 1; знаменатель: и в квадрате")?; return Ok(()); } @@ -408,7 +408,7 @@ fn set_with_bar_belongs() -> Result<()> { } "; test_ClearSpeak("ru", "ClearSpeak_SetMemberSymbol", "Belongs", - expr, "множество всех x, входящих в целые числа, таких что x больше 5")?; + expr, "множество всех икс, входящих в целые числа, таких что икс больше 5")?; return Ok(()); } @@ -418,7 +418,7 @@ fn element_alone_belongs() -> Result<()> { 3+2i "; test_ClearSpeak("ru", "ClearSpeak_SetMemberSymbol", "Belongs", - expr, "3 плюс 2 i, не входит в действительные числа")?; + expr, "3 плюс 2 и, не входит в действительные числа")?; return Ok(()); } @@ -435,7 +435,7 @@ fn element_under_sum_belongs() -> Result<()> { "; test_ClearSpeak("ru", "ClearSpeak_SetMemberSymbol", "Belongs", - expr, "сумма по i, входящему в целые числа, от; дробь, числитель: 1; знаменатель: i в квадрате")?; + expr, "сумма по и, входящему в целые числа, от; дробь, числитель: 1; знаменатель: и в квадрате")?; return Ok(()); } @@ -453,7 +453,7 @@ fn set_member_woall() -> Result<()> { } "; test_ClearSpeak_prefs("ru", vec![("ClearSpeak_SetMemberSymbol", "Member"), ("ClearSpeak_Sets", "woAll")], - expr, "множество x, принадлежащих целым числам, таких что x больше 5")?; + expr, "множество икс, принадлежащих целым числам, таких что икс больше 5")?; return Ok(()); } @@ -481,7 +481,7 @@ fn silent_bracket() -> Result<()> { {x|x>2} "; test_ClearSpeak("ru", "ClearSpeak_Sets", "SilentBracket", expr, - "множество всех x таких, что x больше 2")?; + "множество всех икс таких, что икс больше 2")?; return Ok(()); } diff --git a/tests/Languages/ru/ClearSpeak/symbols_and_adornments.rs b/tests/Languages/ru/ClearSpeak/symbols_and_adornments.rs index d61d8c55..52bb15df 100644 --- a/tests/Languages/ru/ClearSpeak/symbols_and_adornments.rs +++ b/tests/Languages/ru/ClearSpeak/symbols_and_adornments.rs @@ -25,7 +25,7 @@ fn multiplication_cross() -> Result<()> { let expr = " u×v "; - test_ClearSpeak("ru", "ClearSpeak_MultSymbolX", "Cross", expr, "u векторное произведение v")?; + test_ClearSpeak("ru", "ClearSpeak_MultSymbolX", "Cross", expr, "u векторное произведение вэ")?; return Ok(()); } @@ -188,7 +188,7 @@ fn vertical_line_probability_given() -> Result<()> { "; test_ClearSpeak_prefs("ru", vec![("ClearSpeak_VerticalLine", "Given"), ("ClearSpeak_ImpliedTimes", "None")], - expr, "пэ большое, открывается скобка, эй большое при условии бэ большое, закрывается скобка")?; + expr, "пэ большое, скобка открывается, а большое при условии бэ большое, скобка закрывается")?; return Ok(()); } @@ -206,7 +206,7 @@ fn vertical_line_set() -> Result<()> { } "; test_ClearSpeak("ru", "ClearSpeak_VerticalLine", "Auto", expr, - "множество всех x таких, что x больше 0")?; + "множество всех икс таких, что икс больше 0")?; return Ok(()); } @@ -224,7 +224,7 @@ fn vertical_line_set_such_that() -> Result<()> { } "; test_ClearSpeak("ru", "ClearSpeak_VerticalLine", "SuchThat", expr, - "множество всех x таких, что x больше 0")?; + "множество всех икс таких, что икс больше 0")?; return Ok(()); } @@ -242,7 +242,7 @@ fn vertical_line_set_given() -> Result<()> { } "; test_ClearSpeak("ru", "ClearSpeak_VerticalLine", "Given", expr, - "множество всех x таких, что x больше 0")?; + "множество всех икс таких, что икс больше 0")?; return Ok(()); } @@ -264,7 +264,7 @@ fn vertical_line_set_and_abs() -> Result<()> { } "; test_ClearSpeak("ru", "ClearSpeak_VerticalLine", "Auto", expr, - "множество всех x таких, что абсолютное значение x; больше 2")?; + "множество всех икс таких, что модуль икс; больше 2")?; return Ok(()); } @@ -287,7 +287,7 @@ fn vertical_line_evaluated_at() -> Result<()> { "; test_ClearSpeak("ru", "ClearSpeak_VerticalLine", "Auto", expr, - "эф от икс, вычисленное при, x равно 5")?; + "эф от икс, вычисленное при, икс равно 5")?; return Ok(()); } @@ -330,7 +330,7 @@ fn vertical_line_evaluated_at_divides() -> Result<()> { "; test_ClearSpeak("ru", "ClearSpeak_VerticalLine", "Divides", expr, - "эф от икс, вычисленное при, x равно 5")?; + "эф от икс, вычисленное при, икс равно 5")?; return Ok(()); } @@ -352,4 +352,4 @@ fn vertical_line_evaluated_at_both_given() -> Result<()> { test_ClearSpeak("ru", "ClearSpeak_VerticalLine", "Given", expr, "икс в квадрате плюс икс, вычисленное при 1 минус то же выражение, вычисленное при 0")?; return Ok(()); -} \ No newline at end of file +} diff --git a/tests/Languages/ru/SimpleSpeak/functions.rs b/tests/Languages/ru/SimpleSpeak/functions.rs index 53ceb391..916ac1f8 100644 --- a/tests/Languages/ru/SimpleSpeak/functions.rs +++ b/tests/Languages/ru/SimpleSpeak/functions.rs @@ -17,7 +17,7 @@ fn trig_names() -> Result<()> { cscϕ+ cotφ "; - test("ru", "SimpleSpeak", expr, "синус икс плюс косинус игрек плюс тангенс зет плюс секанс альфа, плюс косеканс фи, плюс котангенс фи")?; + test("ru", "SimpleSpeak", expr, "синус икс плюс косинус игрек плюс тангенс зэт плюс секанс альфа, плюс косеканс фи, плюс котангенс фи")?; return Ok(()); } @@ -33,7 +33,7 @@ fn hyperbolic_trig_names() -> Result<()> { "; test("ru", "SimpleSpeak", expr, "гиперболический синус икс, плюс \ гиперболический косинус игрек, плюс \ - гиперболический тангенс зет, плюс \ + гиперболический тангенс зэт, плюс \ гиперболический секанс альфа, плюс \ гиперболический косеканс фи, плюс \ гиперболический котангенс фи")?; @@ -64,14 +64,14 @@ fn trig_cubed() -> Result<()> { #[test] fn trig_fourth() -> Result<()> { let expr = "sec4x"; - test("ru", "SimpleSpeak", expr, "секанс в четвертой степени икс")?; + test("ru", "SimpleSpeak", expr, "секанс в четвёртой степени икс")?; return Ok(()); } #[test] fn trig_power_other() -> Result<()> { let expr = "sinh>n-1x"; - test("ru", "SimpleSpeak", expr, "гиперболический синус икс в степени n минус 1")?; + test("ru", "SimpleSpeak", expr, "гиперболический синус икс в степени эн минус 1")?; return Ok(()); } diff --git a/tests/Languages/ru/SimpleSpeak/large_ops.rs b/tests/Languages/ru/SimpleSpeak/large_ops.rs index a460c599..773bf772 100644 --- a/tests/Languages/ru/SimpleSpeak/large_ops.rs +++ b/tests/Languages/ru/SimpleSpeak/large_ops.rs @@ -12,7 +12,7 @@ fn sum_both() -> Result<()> { n "; - test("ru", "SimpleSpeak", expr, "сумма от n равно 1 до 10 от n")?; + test("ru", "SimpleSpeak", expr, "сумма от эн равно 1 до 10 от эн")?; return Ok(()); } @@ -25,7 +25,7 @@ fn sum_under() -> Result<()> { i "; - test("ru", "SimpleSpeak", expr, "сумма по эс большое от i")?; + test("ru", "SimpleSpeak", expr, "сумма по эс большое от и")?; return Ok(()); } @@ -39,7 +39,7 @@ fn sum_both_msubsup() -> Result<()> { n "; - test("ru", "SimpleSpeak", expr, "сумма от n равно 1 до 10 от n")?; + test("ru", "SimpleSpeak", expr, "сумма от эн равно 1 до 10 от эн")?; return Ok(()); } @@ -52,7 +52,7 @@ fn sum_sub() -> Result<()> { i "; - test("ru", "SimpleSpeak", expr, "сумма по эс большое от i")?; + test("ru", "SimpleSpeak", expr, "сумма по эс большое от и")?; return Ok(()); } @@ -62,7 +62,7 @@ fn sum() -> Result<()> { ai "; - test("ru", "SimpleSpeak", expr, "сумма а с индексом i")?; + test("ru", "SimpleSpeak", expr, "сумма а с индексом и")?; return Ok(()); } @@ -76,7 +76,7 @@ fn product_both() -> Result<()> { n "; - test("ru", "SimpleSpeak", expr, "произведение от n равно 1 до 10 от n")?; + test("ru", "SimpleSpeak", expr, "произведение от эн равно 1 до 10 от эн")?; return Ok(()); } @@ -89,7 +89,7 @@ fn product_under() -> Result<()> { i "; - test("ru", "SimpleSpeak", expr, "произведение по эс большое от i")?; + test("ru", "SimpleSpeak", expr, "произведение по эс большое от и")?; return Ok(()); } @@ -99,7 +99,7 @@ fn product() -> Result<()> { ai "; - test("ru", "SimpleSpeak", expr, "произведение а с индексом i")?; + test("ru", "SimpleSpeak", expr, "произведение а с индексом и")?; return Ok(()); } @@ -113,7 +113,7 @@ fn intersection_both() -> Result<()> { Si "; - test("ru", "SimpleSpeak", expr, "пересечение от i равно 1 до 10 от; эс большое с индексом i")?; + test("ru", "SimpleSpeak", expr, "пересечение от и равно 1 до 10 от; эс большое с индексом и")?; return Ok(()); } @@ -126,7 +126,7 @@ fn intersection_under() -> Result<()> { Si "; - test("ru", "SimpleSpeak", expr, "пересечение по цэ большое от, эс большое с индексом i")?; + test("ru", "SimpleSpeak", expr, "пересечение по цэ большое от, эс большое с индексом и")?; return Ok(()); } @@ -136,7 +136,7 @@ fn intersection() -> Result<()> { Si "; - test("ru", "SimpleSpeak", expr, "пересечение эс большое с индексом i")?; + test("ru", "SimpleSpeak", expr, "пересечение эс большое с индексом и")?; return Ok(()); } @@ -150,7 +150,7 @@ fn union_both() -> Result<()> { Si "; - test("ru", "SimpleSpeak", expr, "объединение от i равно 1 до 10 от; эс большое с индексом i")?; + test("ru", "SimpleSpeak", expr, "объединение от и равно 1 до 10 от; эс большое с индексом и")?; return Ok(()); } @@ -163,7 +163,7 @@ fn union_under() -> Result<()> { Si "; - test("ru", "SimpleSpeak", expr, "объединение по цэ большое от, эс большое с индексом i")?; + test("ru", "SimpleSpeak", expr, "объединение по цэ большое от, эс большое с индексом и")?; return Ok(()); } @@ -173,7 +173,7 @@ fn union() -> Result<()> { Si "; - test("ru", "SimpleSpeak", expr, "объединение эс большое с индексом i")?; + test("ru", "SimpleSpeak", expr, "объединение эс большое с индексом и")?; return Ok(()); } @@ -217,4 +217,4 @@ fn integral() -> Result<()> { "; test("ru", "SimpleSpeak", expr, "интеграл от эф от икс д икс")?; return Ok(()); -} \ No newline at end of file +} diff --git a/tests/Languages/ru/SimpleSpeak/linear_algebra.rs b/tests/Languages/ru/SimpleSpeak/linear_algebra.rs index bdf4f7e0..27e774fd 100644 --- a/tests/Languages/ru/SimpleSpeak/linear_algebra.rs +++ b/tests/Languages/ru/SimpleSpeak/linear_algebra.rs @@ -80,7 +80,7 @@ fn norm_subscripted() -> Result<()> { "; - test("ru", "SimpleSpeak", expr, "p-норма от эф")?; + test("ru", "SimpleSpeak", expr, "пэ-норма от эф")?; return Ok(()); } @@ -100,4 +100,4 @@ fn not_gradient() -> Result<()> { "#; test("ru", "SimpleSpeak", expr, "скобка открывается, бэ умножить на набла, скобка закрывается; умножить на а")?; return Ok(()); -} \ No newline at end of file +} diff --git a/tests/Languages/ru/SimpleSpeak/mfrac.rs b/tests/Languages/ru/SimpleSpeak/mfrac.rs index eaab8099..bbce2bfa 100644 --- a/tests/Languages/ru/SimpleSpeak/mfrac.rs +++ b/tests/Languages/ru/SimpleSpeak/mfrac.rs @@ -271,7 +271,7 @@ fn binomial_non_simple_top() -> Result<()> { n+7 3 ) "; - test("ru", "SimpleSpeak", expr, "2 умножить на, число сочетаний из n плюс 7 по 3")?; + test("ru", "SimpleSpeak", expr, "2 умножить на, число сочетаний из эн плюс 7 по 3")?; return Ok(()); } @@ -283,7 +283,7 @@ fn binomial_non_simple_bottom() -> Result<()> { 7 k+3 ) "; - test("ru", "SimpleSpeak", expr, "2 умножить на, число сочетаний из 7 по k плюс 3 конец числа сочетаний")?; + test("ru", "SimpleSpeak", expr, "2 умножить на, число сочетаний из 7 по ка плюс 3 конец числа сочетаний")?; return Ok(()); } @@ -295,6 +295,6 @@ fn binomial_non_simple_top_and_bottom() -> Result<()> { n+7 k+3 ) "; - test("ru", "SimpleSpeak", expr, "2 умножить на, число сочетаний из n плюс 7 по k плюс 3 конец числа сочетаний")?; + test("ru", "SimpleSpeak", expr, "2 умножить на, число сочетаний из эн плюс 7 по ка плюс 3 конец числа сочетаний")?; return Ok(()); } diff --git a/tests/Languages/ru/SimpleSpeak/msup.rs b/tests/Languages/ru/SimpleSpeak/msup.rs index 80ca3272..15daedc6 100644 --- a/tests/Languages/ru/SimpleSpeak/msup.rs +++ b/tests/Languages/ru/SimpleSpeak/msup.rs @@ -191,7 +191,7 @@ fn nested_number_times_squared() -> Result<()> { "; - test("ru", "SimpleSpeak", expr, "e в степени одна вторая икс в квадрате")?; + test("ru", "SimpleSpeak", expr, "е в степени одна вторая икс в квадрате")?; return Ok(()); } @@ -214,7 +214,7 @@ fn nested_negative_number_times_squared() -> Result<()> { "; - test("ru", "SimpleSpeak", expr, "e в степени минус одна вторая икс в квадрате")?; + test("ru", "SimpleSpeak", expr, "е в степени минус одна вторая икс в квадрате")?; return Ok(()); } @@ -289,7 +289,7 @@ fn nested_end_exponent_power() -> Result<()> { "; test("ru", "SimpleSpeak", expr, "тэ в степени четыре пятых в степени n плюс 1, конец показателя")?; test_prefs("ru", "SimpleSpeak", vec![("Impairment", "LearningDisability")], expr, - "тэ в степени четыре пятых в степени n плюс 1")?; + "тэ в степени четыре пятых в степени эн плюс 1")?; return Ok(()); } @@ -337,7 +337,7 @@ fn nested_complex_power() -> Result<()> { "; test("ru", "SimpleSpeak", expr, - "e в степени минус одна вторая умножить на; скобка открывается, дробь, числитель: икс минус мю, знаменатель: сигма, конец дроби; скобка закрывается в квадрате")?; + "е в степени минус одна вторая умножить на; скобка открывается, дробь, числитель: икс минус мю, знаменатель: сигма, конец дроби; скобка закрывается в квадрате")?; return Ok(()); } diff --git a/tests/Languages/ru/SimpleSpeak/sets.rs b/tests/Languages/ru/SimpleSpeak/sets.rs index ec430e4a..6ee6921b 100644 --- a/tests/Languages/ru/SimpleSpeak/sets.rs +++ b/tests/Languages/ru/SimpleSpeak/sets.rs @@ -187,7 +187,7 @@ fn set_with_colon() -> Result<()> { let expr = " { x:x>2 } "; - test("ru", "SimpleSpeak", expr, "множество всех x таких, что x больше 2")?; + test("ru", "SimpleSpeak", expr, "множество всех икс таких, что икс больше 2")?; return Ok(()); } @@ -222,7 +222,7 @@ fn element_under_sum() -> Result<()> { "; test("ru", "SimpleSpeak", expr, - "сумма по i, являющемуся элементом целых чисел, от; дробь, числитель: 1, знаменатель: и в квадрате, конец дроби")?; + "сумма по и, являющемуся элементом целых чисел, от; дробь, числитель: 1, знаменатель: и в квадрате, конец дроби")?; return Ok(()); } @@ -255,6 +255,6 @@ fn complicated_set_with_mtext() -> Result<()> { } "; test("ru", "SimpleSpeak", expr, - "множество всех икс из натуральных чисел, таких что x — четное число")?; + "множество всех икс из натуральных чисел, таких что x — чётное число")?; return Ok(()); } diff --git a/tests/Languages/ru/SimpleSpeak/subscripts.rs b/tests/Languages/ru/SimpleSpeak/subscripts.rs index aae9411a..d67801a2 100644 --- a/tests/Languages/ru/SimpleSpeak/subscripts.rs +++ b/tests/Languages/ru/SimpleSpeak/subscripts.rs @@ -29,7 +29,7 @@ fn msubsup_not_simple() -> Result<()> { fn msub_simple_mi() -> Result<()> { let expr = " x i "; test_prefs("ru", "SimpleSpeak", vec![("Verbosity", "Terse")], expr, "икс с индексом i")?; - test_prefs("ru", "SimpleSpeak", vec![("Verbosity", "Verbose")], expr, "икс с индексом i")?; + test_prefs("ru", "SimpleSpeak", vec![("Verbosity", "Verbose")], expr, "икс с индексом и")?; return Ok(()); } @@ -55,4 +55,4 @@ fn msubsup_simple() -> Result<()> { test_prefs("ru", "SimpleSpeak", vec![("Verbosity", "Terse")], expr, "икс 1, икс в квадрате")?; test_prefs("ru", "SimpleSpeak", vec![("Verbosity", "Verbose")], expr, "икс с индексом 1, икс в квадрате")?; return Ok(()); -} \ No newline at end of file +} diff --git a/tests/Languages/ru/alphabets.rs b/tests/Languages/ru/alphabets.rs index b9a44a08..820af5e7 100644 --- a/tests/Languages/ru/alphabets.rs +++ b/tests/Languages/ru/alphabets.rs @@ -39,16 +39,16 @@ fn cap_cyrillic() -> Result<()> { #[test] fn parenthesized() -> Result<()> { let expr = " ,"; - test("ru", "SimpleSpeak", expr, "а в скобках, зет в скобках")?; + test("ru", "SimpleSpeak", expr, "а в скобках, зэт в скобках")?; return Ok(()); } #[test] fn circled() -> Result<()> { let expr = " ,"; - test("ru", "SimpleSpeak", expr, "заглавная а в кружке, заглавная зет в кружке")?; + test("ru", "SimpleSpeak", expr, "заглавная а в кружке, заглавная зэт в кружке")?; let expr = " ,"; - test("ru", "SimpleSpeak", expr, "а в кружке, зет в кружке")?; + test("ru", "SimpleSpeak", expr, "а в кружке, зэт в кружке")?; return Ok(()); } @@ -57,26 +57,26 @@ fn fraktur() -> Result<()> { let expr = " 𝔄,𝔜"; test("ru", "SimpleSpeak", expr, "фрактурная заглавная а, фрактурная заглавная игрек")?; let expr = " 𝔞,𝔷"; - test("ru", "SimpleSpeak", expr, "фрактурная а, фрактурная зет")?; + test("ru", "SimpleSpeak", expr, "фрактурная а, фрактурная зэт")?; // Версии из частной области MathType let expr = " ,"; test("ru", "SimpleSpeak", expr, "фрактурная заглавная а, фрактурная заглавная игрек")?; let expr = " ,"; - test("ru", "SimpleSpeak", expr, "фрактурная а, фрактурная зет")?; + test("ru", "SimpleSpeak", expr, "фрактурная а, фрактурная зэт")?; return Ok(()); } #[test] fn bold_fraktur() -> Result<()> { let expr = " 𝕬,𝖅"; - test("ru", "SimpleSpeak", expr, "фрактурная жирная заглавная а, фрактурная жирная заглавная зет")?; + test("ru", "SimpleSpeak", expr, "фрактурная жирная заглавная а, фрактурная жирная заглавная зэт")?; let expr = " 𝖆,𝖟"; - test("ru", "SimpleSpeak", expr, "фрактурная жирная а, фрактурная жирная зет")?; + test("ru", "SimpleSpeak", expr, "фрактурная жирная а, фрактурная жирная зэт")?; // Версии из частной области MathType let expr = " ,"; - test("ru", "SimpleSpeak", expr, "фрактурная жирная заглавная а, фрактурная жирная заглавная зет")?; + test("ru", "SimpleSpeak", expr, "фрактурная жирная заглавная а, фрактурная жирная заглавная зэт")?; let expr = " ,"; - test("ru", "SimpleSpeak", expr, "фрактурная жирная а, фрактурная жирная зет")?; + test("ru", "SimpleSpeak", expr, "фрактурная жирная а, фрактурная жирная зэт")?; return Ok(()); } @@ -85,14 +85,14 @@ fn double_struck() -> Result<()> { let expr = " 𝔸,𝕐"; test("ru", "SimpleSpeak", expr, "двойная заглавная а, двойная заглавная игрек")?; let expr = " 𝕒,𝕫"; - test("ru", "SimpleSpeak", expr, "двойная а, двойная зет")?; + test("ru", "SimpleSpeak", expr, "двойная а, двойная зэт")?; let expr = " 𝟘,𝟡"; test("ru", "SimpleSpeak", expr, "двойной ноль, двойная девять")?; // Версии из частной области MathType let expr = " ,"; test("ru", "SimpleSpeak", expr, "двойная заглавная а, двойная заглавная игрек")?; let expr = " ,"; - test("ru", "SimpleSpeak", expr, "двойная а, двойная зет")?; + test("ru", "SimpleSpeak", expr, "двойная а, двойная зэт")?; let expr = " ,"; test("ru", "SimpleSpeak", expr, "двойной ноль, двойная девять")?; return Ok(()); @@ -101,126 +101,126 @@ fn double_struck() -> Result<()> { #[test] fn script() -> Result<()> { let expr = " 𝒜,𝒵"; - test("ru", "SimpleSpeak", expr, "рукописная заглавная а, рукописная заглавная зет")?; + test("ru", "SimpleSpeak", expr, "рукописная заглавная а, рукописная заглавная зэт")?; let expr = " 𝒶,𝓏"; - test("ru", "SimpleSpeak", expr, "рукописная а, рукописная зет")?; + test("ru", "SimpleSpeak", expr, "рукописная а, рукописная зэт")?; // Версии из частной области MathType let expr = " ,"; - test("ru", "SimpleSpeak", expr, "рукописная заглавная а, рукописная заглавная зет")?; + test("ru", "SimpleSpeak", expr, "рукописная заглавная а, рукописная заглавная зэт")?; let expr = " ,"; - test("ru", "SimpleSpeak", expr, "рукописная а, рукописная зет")?; + test("ru", "SimpleSpeak", expr, "рукописная а, рукописная зэт")?; return Ok(()); } #[test] fn bold_script() -> Result<()> { let expr = " 𝓐,𝓩"; - test("ru", "SimpleSpeak", expr, "рукописная жирная заглавная а, рукописная жирная заглавная зет")?; + test("ru", "SimpleSpeak", expr, "рукописная жирная заглавная а, рукописная жирная заглавная зэт")?; let expr = " 𝓪,𝔃"; - test("ru", "SimpleSpeak", expr, "рукописная жирная а, рукописная жирная зет")?; + test("ru", "SimpleSpeak", expr, "рукописная жирная а, рукописная жирная зэт")?; // Версии из частной области MathType let expr = " ,"; - test("ru", "SimpleSpeak", expr, "рукописная жирная заглавная а, рукописная жирная заглавная зет")?; + test("ru", "SimpleSpeak", expr, "рукописная жирная заглавная а, рукописная жирная заглавная зэт")?; let expr = " ,"; - test("ru", "SimpleSpeak", expr, "рукописная жирная а, рукописная жирная зет")?; + test("ru", "SimpleSpeak", expr, "рукописная жирная а, рукописная жирная зэт")?; return Ok(()); } #[test] fn bold() -> Result<()> { let expr = " 𝐀,𝐙"; - test("ru", "SimpleSpeak", expr, "жирная заглавная а, жирная заглавная зет")?; + test("ru", "SimpleSpeak", expr, "жирная заглавная а, жирная заглавная зэт")?; let expr = " 𝐚,𝐳"; - test("ru", "SimpleSpeak", expr, "жирная а, жирная зет")?; + test("ru", "SimpleSpeak", expr, "жирная а, жирная зэт")?; // Версии из частной области MathType let expr = " ,"; - test("ru", "SimpleSpeak", expr, "жирная заглавная а, жирная заглавная зет")?; + test("ru", "SimpleSpeak", expr, "жирная заглавная а, жирная заглавная зэт")?; let expr = " ,"; - test("ru", "SimpleSpeak", expr, "жирная а, жирная зет")?; + test("ru", "SimpleSpeak", expr, "жирная а, жирная зэт")?; return Ok(()); } #[test] fn italic() -> Result<()> { let expr = " 𝐴,𝑍"; - test("ru", "SimpleSpeak", expr, "заглавная а, заглавная зет")?; + test("ru", "SimpleSpeak", expr, "заглавная а, заглавная зэт")?; let expr = " 𝑎,𝑧"; - test("ru", "SimpleSpeak", expr, "а, зет")?; + test("ru", "SimpleSpeak", expr, "а, зэт")?; // Версии из частной области MathType let expr = " ,"; - test("ru", "SimpleSpeak", expr, "заглавная а, заглавная зет")?; + test("ru", "SimpleSpeak", expr, "заглавная а, заглавная зэт")?; let expr = " ,"; - test("ru", "SimpleSpeak", expr, "а, зет")?; + test("ru", "SimpleSpeak", expr, "а, зэт")?; return Ok(()); } #[test] fn sans_serif() -> Result<()> { let expr = " 𝖠,𝖹"; - test("ru", "SimpleSpeak", expr, "заглавная а, заглавная зет")?; + test("ru", "SimpleSpeak", expr, "заглавная а, заглавная зэт")?; let expr = " 𝖺,𝗓"; - test("ru", "SimpleSpeak", expr, "а, зет")?; + test("ru", "SimpleSpeak", expr, "а, зэт")?; // Версии из частной области MathType let expr = " ,"; - test("ru", "SimpleSpeak", expr, "заглавная а, заглавная зет")?; + test("ru", "SimpleSpeak", expr, "заглавная а, заглавная зэт")?; let expr = " ,"; - test("ru", "SimpleSpeak", expr, "а, зет")?; + test("ru", "SimpleSpeak", expr, "а, зэт")?; return Ok(()); } #[test] fn sans_serif_bold() -> Result<()> { let expr = " 𝗔,𝗭"; - test("ru", "SimpleSpeak", expr, "жирная заглавная а, жирная заглавная зет")?; + test("ru", "SimpleSpeak", expr, "жирная заглавная а, жирная заглавная зэт")?; let expr = " 𝗮,𝘇"; - test("ru", "SimpleSpeak", expr, "жирная а, жирная зет")?; + test("ru", "SimpleSpeak", expr, "жирная а, жирная зэт")?; // Версии из частной области MathType let expr = " ,"; - test("ru", "SimpleSpeak", expr, "жирная заглавная а, жирная заглавная зет")?; + test("ru", "SimpleSpeak", expr, "жирная заглавная а, жирная заглавная зэт")?; let expr = " ,"; - test("ru", "SimpleSpeak", expr, "жирная а, жирная зет")?; + test("ru", "SimpleSpeak", expr, "жирная а, жирная зэт")?; return Ok(()); } #[test] fn sans_serif_italic() -> Result<()> { let expr = " 𝘈,𝘡"; - test("ru", "SimpleSpeak", expr, "заглавная а, заглавная зет")?; + test("ru", "SimpleSpeak", expr, "заглавная а, заглавная зэт")?; let expr = " 𝘢,𝘻"; - test("ru", "SimpleSpeak", expr, "а, зет")?; + test("ru", "SimpleSpeak", expr, "а, зэт")?; // Версии из частной области MathType let expr = " ,"; - test("ru", "SimpleSpeak", expr, "заглавная а, заглавная зет")?; + test("ru", "SimpleSpeak", expr, "заглавная а, заглавная зэт")?; let expr = " ,"; - test("ru", "SimpleSpeak", expr, "а, зет")?; + test("ru", "SimpleSpeak", expr, "а, зэт")?; return Ok(()); } #[test] fn sans_serif_bold_italic() -> Result<()> { let expr = " 𝘼,𝙕"; - test("ru", "SimpleSpeak", expr, "жирная заглавная а, жирная заглавная зет")?; + test("ru", "SimpleSpeak", expr, "жирная заглавная а, жирная заглавная зэт")?; let expr = " 𝙖,𝙯"; - test("ru", "SimpleSpeak", expr, "жирная а, жирная зет")?; + test("ru", "SimpleSpeak", expr, "жирная а, жирная зэт")?; // Версии из частной области MathType let expr = " ,"; - test("ru", "SimpleSpeak", expr, "жирная заглавная а, жирная заглавная зет")?; + test("ru", "SimpleSpeak", expr, "жирная заглавная а, жирная заглавная зэт")?; let expr = " ,"; - test("ru", "SimpleSpeak", expr, "жирная а, жирная зет")?; + test("ru", "SimpleSpeak", expr, "жирная а, жирная зэт")?; return Ok(()); } #[test] fn monospace() -> Result<()> { let expr = " 𝙰,𝚉"; - test("ru", "SimpleSpeak", expr, "заглавная а, заглавная зет")?; + test("ru", "SimpleSpeak", expr, "заглавная а, заглавная зэт")?; let expr = " 𝚊,𝚣"; - test("ru", "SimpleSpeak", expr, "а, зет")?; + test("ru", "SimpleSpeak", expr, "а, зэт")?; // Версии из частной области MathType let expr = " ,"; - test("ru", "SimpleSpeak", expr, "заглавная а, заглавная зет")?; + test("ru", "SimpleSpeak", expr, "заглавная а, заглавная зэт")?; let expr = " ,"; - test("ru", "SimpleSpeak", expr, "а, зет")?; + test("ru", "SimpleSpeak", expr, "а, зэт")?; return Ok(()); } @@ -347,7 +347,7 @@ fn sans_serif_bold_italic_greek_others() -> Result<()> { #[test] fn pua_regular() -> Result<()> { let expr = " ,"; - test("ru", "SimpleSpeak", expr, "заглавная а, заглавная зет")?; + test("ru", "SimpleSpeak", expr, "заглавная а, заглавная зэт")?; return Ok(()); }