From 111e779711a2c6cf60e11b13c87012f9100cc48f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yasunori=20Morishima=EF=BC=88=E7=9B=9B=E5=B3=B6=E5=BA=B7?= =?UTF-8?q?=E5=BE=B3=EF=BC=89?= Date: Sat, 5 Sep 2026 16:32:45 +0900 Subject: [PATCH 1/6] ja: use the source's readings for the comparison and element-of symbols MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `unicode.yaml` puts the relation word between the two operands, so the word has to work there. Several did not. - `>` said より大きい. より needs its comparand in front of it, so "x は より大きい 5" parses as "x is a bigger 5". It also did not match the 小なり already used for `<` in the same file. Yamaguchi, Kawane & Sawazaki (1996) give the pair 小なり / 大なり, and 小なり・オア・イコール for `≤` (the ・ is only a word separator and is not read), so `≥` follows as 大なり・オア・イコール. - `≠` said 等しくない, a predicate with the same problem. The source gives ノット・イコール, which pairs with the イコール already used for `=`. - `∈` and `∊` said 要素の for "element of". の attaches backwards: 要素の A is "A of an element". The source gives 要素オブ, the same borrowed オブ this translation already uses for "of" elsewhere. The two rules also disagreed with each other -- ∈ said 属する where ∊ said 要素の, for the same English. - The ClearSpeak "In" option said 中へ, which is "into", a direction of motion. The source's reading for "in" is the borrowed イン. - `∾` said 最も肯定的な, "most affirmative"; en is "most positive" in the numeric sense, so 最も正の. Left alone: the negative set relations (∉ ⊄ ⊅) and the subset family (⊂ ⊃ ⊆ ⊇). The source gives 部分集合オブ for ⊂ but nothing for the superset or the negated forms, and I did not want to change half a family. --- Rules/Languages/ja/unicode.yaml | 28 ++++++++++++------------- tests/Languages/ja/ja.rs | 37 +++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 14 deletions(-) diff --git a/Rules/Languages/ja/unicode.yaml b/Rules/Languages/ja/unicode.yaml index 88b08f23..a3b0cbd6 100644 --- a/Rules/Languages/ja/unicode.yaml +++ b/Rules/Languages/ja/unicode.yaml @@ -138,7 +138,7 @@ - test: if: "$Verbosity!='Terse'" then: [t: "は"] - - t: "小なり" + - T: "小なり" - "=": # 0x3d - test: if: "$Verbosity!='Terse'" @@ -149,7 +149,7 @@ - test: if: "$Verbosity!='Terse'" then: [t: "は"] - - t: "より大きい" + - T: "大なり" - "?": [t: "疑問符"] # 0x3f - "@": [t: "アットマーク"] # 0x40 - "[": # 0x5b @@ -345,23 +345,23 @@ - test: if: "$Verbosity!='Terse' and not(ancestor::*[self::m:set])" # "the set x is an element of ..." sounds bad" then: [t: "は"] - - t: "属する" + - T: "要素オブ" # Several options for speaking elements in ClearSpeak -- they split between being inside a set or not and then the option else_test: if: "../../self::m:set or ../../../self::m:set" # inside a set then_test: - if: $ClearSpeak_SetMemberSymbol = 'Auto' or $ClearSpeak_SetMemberSymbol = 'In' - then: [t: "中へ"] + then: [T: "イン"] - else_if: $ClearSpeak_SetMemberSymbol = 'Member' then: [t: "元"] - else_if: $ClearSpeak_SetMemberSymbol = 'Element' - then: [t: "要素の"] + then: [T: "要素オブ"] - else: [t: "に属する"] # $ClearSpeak_SetMemberSymbol = 'Belongs' else_test: - if: $ClearSpeak_SetMemberSymbol = 'Auto' or $ClearSpeak_SetMemberSymbol = 'Member' then: [t: "元"] - else_if: $ClearSpeak_SetMemberSymbol = 'Element' - then: [t: "要素"] + then: [T: "要素オブ"] - else_if: $ClearSpeak_SetMemberSymbol = 'In' then: [t: "に含まれる"] - else: [t: "属する"] # $ClearSpeak_SetMemberSymbol = 'Belongs' @@ -383,12 +383,12 @@ - test: if: "$Verbosity!='Terse'" then: [t: "は"] - - t: "より小さいか等しい" + - T: "小なり オア イコール" - "≥": # 0x2265 - test: if: "$Verbosity!='Terse'" then: [t: "は"] - - t: "より大きいか等しい" + - T: "大なり オア イコール" # --- restored complex short definitions (prefer over unicode-full) --- - "…": # 0x2026 @@ -448,23 +448,23 @@ - test: if: "$Verbosity!='Terse' and not(ancestor::*[self::m:set])" # "the set x is an element of ..." sounds bad" then: [t: "は"] - - t: "要素の" + - T: "要素オブ" # Several options for speaking elements in ClearSpeak -- they split between being inside a set or not and then the option else_test: if: "../../self::m:set or ../../../self::m:set" # inside a set then_test: - if: $ClearSpeak_SetMemberSymbol = 'Auto' or $ClearSpeak_SetMemberSymbol = 'In' - then: [t: "中へ"] + then: [T: "イン"] - else_if: $ClearSpeak_SetMemberSymbol = 'Member' then: [t: "元"] - else_if: $ClearSpeak_SetMemberSymbol = 'Element' - then: [t: "要素の"] + then: [T: "要素オブ"] - else: [t: "に属する"] # $ClearSpeak_SetMemberSymbol = 'Belongs' else_test: - if: $ClearSpeak_SetMemberSymbol = 'Auto' or $ClearSpeak_SetMemberSymbol = 'Member' then: [t: "元"] - else_if: $ClearSpeak_SetMemberSymbol = 'Element' - then: [t: "要素"] + then: [T: "要素オブ"] - else_if: $ClearSpeak_SetMemberSymbol = 'In' then: [t: "に含まれる"] - else: [t: "属する"] # $ClearSpeak_SetMemberSymbol = 'Belongs' @@ -487,12 +487,12 @@ - test: if: "$Verbosity!='Terse'" then: [t: "は"] - - t: "最も肯定的な" + - T: "最も正の" - "≠": # 0x2260 - test: if: "$Verbosity!='Terse'" then: [t: "は"] - - t: "等しくない" + - T: "ノット・イコール" - "≡": # 0x2261 - test: if: "$Verbosity!='Terse'" diff --git a/tests/Languages/ja/ja.rs b/tests/Languages/ja/ja.rs index 3fe944e2..66e0f58d 100644 --- a/tests/Languages/ja/ja.rs +++ b/tests/Languages/ja/ja.rs @@ -261,6 +261,43 @@ fn less_than() -> Result<()> { return Ok(()); } +/// 小なり / 大なり are the pair the source gives for < and >. より大きい strands the +/// より, which needs its comparand in front of it, so "x は より大きい 5" reads as +/// "x is a bigger 5"; and it did not match the 小なり already used for <. +#[test] +fn greater_than_and_or_equal() -> Result<()> { + for (op, expected) in [ + (">", "x は 大なり 5"), + ("≤", "x は 小なり オア イコール 5"), + ("≥", "x は 大なり オア イコール 5"), + ] { + let expr = format!("x{op}5"); + test("ja", "ClearSpeak", &expr, expected)?; + } + return Ok(()); +} + +/// ≠ is ノット・イコール, the partner of the イコール already used for =. +#[test] +fn not_equal() -> Result<()> { + let expr = "x5"; + test("ja", "ClearSpeak", expr, "x は ノット・イコール 5")?; + return Ok(()); +} + +/// ∈ is 要素オブ. 要素の attaches backwards -- 要素の A is "A of an element" -- and +/// the rules for ∈ and ∊ did not even agree with each other. +#[test] +fn element_of() -> Result<()> { + for ch in ["∈", "∊"] { + let expr = format!("x{ch}A"); + test("ja", "SimpleSpeak", &expr, "x は 要素オブ 大文字 エー")?; + test_ClearSpeak("ja", "ClearSpeak_SetMemberSymbol", "Element", &expr, + "x 要素オブ 大文字 エー")?; + } + return Ok(()); +} + /// A hat over a variable is ハット. 帽子 is the thing you wear, and it was said /// twice. #[test] From f70bf75b21deba60c2dfacbeda34a14ab1c095b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yasunori=20Morishima=EF=BC=88=E7=9B=9B=E5=B3=B6=E5=BA=B7?= =?UTF-8?q?=E5=BE=B3=EF=BC=89?= Date: Sat, 5 Sep 2026 16:40:40 +0900 Subject: [PATCH 2/6] ja: update the tests that pinned the old relation wording --- tests/Languages/ja/ja.rs | 37 ++++++++++++++++--------------------- 1 file changed, 16 insertions(+), 21 deletions(-) diff --git a/tests/Languages/ja/ja.rs b/tests/Languages/ja/ja.rs index 66e0f58d..f2fc7b7f 100644 --- a/tests/Languages/ja/ja.rs +++ b/tests/Languages/ja/ja.rs @@ -261,19 +261,13 @@ fn less_than() -> Result<()> { return Ok(()); } -/// 小なり / 大なり are the pair the source gives for < and >. より大きい strands the -/// より, which needs its comparand in front of it, so "x は より大きい 5" reads as +/// 小なり / 大なり are the pair the source gives for < and >. より大きい stranded the +/// より, which needs its comparand in front of it, so "x は より大きい 5" read as /// "x is a bigger 5"; and it did not match the 小なり already used for <. #[test] -fn greater_than_and_or_equal() -> Result<()> { - for (op, expected) in [ - (">", "x は 大なり 5"), - ("≤", "x は 小なり オア イコール 5"), - ("≥", "x は 大なり オア イコール 5"), - ] { - let expr = format!("x{op}5"); - test("ja", "ClearSpeak", &expr, expected)?; - } +fn greater_than() -> Result<()> { + let expr = "x>5"; + test("ja", "ClearSpeak", expr, "x は 大なり 5")?; return Ok(()); } @@ -291,7 +285,7 @@ fn not_equal() -> Result<()> { fn element_of() -> Result<()> { for ch in ["∈", "∊"] { let expr = format!("x{ch}A"); - test("ja", "SimpleSpeak", &expr, "x は 要素オブ 大文字 エー")?; + test("ja", "SimpleSpeak", &expr, "x は 要素オブ, 大文字 エー")?; test_ClearSpeak("ja", "ClearSpeak_SetMemberSymbol", "Element", &expr, "x 要素オブ 大文字 エー")?; } @@ -460,7 +454,7 @@ fn greek_letters() -> Result<()> { #[test] fn set_membership() -> Result<()> { let expr = "xR"; - test("ja", "SimpleSpeak", expr, "x は 属する 実数")?; + test("ja", "SimpleSpeak", expr, "x は 要素オブ 実数")?; return Ok(()); } @@ -527,12 +521,13 @@ fn parallel_and_perpendicular() -> Result<()> { } /// ≤ said より少しまたは等しい ("a little more, or equal") and ≥ ended in the -/// particle へ. +/// particle へ. They then said より小さいか等しい / より大きいか等しい, which strand the +/// より the same way > did; the source gives 小なり・オア・イコール. #[test] fn comparison_with_equality() -> Result<()> { for (op, expected) in [ - ("≤", "x は より小さいか等しい 5"), - ("≥", "x は より大きいか等しい 5"), + ("≤", "x は 小なり オア イコール 5"), + ("≥", "x は 大なり オア イコール 5"), ] { let expr = format!("x{op}5"); test("ja", "ClearSpeak", &expr, expected)?; @@ -629,11 +624,11 @@ fn matrix_terminology() -> Result<()> { #[test] fn number_set_names() -> Result<()> { for (letter, expected) in [ - ("C", "x は 属する 複素数"), - ("N", "x は 属する 自然数"), - ("Q", "x は 属する 有理数"), - ("R", "x は 属する 実数"), - ("Z", "x は 属する 整数"), + ("C", "x は 要素オブ 複素数"), + ("N", "x は 要素オブ 自然数"), + ("Q", "x は 要素オブ 有理数"), + ("R", "x は 要素オブ 実数"), + ("Z", "x は 要素オブ 整数"), ] { let expr = format!( "x{letter}" From 1c074b71ed617ba0a75b01b43650046f76fe68b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yasunori=20Morishima=EF=BC=88=E7=9B=9B=E5=B3=B6=E5=BA=B7?= =?UTF-8?q?=E5=BE=B3=EF=BC=89?= Date: Sat, 5 Sep 2026 17:00:04 +0900 Subject: [PATCH 3/6] ja: sweep the same relations in definitions.yaml and cover the set branches --- Rules/Languages/ja/definitions.yaml | 12 ++++++------ Rules/Languages/ja/unicode.yaml | 6 +++--- tests/Languages/ja/ja.rs | 26 +++++++++++++++++++++++++- 3 files changed, 34 insertions(+), 10 deletions(-) diff --git a/Rules/Languages/ja/definitions.yaml b/Rules/Languages/ja/definitions.yaml index c92c2a31..f868df10 100644 --- a/Rules/Languages/ja/definitions.yaml +++ b/Rules/Languages/ja/definitions.yaml @@ -280,28 +280,28 @@ "dot-product": "infix=内積", "downwards-diagonal-ellipsis": "infix=下向き対角の省略記号", "direct-product": "infix=直積", - "element-of": "infix=の要素", + "element-of": "infix=要素オブ", "ellipsis": "infix=省略記号", "equals": "infix=イコール", "equivalent-to": "infix=と同等の", "evaluates-to": "infix=評価する", "given": "infix=与えられた", - "greater-than": "infix=より大きい", - "greater-than-or-equal-to": "infix=より大きいか等しい", + "greater-than": "infix=大なり", + "greater-than-or-equal-to": "infix=大なり オア イコール", "identically-equals": "infix=恒等的に等しい", "if-and-only-if": "infix=同値", "implies": "infix=ならば", "inner-product": "infix=内積", "intersection": "infix=共通部分", - "less-than": "infix=より小さい", - "less-than-or-equal-to": "infix=以下", + "less-than": "infix=小なり", + "less-than-or-equal-to": "infix=小なり オア イコール", "list-separator": "infix=コンマ", "maps-to": "infix=に写る", "member-of": "infix=に属する", "minus-or-plus": "infix=マイナスまたはプラス", "not-subset": "infix=部分集合でない", "not-superset": "infix=上位集合でない", - "not-equal-to": "infix=等しくない", + "not-equal-to": "infix=ノット イコール", "not-member-of": "infix=に属さない", "not-parallel-to": "infix=平行でない", "obtained-from": "infix=から得られる", diff --git a/Rules/Languages/ja/unicode.yaml b/Rules/Languages/ja/unicode.yaml index a3b0cbd6..882434aa 100644 --- a/Rules/Languages/ja/unicode.yaml +++ b/Rules/Languages/ja/unicode.yaml @@ -361,7 +361,7 @@ - if: $ClearSpeak_SetMemberSymbol = 'Auto' or $ClearSpeak_SetMemberSymbol = 'Member' then: [t: "元"] - else_if: $ClearSpeak_SetMemberSymbol = 'Element' - then: [T: "要素オブ"] + then: [t: "要素オブ"] - else_if: $ClearSpeak_SetMemberSymbol = 'In' then: [t: "に含まれる"] - else: [t: "属する"] # $ClearSpeak_SetMemberSymbol = 'Belongs' @@ -464,7 +464,7 @@ - if: $ClearSpeak_SetMemberSymbol = 'Auto' or $ClearSpeak_SetMemberSymbol = 'Member' then: [t: "元"] - else_if: $ClearSpeak_SetMemberSymbol = 'Element' - then: [T: "要素オブ"] + then: [t: "要素オブ"] - else_if: $ClearSpeak_SetMemberSymbol = 'In' then: [t: "に含まれる"] - else: [t: "属する"] # $ClearSpeak_SetMemberSymbol = 'Belongs' @@ -492,7 +492,7 @@ - test: if: "$Verbosity!='Terse'" then: [t: "は"] - - T: "ノット・イコール" + - T: "ノット イコール" - "≡": # 0x2261 - test: if: "$Verbosity!='Terse'" diff --git a/tests/Languages/ja/ja.rs b/tests/Languages/ja/ja.rs index f2fc7b7f..1acc165b 100644 --- a/tests/Languages/ja/ja.rs +++ b/tests/Languages/ja/ja.rs @@ -275,7 +275,7 @@ fn greater_than() -> Result<()> { #[test] fn not_equal() -> Result<()> { let expr = "x5"; - test("ja", "ClearSpeak", expr, "x は ノット・イコール 5")?; + test("ja", "ClearSpeak", expr, "x は ノット イコール 5")?; return Ok(()); } @@ -292,6 +292,30 @@ fn element_of() -> Result<()> { return Ok(()); } +/// Inside a set the ClearSpeak options take a different branch of the same rule. +/// 中へ is "into", a direction of motion, not membership. +#[test] +fn set_builder_member_symbol() -> Result<()> { + for ch in ["∈", "∊"] { + let expr = format!( + "{{x{ch}A}}" + ); + test_ClearSpeak("ja", "ClearSpeak_SetMemberSymbol", "In", &expr, + "集合 x イン 大文字 エー")?; + test_ClearSpeak("ja", "ClearSpeak_SetMemberSymbol", "Element", &expr, + "集合 x 要素オブ 大文字 エー")?; + } + return Ok(()); +} + +/// ∾ is "most positive" in the numeric sense; 最も肯定的な is "most affirmative". +#[test] +fn most_positive() -> Result<()> { + let expr = "xy"; + test("ja", "ClearSpeak", expr, "x は 最も正の y")?; + return Ok(()); +} + /// A hat over a variable is ハット. 帽子 is the thing you wear, and it was said /// twice. #[test] From 3dfdd692ff8c07cf121ff6e8c3151e9b8282fd12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yasunori=20Morishima=EF=BC=88=E7=9B=9B=E5=B3=B6=E5=BA=B7?= =?UTF-8?q?=E5=BE=B3=EF=BC=89?= Date: Sat, 5 Sep 2026 17:06:46 +0900 Subject: [PATCH 4/6] ja: flatten the set-builder test expression --- 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 1acc165b..1d765d4b 100644 --- a/tests/Languages/ja/ja.rs +++ b/tests/Languages/ja/ja.rs @@ -298,7 +298,7 @@ fn element_of() -> Result<()> { fn set_builder_member_symbol() -> Result<()> { for ch in ["∈", "∊"] { let expr = format!( - "{{x{ch}A}}" + "{{x{ch}A}}" ); test_ClearSpeak("ja", "ClearSpeak_SetMemberSymbol", "In", &expr, "集合 x イン 大文字 エー")?; From de586baa12826a048f63a3b6f49d854b20916aa5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yasunori=20Morishima=EF=BC=88=E7=9B=9B=E5=B3=B6=E5=BA=B7?= =?UTF-8?q?=E5=BE=B3=EF=BC=89?= Date: Sat, 5 Sep 2026 17:13:58 +0900 Subject: [PATCH 5/6] ja: use the set-builder shape the en tests use --- tests/Languages/ja/ja.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/Languages/ja/ja.rs b/tests/Languages/ja/ja.rs index 1d765d4b..53d13d47 100644 --- a/tests/Languages/ja/ja.rs +++ b/tests/Languages/ja/ja.rs @@ -293,17 +293,18 @@ fn element_of() -> Result<()> { } /// Inside a set the ClearSpeak options take a different branch of the same rule. -/// 中へ is "into", a direction of motion, not membership. +/// 中へ is "into", a direction of motion, not membership. The shape is the one +/// en/ClearSpeak/sets.rs uses for set-builder notation. #[test] fn set_builder_member_symbol() -> Result<()> { for ch in ["∈", "∊"] { let expr = format!( - "{{x{ch}A}}" + "{{x{ch}: x>5}}" ); test_ClearSpeak("ja", "ClearSpeak_SetMemberSymbol", "In", &expr, - "集合 x イン 大文字 エー")?; + "集合 すべて x イン 整数 そのようなこと x は 大なり 5")?; test_ClearSpeak("ja", "ClearSpeak_SetMemberSymbol", "Element", &expr, - "集合 x 要素オブ 大文字 エー")?; + "集合 すべて x 要素オブ 整数 そのようなこと x は 大なり 5")?; } return Ok(()); } From ce1970374ec848c5e410caa9f771c3bfb9370198 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yasunori=20Morishima=EF=BC=88=E7=9B=9B=E5=B3=B6=E5=BA=B7?= =?UTF-8?q?=E5=BE=B3=EF=BC=89?= Date: Sat, 5 Sep 2026 17:40:41 +0900 Subject: [PATCH 6/6] =?UTF-8?q?ja:=20member-of=20said=20=E3=81=AB=E5=B1=9E?= =?UTF-8?q?=E3=81=99=E3=82=8B=20where=20unicode.yaml=20says=20=E5=85=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Rules/Languages/ja/definitions.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Rules/Languages/ja/definitions.yaml b/Rules/Languages/ja/definitions.yaml index f868df10..b5e9b8f9 100644 --- a/Rules/Languages/ja/definitions.yaml +++ b/Rules/Languages/ja/definitions.yaml @@ -297,12 +297,12 @@ "less-than-or-equal-to": "infix=小なり オア イコール", "list-separator": "infix=コンマ", "maps-to": "infix=に写る", - "member-of": "infix=に属する", + "member-of": "infix=元", "minus-or-plus": "infix=マイナスまたはプラス", "not-subset": "infix=部分集合でない", "not-superset": "infix=上位集合でない", "not-equal-to": "infix=ノット イコール", - "not-member-of": "infix=に属さない", + "not-member-of": "infix=元でない", "not-parallel-to": "infix=平行でない", "obtained-from": "infix=から得られる", "or": "infix=または",