feat(analyzer): add Korean bank account number recognizer (KR_BANK_ACCOUNT) - #2215
Open
juno-junho wants to merge 3 commits into
Open
juno-junho wants to merge 3 commits into
juno-junho wants to merge 3 commits into
Conversation
juno-junho
force-pushed
the
feat/kr-bank-account-recognizer
branch
2 times, most recently
from
August 4, 2026 14:20
f9e3479 to
5d13e54
Compare
juno-junho
force-pushed
the
feat/kr-bank-account-recognizer
branch
from
August 14, 2026 01:03
5d13e54 to
4a82249
Compare
…gnizer entry The recognizer instructions (data-privacy-stack#2211) require language codes, not country codes, in supported_languages. The neighbouring Kr* entries still carry kr and are left for a separate change.
…_BANK_ACCOUNT Per the recognizer instructions (data-privacy-stack#2211): the shipped entry is enabled, loaded through RecognizerRegistryProvider and exercised through AnalyzerEngine with a no-op Korean engine; a negative case pins that leaving the top-level supported_languages at the shipped default loads nothing; the Korean context words are shown to boost the score through the explicit context argument; and context text on either side of the match is covered.
Contributor
Author
|
Brought this in line with the recognizer instructions from #2211: a configuration-path test through |
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.
Change Description
Add
KrBankAccountRecognizer(entityKR_BANK_ACCOUNT) undercountry_specific/korea/, registered in the predefined recognizer exports,default_recognizers.yaml(disabled by default,country_code: kr) and the supported entities docs.Korean bank account numbers had no coverage. The patterns are ported from a production Korean PII-masking deployment, with conservative scores (no checksum exists for Korean accounts) and negative lookaheads for phone (010/070), RRN and date look-alikes. Plain 13-digit runs are deliberately left to KR_RRN's domain.
Tests: positive cases assert the best-scoring match per layout (the patterns overlap by design), and a look-alike table asserts zero matches for Korean phone numbers, RRN shapes, dates and short digit runs. The full analyzer suite (3047 tests) and
ruff checkpass.Issue reference
Fixes #2214
Checklist
Update: aligned with the recognizer instructions from #2211
RecognizerRegistryProviderand exercised throughAnalyzerEnginewith a no-op Korean engine, asserting detection with the same score as direct construction. A negative case pins the instructions' warning: leaving the top-levelsupported_languagesat the shipped["en"]loads nothing, with no error. Enabling this entry therefore needskoin the top-level languages (and in the NLP and analyzer engine languages).contextargument (0.6 to 0.95), the same routetest_context_supportuses, since text-derived context needs a Korean NLP model the test environment does not ship. Context text on either side of the match is also covered at the pattern level.koonly (ISO 639-1), in its own commit. The neighbouringKr*entries still carrykr, which fix(analyzer): remove a non-language code and a duplicate entry from default_recognizers.yaml #2236 traces back to a deliberate backward-compatibility alias from fix(analyzer): update Korean language code from 'kr' to 'ko' #1742 for recognizers whose class default used to bekr; this recognizer has only ever defaulted toko, so there is no configuration that could depend onkrhere. fix(analyzer): remove a non-language code and a duplicate entry from default_recognizers.yaml #2236 handles the existing entries.