From 23ab7a798bfedbeec9aac87f7b5acc7146c88511 Mon Sep 17 00:00:00 2001 From: yasumorishima Date: Sun, 30 Aug 2026 11:19:51 +0900 Subject: [PATCH 1/3] =?UTF-8?q?ja:=20read=20the=20function-application=20o?= =?UTF-8?q?f=20as=20=E3=82=AA=E3=83=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Rules/Languages/ja/SharedRules/default.yaml | 8 ++++---- tests/Languages/ja/ja.rs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Rules/Languages/ja/SharedRules/default.yaml b/Rules/Languages/ja/SharedRules/default.yaml index d57b6895..97d5dc15 100644 --- a/Rules/Languages/ja/SharedRules/default.yaml +++ b/Rules/Languages/ja/SharedRules/default.yaml @@ -127,7 +127,7 @@ - t: "ルート" - test: if: "$Verbosity!='Terse'" - then: [t: "の"] # phrase("the root 'of' x") + then: [t: "オブ"] # phrase("the root 'of' x") - x: "*[1]" - pause: short - test: @@ -145,7 +145,7 @@ - t: "根指数" # phrase("the 'root with index' 3 of 5") - x: "*[1]" - pause: short - - t: "の" # phrase("the root 'of' x") + - t: "オブ" # phrase("the root 'of' x") - x: "*[2]" - pause: short - test: @@ -636,7 +636,7 @@ match: . replace: - x: "*[1]" - - t: "の" # phrase(the sine 'of' x ) + - t: "オブ" # phrase(the sine 'of' x ) - pause: auto - x: "*[position() > 1]" @@ -736,7 +736,7 @@ - test: if: "$Verbosity != 'Terse' and not(contains(@data-intent-property, ':literal:')) and not(count(*)=2 and (IsInDefinition(*[1], 'TrigFunctionNames') or IsInDefinition(name(.), 'TerseFunctionNames')) and IsNode(*[2], 'simple'))" - then: [t: "の", pause: auto] # phrase(sine 'of' 5) + then: [t: "オブ", pause: auto] # phrase(sine 'of' 5) - insert: nodes: "*" replace: diff --git a/tests/Languages/ja/ja.rs b/tests/Languages/ja/ja.rs index fd1d8eed..ba929e02 100644 --- a/tests/Languages/ja/ja.rs +++ b/tests/Languages/ja/ja.rs @@ -231,7 +231,7 @@ fn subscript() -> Result<()> { #[test] fn sine_function() -> Result<()> { let expr = "sinx"; - test("ja", "SimpleSpeak", expr, "サイン の x")?; + test("ja", "SimpleSpeak", expr, "サイン オブ x")?; return Ok(()); } From c5d2c96ffe691270e46008125136f6e9b926fdf8 Mon Sep 17 00:00:00 2001 From: yasumorishima Date: Sun, 30 Aug 2026 11:36:04 +0900 Subject: [PATCH 2/3] =?UTF-8?q?ja:=20the=20invisible=20function-apply=20ch?= =?UTF-8?q?aracter=20also=20reads=20=E3=82=AA=E3=83=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Rules/Languages/ja/unicode.yaml | 2 +- tests/Languages/ja/ja.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Rules/Languages/ja/unicode.yaml b/Rules/Languages/ja/unicode.yaml index d6d811b7..8660881d 100644 --- a/Rules/Languages/ja/unicode.yaml +++ b/Rules/Languages/ja/unicode.yaml @@ -309,7 +309,7 @@ preceding-sibling::*[1][IsInDefinition(., 'GeometryShapes')] or (@data-changed='added' and ancestor-or-self::*[contains(@data-intent-property, ':literal:')]) )" - then: [t: "の"] + then: [t: "オブ"] - "⁢": [t: ""] # 0x2062 - "⁣": [t: ""] # 0x2063 - "⁤": [t: "および"] # 0x2064 diff --git a/tests/Languages/ja/ja.rs b/tests/Languages/ja/ja.rs index ba929e02..ea78e594 100644 --- a/tests/Languages/ja/ja.rs +++ b/tests/Languages/ja/ja.rs @@ -109,7 +109,7 @@ fn negative_number() -> Result<()> { fn gradient() -> Result<()> { let expr = "F"; test_prefs("ja", "SimpleSpeak", vec![("Verbosity", "Terse")], expr, "デル 大文字 f")?; - test_prefs("ja", "SimpleSpeak", vec![("Verbosity", "Verbose")], expr, "勾配 の 大文字 f")?; + test_prefs("ja", "SimpleSpeak", vec![("Verbosity", "Verbose")], expr, "勾配 オブ 大文字 f")?; return Ok(()); } From cb952bde3f37210203012dbaa8c1595a5558ac8e Mon Sep 17 00:00:00 2001 From: yasumorishima Date: Wed, 2 Sep 2026 00:58:48 +0900 Subject: [PATCH 3/3] =?UTF-8?q?ja:=20read=20the=20remaining=20function=20a?= =?UTF-8?q?pplications=20with=20=E3=82=AA=E3=83=96=20too?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These are the sites the first two commits could not reach while #730 was open — the square root in ClearSpeak_Rules, SimpleSpeak_Rules, SharedRules/general and overview — plus three where the connector was fused into the preceding word, so grepping for a standalone one missed them: ∆ and √ in unicode.yaml, and the square-root-of prefix in definitions.yaml. en reads "laplacian of" and "square root of" as two words in those same places. The exponent readings keep の: 3 の 2 乗 is ordinary Japanese and correct, as are 分の, 正の and 負の. SharedRules/calculus.yaml is brought in line too, but it is dormant — neither ja nor en includes it, only fi, es, vi, sv, id and zh-tw do. Its four operators reach speech through the function= entries in definitions.yaml instead, and that is the path the new test covers. Two of the four had lost the connector in this file altogether while the two beside them kept it. Left alone on purpose: 順列の in SharedRules/general.yaml. en reads "permutations of" there, but that rule already reverses its two arguments, so the right Japanese wording is a decision rather than a swap. --- Rules/Languages/ja/ClearSpeak_Rules.yaml | 4 +- Rules/Languages/ja/SharedRules/calculus.yaml | 8 +- Rules/Languages/ja/SharedRules/general.yaml | 2 +- Rules/Languages/ja/SimpleSpeak_Rules.yaml | 4 +- Rules/Languages/ja/definitions.yaml | 2 +- Rules/Languages/ja/overview.yaml | 4 +- Rules/Languages/ja/unicode.yaml | 4 +- tests/Languages/ja/ja.rs | 78 ++++++++++++-------- 8 files changed, 62 insertions(+), 44 deletions(-) diff --git a/Rules/Languages/ja/ClearSpeak_Rules.yaml b/Rules/Languages/ja/ClearSpeak_Rules.yaml index 55e45b4a..f6877ae5 100644 --- a/Rules/Languages/ja/ClearSpeak_Rules.yaml +++ b/Rules/Languages/ja/ClearSpeak_Rules.yaml @@ -46,7 +46,7 @@ - t: "平方根" # phrase(8 is the 'square root' of 64) - test: if: "$Verbosity!='Terse'" - then: [t: "の"] # phrase(the square root 'of' 5) + then: [t: "オブ"] # phrase(the square root 'of' 5) else: [pause: short] - x: "*[1]" - test: @@ -89,7 +89,7 @@ - t: "乗根" # phrase(the square 'root' of 36) - test: if: "$Verbosity!='Terse'" - then: [t: "の"] # phrase(the square root 'of' 36) + then: [t: "オブ"] # phrase(the square root 'of' 36) - x: "*[1]" - test: if: "$ClearSpeak_Roots = 'RootEnd' or $ClearSpeak_Roots = 'PosNegSqRootEnd'" diff --git a/Rules/Languages/ja/SharedRules/calculus.yaml b/Rules/Languages/ja/SharedRules/calculus.yaml index b3747bc9..3ec41db2 100644 --- a/Rules/Languages/ja/SharedRules/calculus.yaml +++ b/Rules/Languages/ja/SharedRules/calculus.yaml @@ -10,7 +10,7 @@ then: - test: if: "$Verbosity!='Terse'" - then: [t: "の"] # phrase(function 'of' one variable) -- note OneCore voices spell out "div" + then: [t: "オブ"] # phrase(function 'of' one variable) -- note OneCore voices spell out "div" - test: if: "not(IsNode(*[1], 'leaf'))" then: [pause: short] @@ -23,7 +23,7 @@ - test: if: "$Verbosity='Terse'" then: [t: "ダイバージェンス"] # phrase('div' is short for divergence) -- note OneCore voices spell out "div" - else: [t: "発散"] # phrase('divergence of' this function from the mean) + else: [t: "発散 オブ"] # phrase('divergence of' this function from the mean) - test: if: "not(IsNode(*[1], 'leaf'))" then: [pause: short] @@ -36,7 +36,7 @@ - t: "回転" # phrase(the 'curl of' a field) - test: if: "$Verbosity!='Terse'" - then: [t: "の"] # phrase(function 'of' one variable) -- note OneCore voices spell out "div" + then: [t: "オブ"] # phrase(function 'of' one variable) -- note OneCore voices spell out "div" - test: if: "not(IsNode(*[1], 'leaf'))" then: [pause: short] @@ -48,7 +48,7 @@ replace: - test: if: "$Verbosity!='Terse'" - then: [t: "勾配"] # phrase(the hill has a 'gradient of' five percent) + then: [t: "勾配 オブ"] # phrase(the hill has a 'gradient of' five percent) else: [t: "デル"] # phrase(the delete key is labeled 'del') - test: if: "not(IsNode(*[1], 'leaf'))" diff --git a/Rules/Languages/ja/SharedRules/general.yaml b/Rules/Languages/ja/SharedRules/general.yaml index 6c88e6f4..75f113e5 100644 --- a/Rules/Languages/ja/SharedRules/general.yaml +++ b/Rules/Languages/ja/SharedRules/general.yaml @@ -187,7 +187,7 @@ if: "$Verbosity!='Terse'" then: [ot: ""] # phrase('the' square root of 25 equals 5) - x: "*[1]" - - t: "の" # phrase(the square root 'of' 25 equals 5) + - t: "オブ" # phrase(the square root 'of' 25 equals 5) - x: "*[2]" - name: repeating-decimal diff --git a/Rules/Languages/ja/SimpleSpeak_Rules.yaml b/Rules/Languages/ja/SimpleSpeak_Rules.yaml index 443f4ae1..34138a42 100644 --- a/Rules/Languages/ja/SimpleSpeak_Rules.yaml +++ b/Rules/Languages/ja/SimpleSpeak_Rules.yaml @@ -38,7 +38,7 @@ - t: "平方根" # phrase(the 'square root' of x) - test: if: "$Verbosity!='Terse'" - then: [t: "の"] # phrase(the square root 'of' x) + then: [t: "オブ"] # phrase(the square root 'of' x) else: [pause: short] - x: "*[1]" - pause: short @@ -66,7 +66,7 @@ - t: "乗根" # phrase(the square 'root' of) - test: if: "$Verbosity!='Terse'" - then: [t: "の"] # phrase(the square root 'of' x) + then: [t: "オブ"] # phrase(the square root 'of' x) - x: "*[1]" - pause: short - test: diff --git a/Rules/Languages/ja/definitions.yaml b/Rules/Languages/ja/definitions.yaml index 6ac9e754..fc0b2767 100644 --- a/Rules/Languages/ja/definitions.yaml +++ b/Rules/Languages/ja/definitions.yaml @@ -259,7 +259,7 @@ "number-of": "prefix=個数", "partial-derivative": "prefix=偏微分", "right-angle": "prefix=直角", - "square-root-of": "prefix=平方根の", + "square-root-of": "prefix=平方根 オブ", "there-does-not-exist": "prefix=存在しない", "there-exists": "prefix=存在する", diff --git a/Rules/Languages/ja/overview.yaml b/Rules/Languages/ja/overview.yaml index 58d3a23e..8c25e191 100644 --- a/Rules/Languages/ja/overview.yaml +++ b/Rules/Languages/ja/overview.yaml @@ -36,7 +36,7 @@ then: - test: if: "$Verbosity!='Terse'" - then: [t: "の"] + then: [t: "オブ"] - x: "*[1]" - name: overview-default @@ -60,7 +60,7 @@ then: - test: if: "$Verbosity!='Terse'" - then: [t: "の"] + then: [t: "オブ"] - x: "*[1]" - name: matrix-override diff --git a/Rules/Languages/ja/unicode.yaml b/Rules/Languages/ja/unicode.yaml index 8660881d..88b08f23 100644 --- a/Rules/Languages/ja/unicode.yaml +++ b/Rules/Languages/ja/unicode.yaml @@ -412,7 +412,7 @@ - test: if: "$Verbosity!='Terse'" then: [ot: ""] - - t: "ラプラシアンの" + - t: "ラプラシアン オブ" - "∉": # 0x2209 # rule is identical to 0x2208 - test: @@ -472,7 +472,7 @@ - test: if: "$Verbosity!='Terse'" then: [ot: ""] - - t: "平方根の" + - t: "平方根 オブ" - "∝": # 0x221d - test: if: "$Verbosity!='Terse'" diff --git a/tests/Languages/ja/ja.rs b/tests/Languages/ja/ja.rs index ea78e594..bdc1fcca 100644 --- a/tests/Languages/ja/ja.rs +++ b/tests/Languages/ja/ja.rs @@ -43,7 +43,7 @@ fn fraction_of_variables() -> Result<()> { #[test] fn square_root() -> Result<()> { let expr = "9"; - test("ja", "ClearSpeak", expr, "平方根 の 9")?; + test("ja", "ClearSpeak", expr, "平方根 オブ 9")?; return Ok(()); } @@ -113,6 +113,24 @@ fn gradient() -> Result<()> { return Ok(()); } +/// These four reach the generic function-application rule through the +/// function= entries in definitions.yaml, so they take オブ like any other +/// function. SharedRules/calculus.yaml also names them, but neither ja nor en +/// includes that file today, so it is not the path under test here. +#[test] +fn vector_calculus_operators() -> Result<()> { + for (intent, expected) in [ + ("curl", "回転 オブ x"), + ("divergence", "発散 オブ x"), + ("gradient", "勾配 オブ x"), + ("laplacian", "ラプラシアン オブ x"), + ] { + let expr = format!("x"); + test("ja", "ClearSpeak", &expr, expected)?; + } + return Ok(()); +} + /// Verifies that multiplication and division symbols use Japanese operator names. #[test] fn multiplication_and_division() -> Result<()> { @@ -197,7 +215,7 @@ fn interval_open_closed() -> Result<()> { #[test] fn cube_root() -> Result<()> { let expr = "83"; - test("ja", "ClearSpeak", expr, "立方根 の 8")?; + test("ja", "ClearSpeak", expr, "立方根 オブ 8")?; return Ok(()); } @@ -206,8 +224,8 @@ fn cube_root() -> Result<()> { #[test] fn nth_root() -> Result<()> { let expr = "x5"; - test("ja", "ClearSpeak", expr, "5 乗根 の x")?; - test("ja", "SimpleSpeak", expr, "5 乗根 の x")?; + test("ja", "ClearSpeak", expr, "5 乗根 オブ x")?; + test("ja", "SimpleSpeak", expr, "5 乗根 オブ x")?; return Ok(()); } @@ -215,7 +233,7 @@ fn nth_root() -> Result<()> { #[test] fn variable_index_root() -> Result<()> { let expr = "xn"; - test("ja", "ClearSpeak", expr, "n 乗根 の x")?; + test("ja", "ClearSpeak", expr, "n 乗根 オブ x")?; return Ok(()); } @@ -322,11 +340,11 @@ fn geometry_verbose_from_to() -> Result<()> { #[test] fn trigonometric_function_names() -> Result<()> { for (name, expected) in [ - ("cos", "コサイン の x"), - ("tan", "タンジェント の x"), - ("sec", "セカント の x"), - ("csc", "コセカント の x"), - ("cot", "コタンジェント の x"), + ("cos", "コサイン オブ x"), + ("tan", "タンジェント オブ x"), + ("sec", "セカント オブ x"), + ("csc", "コセカント オブ x"), + ("cot", "コタンジェント, オブ x"), ] { let expr = format!("{name}x"); test("ja", "SimpleSpeak", &expr, expected)?; @@ -338,12 +356,12 @@ fn trigonometric_function_names() -> Result<()> { #[test] fn hyperbolic_function_names() -> Result<()> { for (name, expected) in [ - ("sinh", "双曲線正弦 の x"), - ("cosh", "双曲線余弦 の x"), - ("tanh", "双曲線正接 の x"), - ("sech", "双曲線正割 の x"), - ("csch", "双曲線余割 の x"), - ("coth", "双曲線余接 の x"), + ("sinh", "双曲線正弦 オブ x"), + ("cosh", "双曲線余弦 オブ x"), + ("tanh", "双曲線正接 オブ x"), + ("sech", "双曲線正割 オブ x"), + ("csch", "双曲線余割 オブ x"), + ("coth", "双曲線余接 オブ x"), ] { let expr = format!("{name}x"); test("ja", "SimpleSpeak", &expr, expected)?; @@ -365,10 +383,10 @@ fn hyperbolic_function_terse() -> Result<()> { #[test] fn complex_number_parts() -> Result<()> { for (intent, expected) in [ - ("real-part", "実部 の x"), - ("imaginary-part", "虚部 の x"), - ("complex-conjugate", "複素共役 の x"), - ("complex-arg", "偏角 の x"), + ("real-part", "実部 オブ x"), + ("imaginary-part", "虚部 オブ x"), + ("complex-conjugate", "複素共役 オブ x"), + ("complex-arg", "偏角 オブ x"), ] { let expr = format!("x"); test("ja", "ClearSpeak", &expr, expected)?; @@ -380,12 +398,12 @@ fn complex_number_parts() -> Result<()> { #[test] fn inverse_trigonometric_names() -> Result<()> { for (intent, expected) in [ - ("arcsine", "逆正弦 の x"), - ("arccosine", "逆余弦 の x"), - ("arctangent", "逆正接 の x"), - ("arcsecant", "逆正割 の x"), - ("arccosecant", "逆余割 の x"), - ("arccotangent", "逆余接 の x"), + ("arcsine", "逆正弦 オブ x"), + ("arccosine", "逆余弦 オブ x"), + ("arctangent", "逆正接 オブ x"), + ("arcsecant", "逆正割 オブ x"), + ("arccosecant", "逆余割 オブ x"), + ("arccotangent", "逆余接 オブ x"), ] { let expr = format!("x"); test("ja", "ClearSpeak", &expr, expected)?; @@ -530,7 +548,7 @@ fn definite_integral() -> Result<()> { #[test] fn set_terminology() -> Result<()> { let expr = "xy"; - test("ja", "ClearSpeak", expr, "集合 の x コンマ, y")?; + test("ja", "ClearSpeak", expr, "集合 オブ x コンマ, y")?; return Ok(()); } @@ -538,7 +556,7 @@ fn set_terminology() -> Result<()> { #[test] fn norm_terminology() -> Result<()> { let expr = "x"; - test("ja", "ClearSpeak", expr, "ノルム の x")?; + test("ja", "ClearSpeak", expr, "ノルム オブ x")?; return Ok(()); } @@ -555,7 +573,7 @@ fn limit_terminology() -> Result<()> { #[test] fn statistics_mode() -> Result<()> { let expr = "x"; - test("ja", "ClearSpeak", expr, "最頻値 の x")?; + test("ja", "ClearSpeak", expr, "最頻値 オブ x")?; return Ok(()); } @@ -592,7 +610,7 @@ fn number_set_names() -> Result<()> { #[test] fn geometry_translation() -> Result<()> { let expr = "x"; - test("ja", "ClearSpeak", expr, "平行移動 の x")?; + test("ja", "ClearSpeak", expr, "平行移動 オブ x")?; return Ok(()); }