Skip to content

Commit 598020b

Browse files
ja: read the array intent as a table (daisy#968)
Japanese had no rule for the array intent, so a table with nothing in front of it was read "array オブ". The table rule now takes array as well as mtable, as en, es and pt do, and its column test gets the missing $ (the same fix as daisy#915 in en). Claude-Session: https://claude.ai/code/session_01PxieeR5Zo8C2XvcgnBBCDc Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 40169f0 commit 598020b

2 files changed

Lines changed: 14 additions & 3 deletions

File tree

‎Rules/Languages/ja/SharedRules/default.yaml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@
423423
- T: "添字終了" # phrase(At this point 'end scripts' occurs)
424424

425425
- name: default
426-
tag: mtable
426+
tag: [mtable, array]
427427
variables:
428428
- IsColumnSilent: "false()"
429429
- NumColumns: "count(*[1]/*) - IfThenElse(*/self::m:mlabeledtr, 1, 0)"
@@ -437,7 +437,7 @@
437437
- T: "および" # phrase(the table with 3 rows 'and' 4 columns)
438438
- x: "$NumColumns"
439439
- test:
440-
if: "NumColumns=1"
440+
if: "$NumColumns=1"
441441
then: [T: "列"] # phrase(the table with 3 rows and 1 'column')
442442
else: [T: "列"] # phrase(the table with 3 rows and 4 'columns')
443443
- T: "の表" # phrase(the 'table with' 3 rows)

‎tests/Languages/ja/ja.rs‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1254,7 +1254,18 @@ fn the_vertical_line_names_the_condition() -> Result<()> {
12541254
#[test]
12551255
fn a_labelled_row_names_its_label() -> Result<()> {
12561256
let expr = "<math><mtable><mlabeledtr><mtd><mn>1</mn></mtd><mtd><mi>x</mi></mtd></mlabeledtr></mtable></math>";
1257-
test("ja", "ClearSpeak", expr, "array オブ; ぎょう 1 ラベルは 1; 列 1; x")?;
1257+
test("ja", "ClearSpeak", expr, "1 ぎょう および 1 列 の表; ぎょう 1 ラベルは 1; 列 1; x")?;
1258+
return Ok(());
1259+
}
1260+
1261+
/// A table with nothing in front of it gets the array intent. It is read as a
1262+
/// table, like the plain mtable, and its rows are not joined by コンマ (#890).
1263+
#[test]
1264+
fn an_unfenced_array_is_read_as_a_table() -> Result<()> {
1265+
let expr = "<math><mtable><mtr><mtd><mi>a</mi></mtd><mtd><mi>b</mi></mtd></mtr>
1266+
<mtr><mtd><mi>c</mi></mtd><mtd><mi>d</mi></mtd></mtr></mtable></math>";
1267+
test("ja", "ClearSpeak", expr, "2 ぎょう および 2 列 の表; ぎょう 1; 列 1; エー, 列 2; b; ぎょう 2; 列 1; c, 列 2; d")?;
1268+
test("ja", "SimpleSpeak", expr, "2 ぎょう および 2 列 の表; ぎょう 1; 列 1; エー, 列 2; b; ぎょう 2; 列 1; c, 列 2; d")?;
12581269
return Ok(());
12591270
}
12601271

0 commit comments

Comments
 (0)