Skip to content
Merged
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
78 changes: 39 additions & 39 deletions Rules/Languages/ja/SimpleSpeak_Rules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
tag: mn
match: "starts-with(text(), '-')"
replace:
- t: "マイナス" # phrase(x 'minus' y)
- T: "マイナス" # phrase(x 'minus' y)
- x: "translate(text(), '-_', '')"

- name: default
Expand All @@ -35,16 +35,16 @@
- test:
if: "$Verbosity!='Terse'"
then: [ot: ""] # phrase('the' square root of x)
- t: "平方根" # phrase(the 'square root' of x)
- T: "平方根" # phrase(the 'square root' of x)
- test:
if: "$Verbosity!='Terse'"
then: [t: "オブ"] # phrase(the square root 'of' x)
then: [T: "オブ"] # phrase(the square root 'of' x)
else: [pause: short]
- x: "*[1]"
- pause: short
- test:
if: "not(IsNode(*[1], 'leaf')) and $Impairment = 'Blindness'"
then: [t: "根号終了", pause: medium] # phrase(start the square root of x 'end of root')
then: [T: "根号終了", pause: medium] # phrase(start the square root of x 'end of root')

- name: default
tag: root
Expand All @@ -57,21 +57,21 @@
if: "*[2][self::m:mn and not(contains(., '.'))]"
then_test:
- if: "*[2][.='2']"
then: [t: "平方根"] # phrase(the 'square root' of x)
then: [T: "平方根"] # phrase(the 'square root' of x)
- else_if: "*[2][.='3']"
then: [t: "立方根"] # phrase(the 'cube root' of x)
- else: [x: "*[2]", t: "乗根"] # phrase(the square 'root' of 25)
then: [T: "立方根"] # phrase(the 'cube root' of x)
- else: [x: "*[2]", T: "乗根"] # phrase(the square 'root' of 25)
else:
- x: "*[2]"
- t: "乗根" # phrase(the square 'root' of)
- T: "乗根" # phrase(the square 'root' of)
- test:
if: "$Verbosity!='Terse'"
then: [t: "オブ"] # phrase(the square root 'of' x)
then: [T: "オブ"] # phrase(the square root 'of' x)
- x: "*[1]"
- pause: short
- test:
if: "not(IsNode(*[1], 'leaf')) and $Impairment = 'Blindness'"
then: [t: "根号終了", pause: medium] # phrase(start the square root of x 'end of root')
then: [T: "根号終了", pause: medium] # phrase(start the square root of x '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
Expand Down Expand Up @@ -108,7 +108,7 @@
- "BaseNode(*[2])[contains(@data-intent-property, ':unit')] "
replace:
- x: "*[1]"
- t: "毎" # phrase('5 meters 'per' second)
- T: "毎" # phrase('5 meters 'per' second)
- x: "*[2]"

- name: simple
Expand All @@ -121,7 +121,7 @@
- "not(ancestor::*[name() != 'mrow'][1]/self::m:fraction)" # FIX: can't test for mrow -- what should be used???
replace:
- x: "*[1]"
- t: "オーバー" # phrase(the fraction 3 'over' 4)
- T: "オーバー" # phrase(the fraction 3 'over' 4)
- x: "*[2]"
- pause: short

Expand All @@ -131,21 +131,21 @@
replace:
- test:
if: "$Impairment = 'Blindness'"
then: [t: "分数"] # phrase(the 'fraction' 3 over 4)
then: [T: "分数"] # phrase(the 'fraction' 3 over 4)
- pause: short
- x: "*[1]"
- test:
if: "not(IsNode(*[1],'leaf'))"
then: [pause: short]
- t: "オーバー" # phrase(the fraction 3 'over' 4)
- T: "オーバー" # phrase(the fraction 3 'over' 4)
- test:
if: "not(IsNode(*[2],'leaf'))"
then: [pause: short]
- x: "*[2]"
- pause: short
- test:
if: "$Impairment = 'Blindness'"
then: [t: "分数終了"] # phrase(start 7 over 8 'end of fraction')
then: [T: "分数終了"] # phrase(start 7 over 8 'end of fraction')
- pause: medium

# rules for functions raised to a power
Expand All @@ -168,18 +168,18 @@
- bookmark: "*[2]/@id"
- test:
if: "*[2][.=2]"
then: [t: "の 2 乗"] # phrase(5 'squared' equals 25)
else: [t: "の 3 乗"] # phrase(5 'cubed' equals 125)
then: [T: "の 2 乗"] # phrase(5 'squared' equals 25)
else: [T: "の 3 乗"] # phrase(5 'cubed' equals 125)
- name: function-power
tag: power
match:
- "following-sibling::*[1][self::m:mo][.='⁡']" #invisible function apply
replace:
- x: "*[1]"
- t: "の" # phrase(the fourth 'power of' 2)
- T: "の" # phrase(the fourth 'power of' 2)
- bookmark: "*[2]/@id"
- x: "*[2]"
- t: "乗" # phrase(the fourth 'power of' 2)
- T: "乗" # phrase(the fourth 'power of' 2)
- pause: short

