diff --git a/Rules/Languages/ja/SharedRules/general.yaml b/Rules/Languages/ja/SharedRules/general.yaml index e94246a3c..beacb8e10 100644 --- a/Rules/Languages/ja/SharedRules/general.yaml +++ b/Rules/Languages/ja/SharedRules/general.yaml @@ -285,7 +285,7 @@ match: "." replace: - x: "*[1]" - - T: "循環節" # phrase('with repeating digits') + - T: "循環せつ" # phrase('with repeating digits') - spell: "*[2]" - name: msubsup-skip-super diff --git a/Rules/Languages/ja/SharedRules/geometry.yaml b/Rules/Languages/ja/SharedRules/geometry.yaml index fb553ff62..4bfa18f67 100644 --- a/Rules/Languages/ja/SharedRules/geometry.yaml +++ b/Rules/Languages/ja/SharedRules/geometry.yaml @@ -52,13 +52,13 @@ - test: if: "$Verbosity='Verbose'" then: - - T: "角" # phrase('the measure of the angle' ABC) + - T: "かく" # phrase('the measure of the angle' ABC) else: - - T: "角" # phrase('measure of angle' ABC) + - T: "かく" # phrase('measure of angle' ABC) - x: "*[1]" - x: "*[2]" - x: "*[3]" - - T: "の大きさ" # Japanese says the angle first: 角 ABC の大きさ + - T: "の大きさ" # Japanese says the angle first: かく ABC の大きさ # The angle-measure intent: definitions.yaml can only give it as a prefix (角の大きさ A), # which keeps the English order, so say it here the same way as measure-of-angle. @@ -68,11 +68,11 @@ match: "count(*)>0 and not(contains(@data-intent-property, ':silent:'))" replace: - test: - # the operand already says 角 for m∠ABC or an angle intent; don't say it twice + # the operand already says かく for m∠ABC or an angle intent; don't say it twice if: "not(*[1][(self::m:angle and not(contains(@data-intent-property, ':silent:'))) or (self::m:mrow and *[1][self::m:mo and .='∠'])])" - then: [T: "角"] # phrase('measure of angle' ABC) + then: [T: "かく"] # phrase('measure of angle' ABC) - x: "*" - - T: "の大きさ" # Japanese says the angle first: 角 A の大きさ + - T: "の大きさ" # Japanese says the angle first: かく A の大きさ - name: coordinate diff --git a/Rules/Languages/ja/definitions.yaml b/Rules/Languages/ja/definitions.yaml index 60238516f..98c6edae2 100644 --- a/Rules/Languages/ja/definitions.yaml +++ b/Rules/Languages/ja/definitions.yaml @@ -262,7 +262,7 @@ "laplacian": "function=ラプラシアン", ## Default fixity prefix - "angle": "prefix=角", + "angle": "prefix=かく", "angle-measure": "prefix=角の大きさ", "change": "prefix=変化量", "for-all": "prefix=すべての", diff --git a/Rules/Languages/ja/unicode-full.yaml b/Rules/Languages/ja/unicode-full.yaml index 2c82f05a3..b6f4b2c3c 100644 --- a/Rules/Languages/ja/unicode-full.yaml +++ b/Rules/Languages/ja/unicode-full.yaml @@ -805,7 +805,7 @@ - T: "比例" - "∞": [T: "無限大"] # 0x221e - "∟": [t: "直角"] # 0x221f - - "∠": [T: "角"] # 0x2220 + - "∠": [T: "かく"] # 0x2220 - "∡": [T: "測定角"] # 0x2221 - "∢": [T: "球面角"] # 0x2222 - "∣": [T: "割り切る"] # 0x2223 @@ -2802,7 +2802,7 @@ - "": [t: "ノット 大なり オア イコール"] # 0xea1e - "": [t: "ノット マイナス付き近似的イコール"] # 0xea1f - "": [t: "上にドット付きノット 要素オブ"] # 0xea22 - - "": [t: "縦線付きノット 角"] # 0xea2c + - "": [T: "縦線付きノット かく"] # 0xea2c - "": [t: "ノット 斜め平行"] # 0xea2d - "": [t: "ノット 縦棒"] # 0xea2e - "": [t: "ノット 二重縦棒"] # 0xea2f @@ -3041,7 +3041,7 @@ - "": [t: "左下の長方形"] # 0xec81 - "": [T: "右上側の長方形"] # 0xec90 - "": [t: "右下の長方形"] # 0xec91 - - "": [t: "組立除法 角"] # 0xec92 + - "": [T: "組立除法 隅"] # 0xec92 - "": [t: "組立除法 横の延長部"] # 0xec93 - "": [t: "組立除法 縦の延長部"] # 0xec94 - "": [t: "天井床カッコ 延長部"] # 0xec95 diff --git a/tests/Languages/ja/ja.rs b/tests/Languages/ja/ja.rs index 0bd7d1514..45883c831 100644 --- a/tests/Languages/ja/ja.rs +++ b/tests/Languages/ja/ja.rs @@ -275,12 +275,13 @@ fn simplespeak_interval_names_are_japanese() -> Result<()> { return Ok(()); } -/// 循環節 is the dictionary term for the repeating digits of a recurring decimal. +/// 循環節 is the dictionary term for the repeating digits of a recurring decimal; Open JTalk reads +/// the kanji ジュンカンブシ, so 節 is written せつ. #[test] fn repeating_decimal_says_junkansetsu() -> Result<()> { let expr = "0.1⁢23¯"; - test("ja", "SimpleSpeak", expr, "0.1 循環節 2 3")?; - test("ja", "ClearSpeak", expr, "0.1 循環節 2 3")?; + test("ja", "SimpleSpeak", expr, "0.1 循環せつ 2 3")?; + test("ja", "ClearSpeak", expr, "0.1 循環せつ 2 3")?; return Ok(()); } @@ -625,34 +626,47 @@ fn geometry_verbose_from_to() -> Result<()> { return Ok(()); } -/// The measure of an angle is 「角 ABC の大きさ」: Japanese names the angle first. +/// The measure of an angle is 「角 ABC の大きさ」: Japanese names the angle first. 角 is written +/// かく because Open JTalk reads 角 before a pause as スミ (∠ABC = 90° was スミ, ...). /// 「角の大きさ ABC」 kept the English order. #[test] fn measure_of_angle() -> Result<()> { let expr = "xyz"; - test("ja", "ClearSpeak", expr, "角 x y z の大きさ")?; - test_prefs("ja", "ClearSpeak", vec![("Verbosity", "Verbose")], expr, "角 x y z の大きさ")?; - test("ja", "SimpleSpeak", expr, "角 x y z の大きさ")?; + test("ja", "ClearSpeak", expr, "かく x y z の大きさ")?; + test_prefs("ja", "ClearSpeak", vec![("Verbosity", "Verbose")], expr, "かく x y z の大きさ")?; + test("ja", "SimpleSpeak", expr, "かく x y z の大きさ")?; return Ok(()); } -/// The angle-measure intent is said the same way: 角 A の大きさ. +/// ∠ABC = 90° with the letters not grouped: ∠ is followed by a pause, where 角 was read スミ. +/// Two MathType names also ended in a lone 角: the angle one is かく too, and the synthetic +/// division corner is 隅, like the corner brackets ⌜ 左上隅. +#[test] +fn angle_sign_before_a_pause() -> Result<()> { + let expr = "∠ABC=90°"; + test("ja", "ClearSpeak", expr, "かく, おおもじ エー, おおもじ b おおもじ c; イコール 90 度")?; + test("ja", "ClearSpeak", "", "縦線付きノット かく")?; + test("ja", "ClearSpeak", "", "組立除法 隅")?; + return Ok(()); +} + +/// The angle-measure intent is said the same way: かく A の大きさ. #[test] fn angle_measure_intent() -> Result<()> { let expr = "x"; - test("ja", "ClearSpeak", expr, "角 x の大きさ")?; - test("ja", "SimpleSpeak", expr, "角 x の大きさ")?; - // m∠ABC: the operand already says 角, so it is not said twice. + test("ja", "ClearSpeak", expr, "かく x の大きさ")?; + test("ja", "SimpleSpeak", expr, "かく x の大きさ")?; + // m∠ABC: the operand already says かく, so it is not said twice. let angle_arg = "x"; - test("ja", "ClearSpeak", angle_arg, "角 x の大きさ")?; - test("ja", "SimpleSpeak", angle_arg, "角 x の大きさ")?; + test("ja", "ClearSpeak", angle_arg, "かく x の大きさ")?; + test("ja", "SimpleSpeak", angle_arg, "かく x の大きさ")?; let sign_arg = "m∠x"; - test("ja", "ClearSpeak", sign_arg, "角 x の大きさ")?; - test("ja", "SimpleSpeak", sign_arg, "角 x の大きさ")?; - // A silent angle does not say 角 itself, so it is said here. + test("ja", "ClearSpeak", sign_arg, "かく x の大きさ")?; + test("ja", "SimpleSpeak", sign_arg, "かく x の大きさ")?; + // A silent angle does not say かく itself, so it is said here. let silent_arg = "x"; - test("ja", "ClearSpeak", silent_arg, "角 x の大きさ")?; - test("ja", "SimpleSpeak", silent_arg, "角 x の大きさ")?; + test("ja", "ClearSpeak", silent_arg, "かく x の大きさ")?; + test("ja", "SimpleSpeak", silent_arg, "かく x の大きさ")?; // A silent angle-measure says only its operand. let silent_measure = "x"; test("ja", "ClearSpeak", silent_measure, "x")?; @@ -2084,7 +2098,7 @@ fn leaf_intent_uses_intent_mappings() -> Result<()> { ("plus", "エー プラス b"), ("member-of", "エー げんオブ b"), ("factorial", "エー 階乗 b"), - ("angle", "エー 角 b"), + ("angle", "エー かく b"), ("gradient", "エー 勾配 b"), ("not-in-mappings", "エー not in mappings b"), ] {