Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
125 changes: 105 additions & 20 deletions Rules/Braille/Russian/Russian_Rules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,51 @@
-
name: default
tag: mroot
match: "."
match: "not(*[2][self::m:mn and translate(., '0123456789', '')=''])"
replace:
- t: "⠩"
- x: "*[2]"
- t: "⠱"
- x: "*[1]"
- t: "⠹"

-
name: integer-index
tag: mroot
match: "*[2][self::m:mn and translate(., '0123456789', '')='']"
replace:
- t: "⠩"
- x: "BrailleChars(translate(*[2], '0123456789', '\ue000\ue001\ue002\ue003\ue004\ue005\ue006\ue007\ue008\ue009'), 'Russian')"
- t: "⠱"
- x: "*[1]"
- t: "⠹"

-
name: simple-numeric
tag: mfrac
match:
- "*[1][self::m:mn and translate(., '0123456789', '')=''] and"
- "*[2][self::m:mn and translate(., '0123456789', '')='']"
replace:
- x: "*[1]"
- x: "BrailleChars(translate(*[2], '0123456789', '\ue000\ue001\ue002\ue003\ue004\ue005\ue006\ue007\ue008\ue009'), 'Russian')"

-
name: simple-algebraic
tag: mfrac
match:
- "(*[1][self::m:mi] or *[1][self::m:mn and translate(., '0123456789', '')='']) and"
- "(*[2][self::m:mi] or *[2][self::m:mn and translate(., '0123456789', '')=''])"
replace:
- x: "*[1]"
- t: "⠳"
- test:
if: "*[2][self::m:mn]"
then:
- x: "BrailleChars(translate(*[2], '0123456789', '\ue000\ue001\ue002\ue003\ue004\ue005\ue006\ue007\ue008\ue009'), 'Russian')"
else:
- x: "*[2]"

-
name: default
tag: mfrac
Expand Down Expand Up @@ -125,9 +162,7 @@
name: default
tag: mtable
match: "."
replace:
- t: "⠞⠃⠇"
- x: "*"
replace: [x: "*"]

-
name: default
Expand Down Expand Up @@ -163,6 +198,18 @@
match: "*[2][translate(., \"'*`ª°²³´¹º′″‴‵‶‷⁗\",'')='']"
replace: [x: "*"]

-
name: integer
tag: [msub, munder]
match: "*[2][self::m:mn and translate(., '0123456789', '')='']"
replace:
- x: "*[1]"
- test:
if: "self::m:munder"
then: [t: "⠨⠡"]
else: [t: "⠡"]
- x: "BrailleChars(translate(*[2], '0123456789', '\ue000\ue001\ue002\ue003\ue004\ue005\ue006\ue007\ue008\ue009'), 'Russian')"

-
name: default
tag: [msub, munder]
Expand All @@ -176,6 +223,18 @@
- x: "*[2]"
- t: "⠱"

-
name: integer
tag: [msup, mover]
match: "*[2][self::m:mn and translate(., '0123456789', '')='']"
replace:
- x: "*[1]"
- test:
if: "self::m:mover"
then: [t: "⠨⠌"]
else: [t: "⠌"]
- x: "BrailleChars(translate(*[2], '0123456789', '\ue000\ue001\ue002\ue003\ue004\ue005\ue006\ue007\ue008\ue009'), 'Russian')"

-
name: default
tag: [msup, mover]
Expand Down Expand Up @@ -222,6 +281,30 @@
- x: "*"
- t: "⠜"

-
name: chemical-formula-operator-bond
tag: mo
match: "@data-chemical-bond"
replace:
- test:
- if: ".='-' or .=':'"
then: [t: "⠤"]
- else_if: ".='=' or .='∷'"
then: [t: "⠦"]
- else_if: ".='≡'"
then: [t: "⠿"]
else: [x: "text()"]

-
name: prefix-geometry-ops
tag: mo
match:
- "parent::*[count(*) = 2 and name()='mrow' and not(preceding-sibling::*)] and"
- "( .='∠' or .='△' or .='∪' )"
replace:
- x: "text()"
- t: "#"

-
name: default
tag: mo
Expand All @@ -239,39 +322,41 @@
-
name: functions
tag: mi
match: "IsInDefinition(., 'Speech', 'FunctionNames')"
match:
- "IsInDefinition(., 'Speech', 'FunctionNames') or"
- ".='tg' or .='ctg' or .='arctg' or .='arcctg'"
replace:
- test:
- if: ".='arcsin'"
then: [t: "⠫⠁⠎"]
then: [t: "⠫⠁⠎#"]
- else_if: ".='arccos'"
then: [t: "⠫⠁⠉"]
then: [t: "⠫⠁⠉#"]
- else_if: ".='arctg' or .='arctan'"
then: [t: "⠫⠁⠞"]
then: [t: "⠫⠁⠞#"]
- else_if: ".='arcctg' or .='arccotan' or .='arccot'"
then: [t: "⠫⠁⠉⠞"]
then: [t: "⠫⠁⠉⠞#"]
- else_if: ".='sin'"
then: [t: "⠫⠎"]
then: [t: "⠫⠎#"]
- else_if: ".='cos'"
then: [t: "⠫⠉"]
then: [t: "⠫⠉#"]
- else_if: ".='tg' or .='tan'"
then: [t: "⠫⠞"]
then: [t: "⠫⠞#"]
- else_if: ".='ctg' or .='cotan' or .='cot'"
then: [t: "⠫⠉⠞"]
then: [t: "⠫⠉⠞#"]
- else_if: ".='log'"
then: [t: "⠫⠇"]
then: [t: "⠫⠇#"]
- else_if: ".='ln'"
then: [t: "⠫⠇⠝"]
then: [t: "⠫⠇⠝#"]
- else_if: ".='lg'"
then: [t: "⠫⠇⠛"]
then: [t: "⠫⠇⠛#"]
- else_if: ".='lim'"
then: [t: "⠫⠇⠍"]
then: [t: "⠫⠇⠍#"]
- else_if: ".='min'"
then: [t: "⠫⠍⠝"]
then: [t: "⠫⠍⠝#"]
- else_if: ".='max'"
then: [t: "⠫⠍⠭"]
then: [t: "⠫⠍⠭#"]
- else_if: ".='exp'"
then: [t: "⠫⠑"]
then: [t: "⠫⠑#"]
else: [x: "BrailleChars(., 'Russian')"]

-
Expand Down
Loading
Loading