Skip to content

Japanese: decimals, line breaks and numbers in the speech check - #28

Merged
vincentsch merged 6 commits into
mainfrom
cjk-polish
Oct 13, 2026
Merged

vincentsch merged 6 commits into
mainfrom
cjk-polish

Conversation

@vincentsch

Copy link
Copy Markdown
Owner

Fixes found while making a Japanese example video.

Decimals. misaki, Kokoro's Japanese reader, reads 365.2422 as "365", a pause, and then "two thousand four hundred twenty-two". explainroo now sends 365点二四二二 instead, which reads the digits after the point one by one. Scripts can keep plain digits, with no per-digit overrides.

Line breaks. Subtitle lines, cue breaks and burned-in caption phrases no longer start with:

  • a Japanese particle or verb ending, such as は, ごと, せん or ませんでした,
  • a one-kanji suffix, such as the 暦 of グレゴリオ暦,
  • a counter after its number, such as 年 in 4年 or 天 in 365天,
  • a Chinese particle, such as 的 or 吗.

The rule only applies when the line has a better place to break. Content words written in hiragana, such as うるう年, can still start a line.

Before → after, from the example video:

  • 地球の動きとカレンダー / にズレがたまります。 → 地球の動きとカレンダーに / ズレがたまります。
  • そこで、基本は4 / 年ごとに1日を足します。 → そこで、基本は4年ごとに / 1日を足します。

Numbers in the speech check. UniDic leaves digits unread, so a correctly spoken "365.2422" failed when Whisper wrote 365.24に2. Digits now get their Japanese reading on both sides: サンビャクロクジューゴ, and digit by digit after a decimal point.

AGENTS.md. Speaking rates for Japanese (about 270 characters a minute) and Chinese (about 200). Two readings the Japanese reader gets wrong, with their fix. Notes that check, still, sheet, render and preview also make missing narration, and that pace is approximate.

Tested with npm test (193 pass), new unit tests for each rule, and the Japanese example re-voiced and rendered: 95–100% per scene, 99% in the final mix.

misaki reads 365.2422 as 365, a pause and 2422. Japanese reads the digits
after the point one by one, so explainroo now sends 365点二四二二.

Subtitle lines, cue breaks and burned-in caption phrases no longer start
with a Japanese particle or ending (hiragana after a word) or a Chinese
particle such as 的 or 吗, unless nothing else fits.
@vincentsch
vincentsch merged commit 618c385 into main Oct 13, 2026
4 checks passed
@vincentsch
vincentsch deleted the cjk-polish branch October 13, 2026 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant