From a8bad9a5532f688d8a96127fd8abd3959903011b Mon Sep 17 00:00:00 2001 From: yasumorishima Date: Sun, 30 Aug 2026 07:16:37 +0900 Subject: [PATCH 1/8] ja: use the Japanese mathematical terms in definitions.yaml --- Rules/Languages/ja/definitions.yaml | 28 +++++++------- tests/Languages/ja/ja.rs | 59 +++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+), 14 deletions(-) diff --git a/Rules/Languages/ja/definitions.yaml b/Rules/Languages/ja/definitions.yaml index 1299e065..ae5b467d 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,25 +173,25 @@ "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 diff --git a/tests/Languages/ja/ja.rs b/tests/Languages/ja/ja.rs index b56ebcbb..9c1f4698 100644 --- a/tests/Languages/ja/ja.rs +++ b/tests/Languages/ja/ja.rs @@ -293,3 +293,62 @@ 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, not the +/// mathematical term, which is 集合. +#[test] +fn set_terminology() -> Result<()> { + for (intent, expected) in [ + ("set", "集合 x y"), + ("set-difference", "差集合 x と y"), + ("complement", "補集合 x y"), + ] { + let expr = format!( + "xy" + ); + test("ja", "ClearSpeak", &expr, expected)?; + } + return Ok(()); +} + +/// Linear algebra names. マトリクス and トランスポーズ are transliterations; the +/// mathematical terms are 行列 and 転置. アドフゲート was not a word at all. +#[test] +fn linear_algebra_terminology() -> Result<()> { + for (intent, expected) in [ + ("determinant", "行列式 x y"), + ("adjugate", "余因子行列 x y"), + ("transpose", "転置 x y"), + ] { + let expr = format!( + "xy" + ); + test("ja", "ClearSpeak", &expr, expected)?; + } + 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; the limit of a function is 極限. 傾向がある +/// ("has a tendency") is not how x → a is read either. +#[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(()); +} From d198966bc76b7a18d8953dcfd1c2dd038e7e1cda Mon Sep 17 00:00:00 2001 From: yasumorishima Date: Sun, 30 Aug 2026 07:31:18 +0900 Subject: [PATCH 2/8] =?UTF-8?q?ja:=20use=20=E8=A1=8C=E5=88=97=20and=20?= =?UTF-8?q?=E3=81=8B=E3=81=91=E3=82=8B=20for=20matrices=20everywhere?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Rules/Languages/ja/SharedRules/general.yaml | 54 ++++++++++----------- Rules/Languages/ja/overview.yaml | 6 +-- tests/Languages/ja/ja.rs | 52 +++++++------------- 3 files changed, 48 insertions(+), 64 deletions(-) diff --git a/Rules/Languages/ja/SharedRules/general.yaml b/Rules/Languages/ja/SharedRules/general.yaml index cc771228..29756df4 100644 --- a/Rules/Languages/ja/SharedRules/general.yaml +++ b/Rules/Languages/ja/SharedRules/general.yaml @@ -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/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/tests/Languages/ja/ja.rs b/tests/Languages/ja/ja.rs index 9c1f4698..fef7a0d5 100644 --- a/tests/Languages/ja/ja.rs +++ b/tests/Languages/ja/ja.rs @@ -294,37 +294,12 @@ fn definite_integral() -> Result<()> { return Ok(()); } -/// Set-theory names. セット/空のセット are the loanword for a set of objects, not the -/// mathematical term, which is 集合. +/// Set-theory names. セット/空のセット are the loanword for a set of objects; the +/// mathematical term is 集合. #[test] fn set_terminology() -> Result<()> { - for (intent, expected) in [ - ("set", "集合 x y"), - ("set-difference", "差集合 x と y"), - ("complement", "補集合 x y"), - ] { - let expr = format!( - "xy" - ); - test("ja", "ClearSpeak", &expr, expected)?; - } - return Ok(()); -} - -/// Linear algebra names. マトリクス and トランスポーズ are transliterations; the -/// mathematical terms are 行列 and 転置. アドフゲート was not a word at all. -#[test] -fn linear_algebra_terminology() -> Result<()> { - for (intent, expected) in [ - ("determinant", "行列式 x y"), - ("adjugate", "余因子行列 x y"), - ("transpose", "転置 x y"), - ] { - let expr = format!( - "xy" - ); - test("ja", "ClearSpeak", &expr, expected)?; - } + let expr = "xy"; + test("ja", "ClearSpeak", expr, "集合 の x コンマ, y")?; return Ok(()); } @@ -332,16 +307,16 @@ fn linear_algebra_terminology() -> Result<()> { #[test] fn norm_terminology() -> Result<()> { let expr = "x"; - test("ja", "ClearSpeak", &expr, "ノルム x ノルム閉じ")?; + test("ja", "ClearSpeak", expr, "ノルム の x")?; return Ok(()); } -/// 限界 is a bound or a ceiling; the limit of a function is 極限. 傾向がある -/// ("has a tendency") is not how x → a is read either. +/// 限界 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")?; + test("ja", "ClearSpeak", expr, "x に近づく y")?; return Ok(()); } @@ -349,6 +324,15 @@ fn limit_terminology() -> Result<()> { #[test] fn statistics_mode() -> Result<()> { let expr = "x"; - test("ja", "ClearSpeak", &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(()); } From 252dd9578042fcbab3f41415c14ec422df9c1643 Mon Sep 17 00:00:00 2001 From: yasumorishima Date: Sun, 30 Aug 2026 07:40:32 +0900 Subject: [PATCH 3/8] ja: match the matrix test to the actual output --- tests/Languages/ja/ja.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Languages/ja/ja.rs b/tests/Languages/ja/ja.rs index fef7a0d5..e2947db2 100644 --- a/tests/Languages/ja/ja.rs +++ b/tests/Languages/ja/ja.rs @@ -333,6 +333,6 @@ fn statistics_mode() -> Result<()> { #[test] fn matrix_terminology() -> Result<()> { let expr = "[12]"; - test("ja", "ClearSpeak", expr, "1 かける 2 行列; 1, 2")?; + test("ja", "ClearSpeak", expr, "1 かける 2 行 行列; 1, 2")?; return Ok(()); } From 311e86032cd6990f1a9745f2ee12386273dd3748 Mon Sep 17 00:00:00 2001 From: yasumorishima Date: Sun, 30 Aug 2026 07:56:36 +0900 Subject: [PATCH 4/8] =?UTF-8?q?ja:=20use=20=E9=9B=86=E5=90=88=20for=20sets?= =?UTF-8?q?=20and=20the=20standard=20names=20for=20the=20number=20sets?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Rules/Languages/ja/ClearSpeak_Rules.yaml | 6 +++--- Rules/Languages/ja/SharedRules/general.yaml | 12 ++++++------ Rules/Languages/ja/SimpleSpeak_Rules.yaml | 6 +++--- Rules/Languages/ja/definitions.yaml | 16 ++++++++-------- Rules/Languages/ja/unicode.yaml | 12 ++++++------ 5 files changed, 26 insertions(+), 26 deletions(-) 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 29756df4..57e7845a 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,9 +57,9 @@ - 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) - else_if: ".='ℝ'" 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 ae5b467d..4c0b65bc 100644 --- a/Rules/Languages/ja/definitions.yaml +++ b/Rules/Languages/ja/definitions.yaml @@ -195,8 +195,8 @@ ### 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=シー:すべての複素数の集合", @@ -299,8 +299,8 @@ "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=並行しない", @@ -317,12 +317,12 @@ "range-separator": "infix=から", "ratio": "infix=比率", "similar": "infix=と同様", - "subset": "infix=サブセット", - "subset-or-equal": "infix=サブセットまたは等しい", + "subset": "infix=部分集合", + "subset-or-equal": "infix=部分集合または等しい", "succeeds": "infix=に後続する", "such-that": "infix=そのようなこと", - "superset": "infix=スーパーセット", - "superset-or-equal": "infix=スーパーセットまたは等しく", + "superset": "infix=上位集合", + "superset-or-equal": "infix=上位集合または等しい", "tilde": "infix=チルド", "times": "infix=掛ける", "union": "infix=和集合", 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 From 8502cc98fa95b4111d20ab325d778bcf97995017 Mon Sep 17 00:00:00 2001 From: yasumorishima Date: Sun, 30 Aug 2026 14:29:50 +0900 Subject: [PATCH 5/8] ja: finish the number-set sweep (rational, integers) and test all five --- Rules/Languages/ja/SharedRules/general.yaml | 4 ++-- tests/Languages/ja/ja.rs | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/Rules/Languages/ja/SharedRules/general.yaml b/Rules/Languages/ja/SharedRules/general.yaml index 57e7845a..11a42fa9 100644 --- a/Rules/Languages/ja/SharedRules/general.yaml +++ b/Rules/Languages/ja/SharedRules/general.yaml @@ -61,11 +61,11 @@ - else_if: ".='ℕ'" 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 diff --git a/tests/Languages/ja/ja.rs b/tests/Languages/ja/ja.rs index e2947db2..79ab30f3 100644 --- a/tests/Languages/ja/ja.rs +++ b/tests/Languages/ja/ja.rs @@ -336,3 +336,23 @@ fn matrix_terminology() -> Result<()> { 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(()); +} From 7a619b2fe469eed0fa485933b99c8b7b396fb3e7 Mon Sep 17 00:00:00 2001 From: yasumorishima Date: Sun, 30 Aug 2026 18:59:40 +0900 Subject: [PATCH 6/8] =?UTF-8?q?ja:=20a=20tilde=20is=20=E3=83=81=E3=83=AB?= =?UTF-8?q?=E3=83=80=20(=E3=83=81=E3=83=AB=E3=83=89=20is=20the=20loanword?= =?UTF-8?q?=20for=20chilled)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Rules/Languages/ja/definitions.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Rules/Languages/ja/definitions.yaml b/Rules/Languages/ja/definitions.yaml index 4c0b65bc..8c98eb99 100644 --- a/Rules/Languages/ja/definitions.yaml +++ b/Rules/Languages/ja/definitions.yaml @@ -323,7 +323,7 @@ "such-that": "infix=そのようなこと", "superset": "infix=上位集合", "superset-or-equal": "infix=上位集合または等しい", - "tilde": "infix=チルド", + "tilde": "infix=チルダ", "times": "infix=掛ける", "union": "infix=和集合", "upwards-diagonal-ellipsis": "infix=対角のエリプシ", From b5b04593f55cbc449839cc2699ff89aeb2f3772e Mon Sep 17 00:00:00 2001 From: yasumorishima Date: Sun, 30 Aug 2026 20:14:04 +0900 Subject: [PATCH 7/8] ja: name the relations, the ellipses and the geometric translation --- Rules/Languages/ja/definitions.yaml | 40 ++++++++++++++--------------- tests/Languages/ja/ja.rs | 24 +++++++++++++++++ 2 files changed, 44 insertions(+), 20 deletions(-) diff --git a/Rules/Languages/ja/definitions.yaml b/Rules/Languages/ja/definitions.yaml index 8c98eb99..b18067f3 100644 --- a/Rules/Languages/ja/definitions.yaml +++ b/Rules/Languages/ja/definitions.yaml @@ -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=分割する", + "divides": "infix=割り切る", "does-not-belong-to": "infix=所属しない", - "does-not-divide": "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=共通部分", @@ -303,12 +303,12 @@ "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,7 +316,7 @@ "proportional": "infix=比例する", "range-separator": "infix=から", "ratio": "infix=比率", - "similar": "infix=と同様", + "similar": "infix=相似", "subset": "infix=部分集合", "subset-or-equal": "infix=部分集合または等しい", "succeeds": "infix=に後続する", @@ -326,12 +326,12 @@ "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/tests/Languages/ja/ja.rs b/tests/Languages/ja/ja.rs index 79ab30f3..a6b27c18 100644 --- a/tests/Languages/ja/ja.rs +++ b/tests/Languages/ja/ja.rs @@ -356,3 +356,27 @@ fn number_set_names() -> Result<()> { } 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(()); +} From 3ee8696d6b8a05763e897b51472a8197027fbb89 Mon Sep 17 00:00:00 2001 From: yasumorishima Date: Sun, 30 Aug 2026 21:38:57 +0900 Subject: [PATCH 8/8] =?UTF-8?q?ja:=20set=20membership=20is=20=E5=B1=9E?= =?UTF-8?q?=E3=81=95=E3=81=AA=E3=81=84,=20not=20=E6=89=80=E5=B1=9E?= =?UTF-8?q?=E3=81=97=E3=81=AA=E3=81=84=20(belonging=20to=20an=20organisati?= =?UTF-8?q?on)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Rules/Languages/ja/definitions.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Rules/Languages/ja/definitions.yaml b/Rules/Languages/ja/definitions.yaml index b18067f3..e5bb90c8 100644 --- a/Rules/Languages/ja/definitions.yaml +++ b/Rules/Languages/ja/definitions.yaml @@ -275,7 +275,7 @@ "defined-as": "infix=定義する", "divided-by": "infix=割る", "divides": "infix=割り切る", - "does-not-belong-to": "infix=所属しない", + "does-not-belong-to": "infix=属さない", "does-not-divide": "infix=割り切れない", "dot-product": "infix=内積", "downwards-diagonal-ellipsis": "infix=下向き対角の省略記号",