Skip to content

fix(financial_services): handle Japanese and Korean amounts and respellings - #89

Merged
3mei merged 3 commits into
mainfrom
yev/fix/ja-ko-amounts-and-respell
Oct 23, 2026
Merged

3mei merged 3 commits into
mainfrom
yev/fix/ja-ko-amounts-and-respell

Conversation

@3mei

@3mei 3mei commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

What changed and why

Three fixes so a Japanese or Korean financial_services bank writes, checks and respells amounts and terms the way those languages do. Three commits:

  1. Yen and won are whole amounts with the unit after. Neither currency has a minor unit, and both languages write it straight after the number. For a ja or ko number format, format_amount writes 1,234,567円 and -50,000원, where it wrote 円1,234,567.00. A fractional amount keeps its two decimals, and percentages keep the 0.25% form both languages use.

  2. The numeric check reads units of 10^4. Japanese and Korean count large amounts in 万/만 (10^4) and 億/억 (10^8): ten million yen is 1,000万円, and 150 million won is 1억 5,000만 원. validate-assets now accepts these renderings of a typed value, as it accepts lakh and crore, and still fails a different value.

  3. Respelled forms are found inside Japanese and Korean text. Japanese runs words together and Korean writes particles onto them (직불카드를), so a form in either script was missed wherever another word or a particle touched it. An edge of a form in Japanese or Korean script now matches whatever character it meets, and any other edge still needs a word boundary: ATMカード is found in 新しいATMカードが but not in XATMカード.

How it was verified

Each commit passes on its own:

  • uv lock --check, make check-all, make check-license-headers, make check-doc-links, make check-notebooks-clean, make smoke and make test exit 0 at all three commits. make test reports 4379, 4380 and 4381 passed.
  • make check-dist and make check-extensions exit 0 at all three commits.
  • New tests cover yen and won amounts through Institution.format_money, including a negative and a fractional amount, with percentages unchanged; 万, 億, 만, 억 and 천만 renderings counting as faithful, with a different value in the same form still failing; and respelled forms found and rewritten inside Japanese and Korean words, with a Latin edge still needing a word boundary. Each new test fails on main.
  • Shipped banks are unaffected. usersim validate-assets --domain financial_services reports identical results for all six banks at every commit. Across all 30 finance corpora (13,310 titles and bodies), the en_GB respellings give the same matches and rewrites as on main.

make health-check wasn't run: the change makes no model calls.

Results impact

None for the shipped banks: money formatting, validation results and respelling are unchanged in every one of them.

3mei added 3 commits October 23, 2026 18:38
Yen and won have no minor unit, and Japanese and Korean write the
currency straight after the number. For a ja or ko number format,
format_amount now writes 1,234,567円 and -50,000원, where it wrote
円1,234,567.00. A fractional amount keeps its two decimals (1,234.50円),
and percentages keep the form both languages already use (0.25%).

Every shipped bank formats money as before.

Signed-off-by: Yev Meyer <[email protected]>
Japanese and Korean count large amounts in units of 10^4 (万, 만) and
10^8 (億, 억): ten million yen is 1,000万円, and 150 million won is
1억 5,000만 원. The numeric faithfulness check now accepts these
renderings of a typed value, as it accepts lakh and crore, and still
fails a different value: 2,000万円 is no evidence of 10,000,000.

validate-assets reports the same results for every shipped bank.

Signed-off-by: Yev Meyer <[email protected]>
A respelled form matched only where no letter or digit touched either
end. Japanese runs words together and Korean writes particles onto them
(직불카드를), so a form in either script was missed wherever another
word or a particle touched it. An edge of a form in Japanese or Korean
script now matches whatever character it meets, and any other edge
still needs a word boundary: ATMカード is found in 新しいATMカードが but
not in XATMカード.

Every shipped corpus gives the same matches and rewrites as before.

Signed-off-by: Yev Meyer <[email protected]>
@3mei
3mei requested a review from a team as a code owner October 23, 2026 22:39
@3mei
3mei merged commit 2385c3c into main Oct 23, 2026
12 checks passed
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