Skip to content

ja: read the remaining fractions denominator-first, and name the menclose marks - #756

Open
yasumorishima wants to merge 4 commits into
daisy:jafrom
yasumorishima:ja-shared-rules-cleanup
Open

ja: read the remaining fractions denominator-first, and name the menclose marks#756
yasumorishima wants to merge 4 commits into
daisy:jafrom
yasumorishima:ja-shared-rules-cleanup

Conversation

@yasumorishima

Copy link
Copy Markdown
Contributor

Two groups of fixes in the shared ja rule files. Everything stays inside Rules/Languages/ja/ and tests/Languages/ja/.

1. Three fraction rules read the fraction backwards

Japanese states the denominator first: 3/4 is "4 分の 3". Numerator-first does not just sound odd, it names a different number — "3 分の 4" is 4/3.

common-fraction in ClearSpeak_Rules.yaml and SimpleSpeak_Rules.yaml already swaps the operands, but three rules were still numerator-first:

  • SharedRules/default.yaml literal-simple (tag mfrac, reached with SpeechStyle=LiteralSpeak, which is also what navigation falls back to in Character mode — src/navigate.rs:588)
  • overview.yaml overview-default (what DescribePrevious/Next/Current speak)

Both now say the denominator first, with the same comment common-fraction carries.

  • SharedRules/default.yaml literal-default has explicit start/end markers, so instead of swapping it keeps the written order and uses the borrowed オーバー — the form Yamaguchi, Kawane & Sawazaki (1996) give for a fraction that is not two plain numbers: 分数 A オーバー B 分数終了. It also opened with スタート, the English word "start".

Note on scope: literal-simple matches any two leaves, so it now says 分の for x/y as well as for 3/4. The cited source reserves 分の for two numbers, but "b 分の a" is ordinary Japanese for a fraction of two symbols too, and this rule has no start/end markers to hang the オーバー form on.

2. Names that were still the machine translation

SharedRules/default.yaml, menclose:

notation was now why
uparrow 上下矢印 上矢印 上下矢印 is an arrow with a head at each end
downarrow ダウン矢印 下矢印 half English
updownarrow ダブルエンド垂直矢印 上下矢印 the name unicode-full.yaml:558 already gives ↕
leftrightarrow ダブルエンド水平矢印 左右矢印 the name unicode-full.yaml:557 already gives ↔
northeastsouthwestarrow ダブルは対角矢印を終了 北東・南西矢印 "double is ends diagonal arrow" is not a sentence; the name is unicode-full.yaml:1824 for ⤢
northwestsoutheastarrow 二重は対角矢印を終了 北西・南東矢印 same, unicode-full.yaml:1823 for ⤡
updiagonalstrike 対角形 右上がり方向 "diagonal shape" does not say which diagonal; 方向 matches the 垂直方向 / 水平方向 beside it
downdiagonalstrike ダウンの対角 右下がり方向 half English
crossout クロスアウト 取り消し線
box / roundedbox / circle ボックス / ラウンドボックス / サークル 四角 / 角丸の四角 / 円
empty box 空の箱 空の四角 so that "box" is one word in this file
actuarial 行動シンボル 保険数理記号 行動シンボル is an "action symbol"
madrub アラビア語の要素のシンボル アラビア文字の階乗記号 reads "Arabic-language element symbol"; madrub is the factorial symbol written in Arabic script
longdiv ロングディビジョンシンボル 割り算の筆算の記号

Also in SharedRules/default.yaml, the mover and munderover rules said 詳しくはこちら for "above". That is the web phrase "click here for details"; the word wanted is 上, the partner of the 下 already in the rule beside it.

And three single words:

  • SharedRules/linear-algebra.yaml — ノルダム is Notre-Dame. A norm is ノルム.
  • SharedRules/general.yaml 1x1-matrix — エントリー → 成分, the term for a matrix entry.
  • SharedRules/general.yaml default-point and unicode.yaml . — ポイント → 点, which is what geometry.yaml:71 already says for a coordinate and what a Japanese reader says for a decimal point.

Checks

  • audit-translations ja: Untranslated text 3493 → 3462. That is exactly −31, the number of lines promoted from t: to T: after checking each against the en line beside it. Missing rules 0, extra rules 0, and Rule differences 28 → 28, i.e. swapping the two operands did not make the rules diverge structurally from en.
  • 10 tests added: both fraction paths, the overview path, the menclose strikes / shapes / long division / arrows, above and below, the norm, the matrix entry and the coordinate. Every expected string is the actual output.
  • The . character rule in unicode.yaml is the one change with no test: I could not build MathML that reaches its parent::*[1][self::m:mn] branch — a plain <mn>3.5</mn> is spoken as one token.
  • The 分の lines in ClearSpeak_Rules.yaml and SimpleSpeak_Rules.yaml are promoted to T: as well, so the word is not verified in two files and unverified in two others.

Left alone on purpose

  • unicode-full.yaml, waiting for the MathPlayer seed.
  • navigate.yaml, which Translate the Japanese navigation command prefixes #752 is already touching. I checked that the two branches merge cleanly in either order and give the same tree.
  • phasorangle (フェーザの角度) and the single compass arrows (北東矢印 etc.) are literal but not wrong, so I left them.
  • The relation symbols in unicode.yaml are inconsistent — < is 小なり but > is より大きい, and is 要素の where the source gives 要素オブ. That is a separate theme and will be a separate PR.

…lose marks

Two groups of fixes in the shared rule files.

1. Three fraction rules read the fraction backwards. Japanese puts the
   denominator first: 3/4 is "4 分の 3", so "3 分の 4" is 4/3 -- a different
   number, not just an odd phrasing. ClearSpeak and SimpleSpeak already swap
   the operands (common-fraction), but the mfrac rules in SharedRules/default.yaml
   (used by LiteralSpeak) and the fraction rule in overview.yaml (used by the
   "describe" navigation command) did not.
   - literal-simple and overview-default now say the denominator first.
   - literal-default has explicit start/end markers, so it keeps the written
     order and uses the borrowed オーバー: 分数 A オーバー B 分数終了. It also
     opened with スタート, the English "start".

2. menclose notation names and two neighbouring rules were still the machine
   translation:
   - 上下矢印 for "up arrow" is an arrow with a head at each end, so uparrow,
     updownarrow, leftrightarrow and both diagonal double ended arrows all
     named the same thing.
   - ダブルは対角矢印を終了 / 二重は対角矢印を終了 ("double is ends diagonal
     arrow") are not sentences.
   - 行動シンボル is an "action symbol"; the actuarial symbol is 保険数理記号.
   - アラビア語の要素のシンボル reads "Arabic-language element symbol"; madrub
     is the factorial symbol written in Arabic script.
   - クロスアウト, ダウン矢印, ダウンの対角, サークル, ラウンドボックス, ボックス and
     ロングディビジョンシンボル are transliterations of the English.
   - 対角形 does not say which diagonal.
   - 詳しくはこちら ("click here for details") was used for "above" in the mover
     and munderover rules, opposite the 下 that is already there.
   - ノルダム is Notre-Dame; a norm is ノルム.
   - エントリー for a matrix entry is 成分, and a coordinate is 点, the word
     geometry.yaml already uses.

Every line that was checked against the en rule beside it is promoted to T:.
Tests cover both fraction paths, the overview path, the menclose marks, above
and below, the norm and the matrix entry.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

1 participant