# non-function rules for power
Expand All @@ -191,17 +191,17 @@
- bookmark: "*[2]/@id"
- test:
if: "*[2][.=2]"
then: [t: "の 2 乗"] # phrase(5 'squared' equals 25)
else: [t: "の 3 乗"] # phrase(5 'cubed' equals 125)
then: [T: "の 2 乗"] # phrase(5 'squared' equals 25)
else: [T: "の 3 乗"] # phrase(5 'cubed' equals 125)

- name: simple-integer
tag: power
match: "*[2][self::m:mn][not(contains(., '.'))]"
replace:
- x: "*[1]"
- t: "の" # phrase(15 raised 'to the' second power equals 225)
- T: "の" # phrase(15 raised 'to the' second power equals 225)
- x: "*[2]"
- t: "乗" # phrase(15 raised to the second 'power' equals 225)
- T: "乗" # phrase(15 raised to the second 'power' equals 225)

- name: simple-negative-integer
tag: power
Expand All @@ -210,27 +210,27 @@
- " *[1][self::m:mn][not(contains(., '.'))]]"
replace:
- x: "*[1]"
- t: "の" # phrase(15 raised 'to the' second power equals 225)
- T: "の" # phrase(15 raised 'to the' second power equals 225)
- x: "*[2]"
- t: "乗" # phrase(15 raised to the second 'power' equals 225)
- T: "乗" # phrase(15 raised to the second 'power' equals 225)

- name: simple-var
tag: power
match: "*[2][self::m:mi][string-length(.)=1]"
replace:
- x: "*[1]"
- t: "の" # phrase(15 raised 'to the' second power equals 225)
- T: "の" # phrase(15 raised 'to the' second power equals 225)
- x: "*[2]"
- t: "乗" # phrase(15 raised to the second 'power' equals 225)
- T: "乗" # phrase(15 raised to the second 'power' equals 225)

- name: simple
tag: power
match: "IsNode(*[2], 'leaf')"
replace:
- x: "*[1]"
- t: "の" # phrase(15 raised 'to the' second power equals 225)
- T: "の" # phrase(15 raised 'to the' second power equals 225)
- x: "*[2]"
- t: "乗" # phrase(15 raised to the second 'power' equals 225)
- T: "乗" # phrase(15 raised to the second 'power' equals 225)

- name: nested
# it won't end in "power" if the exponent is simple enough
Expand All @@ -244,13 +244,13 @@
- " ]"
replace:
- x: "*[1]"
- t: "の上付き" # phrase(15 'raised to the' second power equals 225)
- T: "の上付き" # phrase(15 'raised to the' second power equals 225)
- x: "*[2]"
- pause: short
- test:
if: "$Impairment = 'Blindness'"
then:
- t: "上付き終了" # phrase(start 2 raised to the exponent 4 'end of exponent')
- T: "上付き終了" # phrase(start 2 raised to the exponent 4 'end of exponent')
- pause: short
else:
- pause: medium
Expand All @@ -260,9 +260,9 @@
match: "."
replace:
- x: "*[1]"
- t: "の上付き" # phrase(15 'raised to the' second power equals 225)
- T: "の上付き" # phrase(15 'raised to the' second power equals 225)
- x: "*[2]"
- t: "上付き終了" # phrase(15 raised to the second 'power' equals 225)
- T: "上付き終了" # phrase(15 raised to the second 'power' equals 225)
- pause: short

#
Expand All @@ -277,22 +277,22 @@
then:
- test:
if: "$Verbosity!='Terse'"
then: [t: ""] # phrase('the' empty set)
- t: "空集合" # phrase(when a set contains no value it is called an 'empty set' and this is valid)
then: [T: ""] # phrase('the' empty set)
- T: "空集合" # phrase(when a set contains no value it is called an 'empty set' and this is valid)
- else_if: "count(*[1]/*)=3 and *[1]/*[2][self::m:mo][.=':' or .='|' or .='∣']"
then:
- test:
if: "$Verbosity!='Terse'"
then: [t: ""] # phrase('the' set of all integers)
then: [T: ""] # phrase('the' set of all integers)
- T: "集合 すべての" # phrase(the 'set of all' positive integers less than 10)
- x: "*[1]/*[1]"
- T: "ただし" # phrase(x 'such that' x is less than y)
- x: "*[1]/*[3]"
else:
- test:
if: "$Verbosity!='Terse'"
then: [t: ""] # phrase('the' set of integers)
- t: "集合" # phrase(here is a 'set' of numbers)
then: [T: ""] # phrase('the' set of integers)
- T: "集合" # phrase(here is a 'set' of numbers)
- x: "*[1]"

- name: times
Expand Down Expand Up @@ -321,7 +321,7 @@
- " IsBracketed(., '(', ')') or IsBracketed(., '[', ']') or IsBracketed(., '|', '|')]" # followed by parens
- " )"
replace:
- t: "掛ける" # phrase(7 'times' 5 equals 35)
- T: "掛ける" # phrase(7 'times' 5 equals 35)

- name: no-say-parens
tag: mrow
Expand Down
Loading