diff --git a/Rules/Languages/ja/ClearSpeak_Rules.yaml b/Rules/Languages/ja/ClearSpeak_Rules.yaml
index 54bee5a9..879f249c 100644
--- a/Rules/Languages/ja/ClearSpeak_Rules.yaml
+++ b/Rules/Languages/ja/ClearSpeak_Rules.yaml
@@ -468,14 +468,13 @@
if: "$Verbosity!='Terse'"
then: [ot: ""] # phrase('the' absolute value of 25)
- x: "$WordToSay"
- - t: "の" # phrase(the absolute value 'of' 25)
- x: "*[1]"
- test:
if: "$ClearSpeak_AbsoluteValue = 'AbsEnd'"
then:
- pause: short
- - t: "リリース" # phrase('end' absolute value)
- x: "$WordToSay"
+ - t: "閉じ" # phrase('end' absolute value)
- pause: short
- name: set
diff --git a/Rules/Languages/ja/unicode.yaml b/Rules/Languages/ja/unicode.yaml
index 808dc0bc..a5cd4ef9 100644
--- a/Rules/Languages/ja/unicode.yaml
+++ b/Rules/Languages/ja/unicode.yaml
@@ -84,16 +84,16 @@
if: $SpeechStyle = 'ClearSpeak' or $SpeechStyle = 'SimpleSpeak'
then_test:
if: "$Verbosity='Terse'"
- then: [t: "開き"] # 0x28
- else: [t: "開き丸括弧"] # 0x28
+ then: [t: "括弧"] # 0x28
+ else: [t: "丸括弧"] # 0x28
else: [t: "左丸括弧"] # 0x28
- ")": # 0x29
- test:
if: $SpeechStyle = 'ClearSpeak' or $SpeechStyle = 'SimpleSpeak'
then_test:
if: "$Verbosity='Terse'"
- then: [t: "閉じ"] # 0x29
- else: [t: "閉じ丸括弧"] # 0x29
+ then: [t: "括弧閉じ"] # 0x29
+ else: [t: "丸括弧閉じ"] # 0x29
else: [t: "右丸括弧"] # 0x29
- "*": # 0x2a
@@ -155,14 +155,14 @@
- "[": # 0x5b
- test:
if: $SpeechStyle = 'ClearSpeak' or $SpeechStyle = 'SimpleSpeak'
- then: [t: "オープンブラケット"]
- else: [t: "左ブラケット"]
+ then: [t: "角括弧"]
+ else: [t: "左角括弧"]
- "\\": [t: "バックスラッシュ"] # 0x5c
- "]": # 0x5d
- test:
if: $SpeechStyle = 'ClearSpeak' or $SpeechStyle = 'SimpleSpeak'
- then: [t: "クローズブラケット"]
- else: [t: "右ブラケット"]
+ then: [t: "角括弧閉じ"]
+ else: [t: "右角括弧"]
- "^": # 0x5e
- test:
if: "parent::m:modified-variable or parent::m:mover"
@@ -173,8 +173,8 @@
- "{": # 0x7b
- test:
if: $SpeechStyle = 'ClearSpeak' or $SpeechStyle = 'SimpleSpeak'
- then: [t: "オープンブレイス"]
- else: [t: "左の括弧"]
+ then: [t: "中括弧"]
+ else: [t: "左中括弧"]
- "|": # 0x7c
# note: for ClearSpeak and SimpleSpeak, "|" inside of sets is handled at the mrow level, same for 'sets'
- with:
@@ -202,8 +202,8 @@
- "}": # 0x7d
- test:
if: $SpeechStyle = 'ClearSpeak' or $SpeechStyle = 'SimpleSpeak'
- then: [t: "クローズ ブラス"]
- else: [t: "右括弧"]
+ then: [t: "中括弧閉じ"]
+ else: [t: "右中括弧"]
- "~": [t: "チルド"] # 0x7e
- " ": # 0xa0
diff --git a/tests/Languages/ja/ja.rs b/tests/Languages/ja/ja.rs
index 50ac7a48..8a19e38b 100644
--- a/tests/Languages/ja/ja.rs
+++ b/tests/Languages/ja/ja.rs
@@ -125,7 +125,18 @@ fn multiplication_and_division() -> Result<()> {
#[test]
fn parenthesized_expression() -> Result<()> {
let expr = "";
- test("ja", "ClearSpeak", expr, "開き丸括弧, 1 プラス 2, 閉じ丸括弧")?;
+ test("ja", "ClearSpeak", expr, "丸括弧 1 プラス 2, 丸括弧閉じ")?;
+ return Ok(());
+}
+
+/// Square and curly brackets follow the same pattern: the opening bracket names
+/// the shape and the closing one adds the postposed cue (Yamaguchi et al. 1996).
+#[test]
+fn square_and_curly_brackets() -> Result<()> {
+ let square = "";
+ test("ja", "ClearSpeak", square, "角括弧 1 プラス 2, 角括弧閉じ")?;
+ let curly = "";
+ test("ja", "ClearSpeak", curly, "中括弧 1 プラス 2, 中括弧閉じ")?;
return Ok(());
}
@@ -133,7 +144,16 @@ fn parenthesized_expression() -> Result<()> {
#[test]
fn absolute_value() -> Result<()> {
let expr = "";
- test("ja", "ClearSpeak", expr, "絶対値 の x")?;
+ test("ja", "ClearSpeak", expr, "絶対値 x")?;
+ return Ok(());
+}
+
+/// With AbsEnd the closing cue is spoken after the contents, not before it, so
+/// the bar that ends the group is heard where it actually is.
+#[test]
+fn absolute_value_abs_end() -> Result<()> {
+ let expr = "";
+ test_ClearSpeak("ja", "ClearSpeak_AbsoluteValue", "AbsEnd", expr, "絶対値 x, 絶対値 閉じ")?;
return Ok(());
}