Skip to content
Merged
Show file tree
Hide file tree
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
16 changes: 8 additions & 8 deletions Rules/Languages/ja/definitions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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=または",
Expand All @@ -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=和集合",
Expand Down
42 changes: 21 additions & 21 deletions Rules/Languages/ja/unicode.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -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
Expand Down
55 changes: 54 additions & 1 deletion tests/Languages/ja/ja.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "<math><mi>x</mi><mo>&#x2209;</mo><mi>A</mi></math>";
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 ["&#x2208;", "&#x220a;"] {
let expr = format!("<math><mi>x</mi><mo>{ch}</mo><mi>A</mi></math>");
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 [
("&#x2282;", "x は 部分集合オブ y"),
("&#x2283;", "x は 上位集合オブ y"),
("&#x2284;", "x は ノット 部分集合オブ y"),
("&#x2285;", "x は ノット 上位集合オブ y"),
("&#x2286;", "x は 部分集合オブ オア イコール y"),
("&#x2287;", "x は 上位集合オブ オア イコール y"),
] {
let expr = format!("<math><mi>x</mi><mo>{ch}</mo><mi>y</mi></math>");
test("ja", "ClearSpeak", &expr, expected)?;
}
return Ok(());
}

/// ∾ is "most positive" in the numeric sense; 最も肯定的な is "most affirmative".
#[test]
fn most_positive() -> Result<()> {
Expand Down Expand Up @@ -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 = "<math><mi>x</mi><mo>&#x2209;</mo><mi>y</mi></math>";
test("ja", "ClearSpeak", expr, "x 元でない y")?;
test("ja", "ClearSpeak", expr, "x ノット 元オブ y")?;
return Ok(());
}

Expand Down
Loading