Repository navigation
fix(financial_services): handle Japanese and Korean amounts and respellings - #89
Merged
Merged
Conversation
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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed and why
Three fixes so a Japanese or Korean
financial_servicesbank writes, checks and respells amounts and terms the way those languages do. Three commits: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
jaorkonumber format,format_amountwrites1,234,567円and-50,000원, where it wrote円1,234,567.00. A fractional amount keeps its two decimals, and percentages keep the0.25%form both languages use.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 is1억 5,000만 원.validate-assetsnow accepts these renderings of a typed value, as it accepts lakh and crore, and still fails a different value.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 inXATMカード.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 smokeandmake testexit 0 at all three commits.make testreports 4379, 4380 and 4381 passed.make check-distandmake check-extensionsexit 0 at all three commits.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 onmain.usersim validate-assets --domain financial_servicesreports identical results for all six banks at every commit. Across all 30 finance corpora (13,310 titles and bodies), theen_GBrespellings give the same matches and rewrites as onmain.make health-checkwasn'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.