From 0e2163594017e8269aace32ff860939e2e0b82e8 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: Fri, 18 Sep 2026 15:44:45 +0900 Subject: [PATCH] ja: make the rest of the set relations work between the operands MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #757 left the negated membership and the subset family alone: the source gives 部分集合オブ for ⊂ but nothing for the superset or the negated forms, and I did not want to change half a family. This does the whole family at once. - ⊂ said 部分集合 and ⊆ said 部分集合または等しい. A bare noun, or a predicate that ends the sentence, strands the set that follows it: "A は 部分集合 B" reads as "A is a subset" and then a B. The source gives 部分集合オブ for ⊂ and 部分集合(オブ)・オア・イコール for ⊆, where the オア イコール is the one this translation already uses for ≤ (the ・ is only a word separator, not read). - ⊃ and ⊇ keep the 上位集合 the seed chose, since the source gives no superset reading, and take the same オブ so they work in the same position. - ∉ ⊄ ⊅ ended in ではない / でない, which closes the sentence in front of the set the statement is about. The source gives ノット・イコール for ≠, so the negation is that same ノット in front of whatever the positive form says. - The ClearSpeak Member option said 元 on its own -- the same missing-preposition shape 要素の had in #757 -- and outside a set the In option said に含まれる, whose に attaches to what comes before it and so reverses the relation. - definitions.yaml carries the same readings for intent, so the eight entries of this family are swept with it. Left alone: the Belongs option (に属する / 属する / 属さない). Its Japanese is a verb phrase, so making it work between the operands is not a matter of adding the borrowed オブ; it needs a noun the source does not give. It stays t: in both polarities, and is the one branch of ∈/∊/∉ this commit does not promote. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01XzNYYoiVRzKGnDEWTJnuHh --- Rules/Languages/ja/definitions.yaml | 16 ++++----- Rules/Languages/ja/unicode.yaml | 42 +++++++++++----------- tests/Languages/ja/ja.rs | 55 ++++++++++++++++++++++++++++- 3 files changed, 83 insertions(+), 30 deletions(-) diff --git a/Rules/Languages/ja/definitions.yaml b/Rules/Languages/ja/definitions.yaml index b5e9b8f9a..95f9c262b 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-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=または", @@ -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 64ada1af2..2fb44f2da 100644 --- a/Rules/Languages/ja/unicode.yaml +++ b/Rules/Languages/ja/unicode.yaml @@ -353,17 +353,17 @@ - if: $ClearSpeak_SetMemberSymbol = 'Auto' or $ClearSpeak_SetMemberSymbol = 'In' then: [T: "イン"] - else_if: $ClearSpeak_SetMemberSymbol = 'Member' - then: [t: "元"] + then: [T: "元オブ"] - else_if: $ClearSpeak_SetMemberSymbol = 'Element' then: [T: "要素オブ"] - else: [t: "に属する"] # $ClearSpeak_SetMemberSymbol = 'Belongs' else_test: - if: $ClearSpeak_SetMemberSymbol = 'Auto' or $ClearSpeak_SetMemberSymbol = 'Member' - then: [t: "元"] + then: [T: "元オブ"] - else_if: $ClearSpeak_SetMemberSymbol = 'Element' - then: [t: "要素オブ"] + then: [T: "要素オブ"] - else_if: $ClearSpeak_SetMemberSymbol = 'In' - then: [t: "に含まれる"] + then: [T: "イン"] - else: [t: "属する"] # $ClearSpeak_SetMemberSymbol = 'Belongs' - "∥": # 0x2225 - test: @@ -421,25 +421,25 @@ - test: if: "$Verbosity!='Terse'" 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: "元でない"] + 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: "元でない"] + then: [T: "ノット 元オブ"] - else_if: $ClearSpeak_SetMemberSymbol = 'Element' - then: [t: "要素ではない"] + then: [T: "ノット 要素オブ"] - else_if: $ClearSpeak_SetMemberSymbol = 'In' - then: [t: "含まれない"] + then: [T: "ノット イン"] - else: [t: "属さない"] # $ClearSpeak_SetMemberSymbol = 'Belongs' - "∊": # 0x220a - test: @@ -456,17 +456,17 @@ - if: $ClearSpeak_SetMemberSymbol = 'Auto' or $ClearSpeak_SetMemberSymbol = 'In' then: [T: "イン"] - else_if: $ClearSpeak_SetMemberSymbol = 'Member' - then: [t: "元"] + then: [T: "元オブ"] - else_if: $ClearSpeak_SetMemberSymbol = 'Element' then: [T: "要素オブ"] - else: [t: "に属する"] # $ClearSpeak_SetMemberSymbol = 'Belongs' else_test: - if: $ClearSpeak_SetMemberSymbol = 'Auto' or $ClearSpeak_SetMemberSymbol = 'Member' - then: [t: "元"] + then: [T: "元オブ"] - else_if: $ClearSpeak_SetMemberSymbol = 'Element' - then: [t: "要素オブ"] + then: [T: "要素オブ"] - else_if: $ClearSpeak_SetMemberSymbol = 'In' - then: [t: "に含まれる"] + then: [T: "イン"] - else: [t: "属する"] # $ClearSpeak_SetMemberSymbol = 'Belongs' - "√": # 0x221a - test: @@ -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 89518ff31..3be2103bf 100644 --- a/tests/Languages/ja/ja.rs +++ b/tests/Languages/ja/ja.rs @@ -309,6 +309,57 @@ fn set_builder_member_symbol() -> Result<()> { return Ok(()); } +/// ∉ is the negation of ∈, and 要素ではない ends the sentence, so the set that +/// follows is stranded behind it: "x は 要素ではない A" reads as "x is not an element" +/// and then an A. The source gives ノット・イコール for ≠, so the negation is that same +/// ノット in front of whatever the positive form says. +#[test] +fn not_element_of() -> Result<()> { + let expr = "x∉A"; + test("ja", "SimpleSpeak", expr, "x は ノット 要素オブ, 大文字 エー")?; + test_ClearSpeak("ja", "ClearSpeak_SetMemberSymbol", "Element", expr, + "x ノット 要素オブ, 大文字 エー")?; + return Ok(()); +} + +/// The Member option said 元 on its own, which is the noun "element" with no +/// preposition, so the set after it was stranded the same way 要素の was for ∈. +/// 元オブ keeps the noun the seed chose and adds the オブ the source introduces +/// for English prepositions. に含まれる attaches to what comes before it, which +/// reverses the relation, so the In option uses the イン already used inside a set. +#[test] +fn member_and_in_options_work_between_the_operands() -> Result<()> { + for ch in ["∈", "∊"] { + let expr = format!("x{ch}A"); + test_ClearSpeak("ja", "ClearSpeak_SetMemberSymbol", "Member", &expr, + "x 元オブ 大文字 エー")?; + test_ClearSpeak("ja", "ClearSpeak_SetMemberSymbol", "In", &expr, + "x イン 大文字 エー")?; + } + return Ok(()); +} + +/// The source gives 部分集合オブ for ⊂ and 部分集合(オブ)・オア・イコール for ⊆, +/// where the オア イコール is the one already used for ≤. The seed dropped the オブ, +/// leaving 部分集合 to strand the set after it, and wrote the negated forms as +/// でない, which ends the sentence in front of that set. The source gives no +/// reading for the superset forms, so those keep the noun the seed chose. +#[test] +fn subset_and_superset() -> Result<()> { + for (ch, expected) in [ + ("⊂", "x は 部分集合オブ y"), + ("⊃", "x は 上位集合オブ y"), + ("⊄", "x は ノット 部分集合オブ y"), + ("⊅", "x は ノット 上位集合オブ y"), + ("⊆", "x は 部分集合オブ オア イコール y"), + ("⊇", "x は 上位集合オブ オア イコール y"), + ] { + let expr = format!("x{ch}y"); + test("ja", "ClearSpeak", &expr, expected)?; + } + return Ok(()); +} + /// ∾ is "most positive" in the numeric sense; 最も肯定的な is "most affirmative". #[test] fn most_positive() -> Result<()> { @@ -523,10 +574,12 @@ fn partial_derivative_symbol() -> Result<()> { /// Set membership was worded as club membership: メンバー, 会員でない /// ("not a club member") and 所属団体 ("the organization one belongs to"). +/// The Auto option lands on the Member branch, which then said a bare 元でない; +/// it now takes the ノット of ≠ in front of the 元オブ the positive form uses. #[test] fn set_non_membership() -> Result<()> { let expr = "x∉y"; - test("ja", "ClearSpeak", expr, "x 元でない y")?; + test("ja", "ClearSpeak", expr, "x ノット 元オブ y")?; return Ok(()); }