diff --git a/Rules/Languages/ja/ClearSpeak_Rules.yaml b/Rules/Languages/ja/ClearSpeak_Rules.yaml index f8a5597d..e0bdb2b7 100644 --- a/Rules/Languages/ja/ClearSpeak_Rules.yaml +++ b/Rules/Languages/ja/ClearSpeak_Rules.yaml @@ -481,13 +481,13 @@ replace: - test: - if: "count(*)=0" - then: [t: "空のセット"] # phrase('the empty set') + then: [t: "空集合"] # phrase('the empty set') - 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) - - t: "セット" # phrase(this is a 'set of' numbers) + - t: "集合" # phrase(this is a 'set of' numbers) - test: if: "$ClearSpeak_Sets != 'woAll'" then: [t: "すべて"] # phrase(the set of 'all' integers) @@ -501,7 +501,7 @@ - test: if: "$Verbosity!='Terse'" then: [t: ""] # phrase('the' set of integers) - - t: "セット" # phrase(this is a 'set' of integers) + - t: "集合" # phrase(this is a 'set' of integers) - x: "*[1]" - # intervals are controlled by a ClearSpeak Preference -- parens/brackets don't have to match, so we avoid IsBracketed diff --git a/Rules/Languages/ja/SharedRules/general.yaml b/Rules/Languages/ja/SharedRules/general.yaml index cc771228..11a42fa9 100644 --- a/Rules/Languages/ja/SharedRules/general.yaml +++ b/Rules/Languages/ja/SharedRules/general.yaml @@ -17,15 +17,15 @@ - bookmark: "*[1]/@id" - test: - if: "*[1][.='ℂ']" - then: [t: "複雑な数字"] # phrase('complex numbers' consist of two parts) + then: [t: "複素数"] # phrase('complex numbers' consist of two parts) - else_if: "*[1][.='ℕ']" - then: [t: "自然な数字"] # phrase('natural numbers' are numbers from 1 to infinity) + then: [t: "自然数"] # phrase('natural numbers' are numbers from 1 to infinity) - else_if: "*[1][.='ℚ']" - then: [t: "合理的な番号"] # phrase('rational numbers' are the fraction of 2 integers) + then: [t: "有理数"] # phrase('rational numbers' are the fraction of 2 integers) - else_if: "*[1][.='ℝ']" then: [t: "実数"] # phrase('real numbers' can be both positive and negative) - else_if: "*[1][.='ℤ']" - then: [t: "インテガーズ"] # phrase(positive 'integers' are natural numbers above 0) + then: [t: "整数"] # phrase(positive 'integers' are natural numbers above 0) else: [x: "*[1][text()]"] # shouldn't happen - name: dimension-number-sets @@ -57,15 +57,15 @@ - bookmark: "@id" - test: - if: ".='ℂ'" - then: [t: "複雑な数字"] # phrase('the complex numbers' include 2 parts) + then: [t: "複素数"] # phrase('the complex numbers' include 2 parts) - else_if: ".='ℕ'" - then: [t: "自然な数字"] # phrase('the natural numbers' begin at 1) + then: [t: "自然数"] # phrase('the natural numbers' begin at 1) - else_if: ".='ℚ'" - then: [t: "合理的な数字"] # phrase('the rational numbers' are the fraction of 2 integers) + then: [t: "有理数"] # phrase('the rational numbers' are the fraction of 2 integers) - else_if: ".='ℝ'" then: [t: "実数"] # phrase('the real numbers' can be both positive and negative) - else_if: ".='ℤ'" - then: [t: "整数者"] # phrase('the integers' are natural numbers above 0) + then: [t: "整数"] # phrase('the integers' are natural numbers above 0) else: [x: "text()"] # shouldn't happen - name: real-part @@ -573,11 +573,11 @@ match: "count(*)=1 and *[self::m:mtr][count(*) = 1]" replace: - ot: "" # phrase('the' 1 by 1 matrix M) - - t: "1 によって 1" # phrase(the '1 by 1' matrix) + - 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') + else: [t: "行列"] # phrase(the 2 by 2 'matrix') - t: "エントリー" # phrase(the 2 by 2 matrix 'with entry' x) - x: "*[1]/*" @@ -590,9 +590,9 @@ replace: - t: "" # phrase('the' 1 by 2 matrix M) - 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') + - t: "零行列" # phrase(the 2 by 2 'zero matrix') - pause: long - name: identity-matrix @@ -605,9 +605,9 @@ replace: - t: "" # phrase('the' 1 by 2 matrix M) - 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') + - t: "単位行列" # phrase(the 2 by 2 'identity matrix') - pause: long - name: diagonal-matrix @@ -622,9 +622,9 @@ replace: - t: "" # phrase('the' 1 by 2 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') + - 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 @@ -650,7 +650,7 @@ - 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') + else: [t: "行列"] # phrase(the 2 by 2 'matrix') - pause: long - x: "*/*" - test: @@ -660,7 +660,7 @@ - test: if: $ClearSpeak_Matrix = 'EndVector' then: [t: "コンテンツ"] # phrase(the 2 column 'vector') - else: [t: "マトリクス"] # phrase(the 2 by 2 'matrix') + else: [t: "行列"] # phrase(the 2 by 2 'matrix') - name: default-column-matrix tag: matrix @@ -673,12 +673,12 @@ - test: if: "$ClearSpeak_Matrix = 'Vector' or $ClearSpeak_Matrix = 'EndVector'" then: [t: "コンテンツ"] # phrase(the 2 column 'vector') - else: [t: "マトリクス"] # phrase(the 2 by 2 'matrix') + else: [t: "行列"] # phrase(the 2 by 2 'matrix') - pause: long - x: "*" # select the rows (mtr) - test: if: "$ClearSpeak_Matrix = 'EndMatrix' or $ClearSpeak_Matrix = 'EndVector'" - then: [t: "端のマトリックス"] # phrase(the 'end of matrix' has been reached) + then: [t: "行列終了"] # phrase(the 'end of matrix' has been reached) - name: 1x2-or-3-matrix tag: matrix @@ -689,13 +689,13 @@ - 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) + - 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: "コンテンツ"] # phrase('the 1 by' 2 row 'vector') - else: [t: "マトリクス"] # phrase('the 1 by' 2 'matrix') + else: [t: "行列"] # phrase('the 1 by' 2 'matrix') - pause: long - x: "*/*" - test: @@ -704,7 +704,7 @@ - t: "リリース" # phrase(the 'end' of matrix has been reached) - test: if: $ClearSpeak_Matrix = 'EndMatrix' - then: [t: "マトリクス"] # phrase(the 2 by 2 'matrix') + then: [t: "行列"] # phrase(the 2 by 2 'matrix') else: [t: "コンテンツ"] # phrase(the 2 by 1 'vector') - name: default-row-matrix @@ -712,13 +712,13 @@ variables: [IsColumnSilent: "$SpeechStyle = 'ClearSpeak' and $ClearSpeak_Matrix = 'SilentColNum'"] match: "count(*)=1" # one row replace: - - t: "1 によって" # phrase('the 1 by' 2 matrix) + - 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') + else: [t: "行列"] # phrase(the 2 by 2 'matrix') - pause: long - pause: medium - x: "*/*" # select the cols (mtd) @@ -728,7 +728,7 @@ - t: "リリース" # phrase(the 'end' of matrix has been reached) - test: if: $ClearSpeak_Matrix = 'EndMatrix' - then: [t: "マトリクス"] # phrase(the 2 by 2 'matrix') + then: [t: "行列"] # phrase(the 2 by 2 'matrix') else: [t: "コンテンツ"] # phrase(the 2 by 1 'vector') - name: simple-small-matrix @@ -741,7 +741,7 @@ replace: - t: "" # phrase('the' 1 by 2 matrix M) - x: count(*) - - t: "によって" # phrase(the 1 'by' 2 matrix) + - t: "かける" # phrase(the 1 'by' 2 matrix) - x: count(*[self::m:mtr][1]/*) - test: if: "self::m:determinant" @@ -749,8 +749,8 @@ else: - test: if: "@columnlines and (contains(normalize-space(@columnlines), 'solid') or contains(normalize-space(@columnlines), 'dashed'))" - then: [t: "拡張されたマトリックス"] # phrase(the 2 by 2 'augmented matrix') - else: [t: "マトリクス"] # phrase(the 2 by 2 'matrix') + then: [t: "拡大行列"] # phrase(the 2 by 2 'augmented matrix') + else: [t: "行列"] # phrase(the 2 by 2 'matrix') - pause: long - x: "*" - test: @@ -760,7 +760,7 @@ - test: if: "self::m:determinant" then: [t: "行列式"] # phrase(the 2 by 2 'determinant') - else: [t: "マトリクス"] # phrase(the 2 by 2 'matrix') + else: [t: "行列"] # phrase(the 2 by 2 'matrix') - name: default-matrix tag: [matrix, determinant] @@ -769,7 +769,7 @@ replace: - t: "" # phrase('the' 1 by 2 matrix M) - x: "count(*)" - - t: "によって" # phrase(the 1 'by' 2 matrix) + - t: "かける" # phrase(the 1 'by' 2 matrix) - x: "count(*[self::m:mtr][1]/*)" - test: if: "self::m:determinant" @@ -777,8 +777,8 @@ else: - test: if: "@columnlines and (contains(normalize-space(@columnlines), 'solid') or contains(normalize-space(@columnlines), 'dashed'))" - then: [t: "拡張されたマトリックス"] # phrase(the 2 by 2 'augmented matrix') - else: [t: "マトリクス"] # phrase(the 2 by 2 'matrix') + then: [t: "拡大行列"] # phrase(the 2 by 2 'augmented matrix') + else: [t: "行列"] # phrase(the 2 by 2 'matrix') - pause: long - x: "*" - test: @@ -788,7 +788,7 @@ - test: if: "self::m:determinant" then: [t: "行列式"] # phrase(the 2 by 2 'determinant') - else: [t: "マトリクス"] # phrase(the 2 by 2 'matrix's) + else: [t: "行列"] # phrase(the 2 by 2 'matrix's) - name: chemistry-msub tag: [chemical-formula] @@ -809,7 +809,7 @@ replace: - insert: nodes: "*" - replace: [t: "によって", pause: auto] # phrase(3 'by' 5 matrix) + replace: [t: "かける", pause: auto] # phrase(3 'by' 5 matrix) - name: chemistry-msup tag: [chemical-formula] diff --git a/Rules/Languages/ja/SimpleSpeak_Rules.yaml b/Rules/Languages/ja/SimpleSpeak_Rules.yaml index 6b424b43..443f4ae1 100644 --- a/Rules/Languages/ja/SimpleSpeak_Rules.yaml +++ b/Rules/Languages/ja/SimpleSpeak_Rules.yaml @@ -278,13 +278,13 @@ - 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) + - 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) - - t: "すべてのセット" # phrase(the 'set of all' positive integers less than 10) + - 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]" @@ -292,7 +292,7 @@ - test: if: "$Verbosity!='Terse'" then: [t: ""] # phrase('the' set of integers) - - t: "セット" # phrase(here is a 'set' of numbers) + - t: "集合" # phrase(here is a 'set' of numbers) - x: "*[1]" - name: times diff --git a/Rules/Languages/ja/definitions.yaml b/Rules/Languages/ja/definitions.yaml index 1299e065..e5bb90c8 100644 --- a/Rules/Languages/ja/definitions.yaml +++ b/Rules/Languages/ja/definitions.yaml @@ -113,17 +113,17 @@ # "derivative":"function=the derivative; with respect to", # Property ??? # "partial-derivative":"function=partial", ## Note, included with infix, but separately under calculus tab has ??? for functionality - "limit": "prefix=限界として:限界として", - "tends-to":"infix=傾向がある", - "tends-to-from-above":"infix=上記から", - "tends-to-from-below":"infix=以下に傾向がある", + "limit": "prefix=極限:極限", + "tends-to":"infix=に近づく", + "tends-to-from-above":"infix=上から近づく", + "tends-to-from-below":"infix=下から近づく", ### Sets - "set": "function=; セット: セット", - "set-difference":"function=セットの違い | と || infix=マイナス", + "set": "function=; 集合: 集合", + "set-difference":"function=差集合 | と || infix=マイナス", "complement":"function=補集合", - "empty-set":"nofix=空のセット", + "empty-set":"nofix=空集合", "cardinality":"function=濃度", # NOTE: does not have a defined speech template in website "list":"function=リスト", "tuple": "function=;タプル:タプル", @@ -173,30 +173,30 @@ "standard-deviation":"function=標準偏差", "variance":"function=分散", "median":"function=中央値", - "mode":"function=モード", + "mode":"function=最頻値", "conditional-probability":"function=確率 | 与えられた", ### Linear Algebra "vector": "function=; ベクトル || prefix=ベクトル", # prefix not tested, also prefix not on webpage - "matrix":"function=マトリクス", # NOTE: Failing test, recheck + "matrix":"function=行列", # NOTE: Failing test, recheck "determinant":"function=行列式", - "adjugate":"function=アドフゲート", + "adjugate":"function=余因子行列", "magnitude":"function=大きさ", - "norm": "function=;規範:規範:規範;エンド規範", + "norm": "function=;ノルム:ノルム:ノルム;ノルム閉じ", "span":"function=線形包", "unit-vector":"prefix=単位ベクトル", - "identity-matrix":"nofix=アイデンティティ マトリックス", # NOTE: no function specified - "transpose":"postfix=トランスポーズ || function=トランスポーズ", - "dimensional-product":"infix=によって", # INFIX + "identity-matrix":"nofix=単位行列", # NOTE: no function specified + "transpose":"postfix=転置 || function=転置", + "dimensional-product":"infix=かける", # INFIX ### Constants and Sets - "set-of-integers":"nofix=ゼット:すべての整数のセット", - "set-of-reals":"nofix=アール: すべての実数のセット", + "set-of-integers":"nofix=ゼット:すべての整数の集合", + "set-of-reals":"nofix=アール: すべての実数の集合", "set-of-rationals":"nofix=キュー:すべての有理数の集合", "set-of-natural-numbers":"nofix=エヌ:すべての自然数の集合", "set-of-complex-numbers":"nofix=シー:すべての複素数の集合", @@ -226,14 +226,14 @@ "indexed-by": "infix=; サブ; 末尾サブ: 末尾サブスクリプト", "highlight":"postfix=ハイライト", - "least-common-denominator":"function=最低の共通のデノミネーター", + "least-common-denominator":"function=最小公分母", "rate":"infix=あたり", - "translation":"function=翻訳:", + "translation":"function=平行移動", "constraint":"infix=;制約を使って;", "binomial-coefficient":"infix=選ぶ", - "pochhammer":"function=パーミュテーション", - "permutation-cycle":"function=パーマテーションサイクル", + "pochhammer":"function=順列", + "permutation-cycle":"function=巡回置換", "embellished-name":"infix=アノテーション", ### Grouping @@ -261,7 +261,7 @@ "right-angle": "prefix=直角", "square-root-of": "prefix=平方根の", "there-does-not-exist": "prefix=存在しない", - "there-exists": "prefix=そこに存在する", + "there-exists": "prefix=存在する", ## Default fixity infix @@ -270,26 +270,26 @@ "approximately": "infix=およそ", "congruent": "infix=合同", "cartesian-product": "infix=デカルト積", - "composed-with": "infix=構成されると", + "composed-with": "infix=合成", "cross-product": "infix=クロス:外積:外積", "defined-as": "infix=定義する", "divided-by": "infix=割る", - "divides": "infix=分割する", - "does-not-belong-to": "infix=所属しない", - "does-not-divide": "infix=分割しない", + "divides": "infix=割り切る", + "does-not-belong-to": "infix=属さない", + "does-not-divide": "infix=割り切れない", "dot-product": "infix=内積", - "downwards-diagonal-ellipsis": "infix=下方対角形エリプシ", + "downwards-diagonal-ellipsis": "infix=下向き対角の省略記号", "direct-product": "infix=直積", "element-of": "infix=の要素", - "ellipsis": "infix=エリプシス", + "ellipsis": "infix=省略記号", "equals": "infix=イコール", "equivalent-to": "infix=と同等の", "evaluates-to": "infix=評価する", "given": "infix=与えられた", "greater-than": "infix=より大きい", - "greater-than-or-equal-to": "infix=より大きいか等しいへの", - "identically-equals": "infix=同一の等しい", - "if-and-only-if": "infix=もしもあれば", + "greater-than-or-equal-to": "infix=より大きいか等しい", + "identically-equals": "infix=恒等的に等しい", + "if-and-only-if": "infix=同値", "implies": "infix=ならば", "inner-product": "infix=内積", "intersection": "infix=共通部分", @@ -299,16 +299,16 @@ "maps-to": "infix=に写る", "member-of": "infix=に属する", "minus-or-plus": "infix=マイナスまたはプラス", - "not-subset": "infix=サブセットではなく", - "not-superset": "infix=スーパーセットではない", + "not-subset": "infix=部分集合でない", + "not-superset": "infix=上位集合でない", "not-equal-to": "infix=等しくない", "not-member-of": "infix=に属さない", - "not-parallel-to": "infix=並行しない", + "not-parallel-to": "infix=平行でない", "obtained-from": "infix=から得られる", "or": "infix=または", "outer-product": "infix=外積", - "parallel-to": "infix=平行へ", - "perpendicular": "infix=垂直へ", + "parallel-to": "infix=平行", + "perpendicular": "infix=垂直", "plus": "infix=プラス || prefix=プラス", # Prefix not tested "minus": "infix=マイナス || prefix=マイナス", # Prefix not tested "plus-or-minus": "infix=プラスまたはマイナス", @@ -316,22 +316,22 @@ "proportional": "infix=比例する", "range-separator": "infix=から", "ratio": "infix=比率", - "similar": "infix=と同様", - "subset": "infix=サブセット", - "subset-or-equal": "infix=サブセットまたは等しい", + "similar": "infix=相似", + "subset": "infix=部分集合", + "subset-or-equal": "infix=部分集合または等しい", "succeeds": "infix=に後続する", "such-that": "infix=そのようなこと", - "superset": "infix=スーパーセット", - "superset-or-equal": "infix=スーパーセットまたは等しく", - "tilde": "infix=チルド", + "superset": "infix=上位集合", + "superset-or-equal": "infix=上位集合または等しい", + "tilde": "infix=チルダ", "times": "infix=掛ける", "union": "infix=和集合", - "upwards-diagonal-ellipsis": "infix=対角のエリプシ", - "vertical-ellipsis": "infix=縦の 省略記号", + "upwards-diagonal-ellipsis": "infix=上向き対角の省略記号", + "vertical-ellipsis": "infix=縦の省略記号", "xor": "infix=排他的または", ## Default fixity postfix - "factorial": "postfix=ファクシャル", + "factorial": "postfix=階乗", "percent": "postfix=パーセント", ## Default fixity nofix diff --git a/Rules/Languages/ja/overview.yaml b/Rules/Languages/ja/overview.yaml index 3cfc3ece..58d3a23e 100644 --- a/Rules/Languages/ja/overview.yaml +++ b/Rules/Languages/ja/overview.yaml @@ -71,12 +71,12 @@ replace: - t: "" - x: count(*[2]/*) - - t: "によって" + - t: "かける" - x: count(*[2]/*[self::m:mtr][1]/*) - test: if: "*[1][.='|']" # just need to check the first bracket since we know it must be (, [, or | then: [t: "行列式"] - else: [t: "マトリクス"] + else: [t: "行列"] - name: overview-default tag: mtable @@ -84,7 +84,7 @@ replace: - t: "" - x: count(*[2]/*) - - t: "によって" + - t: "かける" - x: count(*[2]/*[self::m:mtr][1]/*) - t: "テーブル" diff --git a/Rules/Languages/ja/unicode.yaml b/Rules/Languages/ja/unicode.yaml index a5cd4ef9..26e30842 100644 --- a/Rules/Languages/ja/unicode.yaml +++ b/Rules/Languages/ja/unicode.yaml @@ -502,32 +502,32 @@ - test: if: "$Verbosity!='Terse'" then: [t: "は"] - - t: "サブセット" + - t: "部分集合" - "⊃": # 0x2283 - test: if: "$Verbosity!='Terse'" then: [t: "は"] - - t: "スーパーセット" + - t: "上位集合" - "⊄": # 0x2284 - test: if: "$Verbosity!='Terse'" then: [t: "は"] - - t: "サブセットではなく" + - t: "部分集合でない" - "⊅": # 0x2285 - test: if: "$Verbosity!='Terse'" then: [t: "は"] - - t: "スーパーセットではない" + - t: "上位集合でない" - "⊆": # 0x2286 - test: if: "$Verbosity!='Terse'" then: [t: "は"] - - t: "または等しいのサブセット" + - t: "部分集合または等しい" - "⊇": # 0x2287 - test: if: "$Verbosity!='Terse'" then: [t: "は"] - - t: "スーパーセットまたは等しく" + - t: "上位集合または等しい" # --- restored short definitions that differ from unicode-full --- - "⇒": [t: "右ダブル矢印"] # 0x21d2 diff --git a/tests/Languages/ja/ja.rs b/tests/Languages/ja/ja.rs index b56ebcbb..a6b27c18 100644 --- a/tests/Languages/ja/ja.rs +++ b/tests/Languages/ja/ja.rs @@ -293,3 +293,90 @@ fn definite_integral() -> Result<()> { test("ja", "SimpleSpeak", expr, "積分 0 から, 1 まで オブ; x 微分 d x")?; return Ok(()); } + +/// Set-theory names. セット/空のセット are the loanword for a set of objects; the +/// mathematical term is 集合. +#[test] +fn set_terminology() -> Result<()> { + let expr = "xy"; + test("ja", "ClearSpeak", expr, "集合 の x コンマ, y")?; + return Ok(()); +} + +/// 規範 is a social norm; the norm of a vector is ノルム. +#[test] +fn norm_terminology() -> Result<()> { + let expr = "x"; + test("ja", "ClearSpeak", expr, "ノルム の x")?; + return Ok(()); +} + +/// 限界 is a bound or a ceiling and 傾向がある is "has a tendency"; neither is how +/// x → a is read. The mathematical terms are 極限 and に近づく. +#[test] +fn limit_terminology() -> Result<()> { + let expr = "xy"; + test("ja", "ClearSpeak", expr, "x に近づく y")?; + return Ok(()); +} + +/// モード is the loanword; the statistical term is 最頻値. +#[test] +fn statistics_mode() -> Result<()> { + let expr = "x"; + test("ja", "ClearSpeak", expr, "最頻値 の x")?; + return Ok(()); +} + +/// A matrix is 行列, not the loanword マトリクス, and the dimension separator is +/// かける, not によって ("by means of"). +#[test] +fn matrix_terminology() -> Result<()> { + let expr = "[12]"; + test("ja", "ClearSpeak", expr, "1 かける 2 行 行列; 1, 2")?; + return Ok(()); +} + +/// Every number set, not just ℝ, has a settled Japanese name. ℝ was the only one +/// with a test, which is how 合理的な数字 ("reasonable numbers") and 整数者 +/// ("integer person") survived in the other branches of the same rule. +#[test] +fn number_set_names() -> Result<()> { + for (letter, expected) in [ + ("C", "x は 属する 複素数"), + ("N", "x は 属する 自然数"), + ("Q", "x は 属する 有理数"), + ("R", "x は 属する 実数"), + ("Z", "x は 属する 整数"), + ] { + let expr = format!( + "x{letter}" + ); + test("ja", "SimpleSpeak", &expr, expected)?; + } + return Ok(()); +} + +/// In geometry a translation is 平行移動. 翻訳 is translation between languages. +#[test] +fn geometry_translation() -> Result<()> { + let expr = "x"; + test("ja", "ClearSpeak", expr, "平行移動 の x")?; + return Ok(()); +} + +/// 分割する is to split something into parts; divisibility is 割り切る. Similar +/// figures are 相似, not と同様 ("the same as"). +#[test] +fn divides_and_similar() -> Result<()> { + for (intent, expected) in [ + ("divides", "x 割り切る y"), + ("similar", "x 相似 y"), + ] { + let expr = format!( + "xy" + ); + test("ja", "ClearSpeak", &expr, expected)?; + } + return Ok(()); +}