Detect sequences of consecutive BIP39 mnemonic words in text content.
Returns violations where threshold or more consecutive BIP39 words appear.
Detection operates in two modes:
Single-line: finds sequences of BIP39 words within a line (handles mixed content).
Cross-line: accumulates words across consecutive "BIP39-pure" lines (where every
non-skip token is a BIP39 word). Blank or whitespace-only lines are transparent and do
not break the sequence. Catches one-per-line, numbered lists, formatted blocks, and grids.
Tokens are stripped of surrounding punctuation (quotes, commas, brackets, etc.)
before matching. Interior punctuation (hyphens, apostrophes) still disqualifies a token.
Purely non-alphabetic tokens (like "1.", "2)", "//") are skipped without breaking a sequence.
Parameters
content: string
The text content to scan for BIP39 sequences.
threshold: number = DEFAULT_THRESHOLD
Minimum number of consecutive BIP39 words to trigger a violation (default: DEFAULT_THRESHOLD).
Detect sequences of consecutive BIP39 mnemonic words in text content. Returns violations where
thresholdor more consecutive BIP39 words appear.Detection operates in two modes:
Tokens are stripped of surrounding punctuation (quotes, commas, brackets, etc.) before matching. Interior punctuation (hyphens, apostrophes) still disqualifies a token. Purely non-alphabetic tokens (like "1.", "2)", "//") are skipped without breaking a sequence.