/** * Text normalizer — comprehensive l33t speak decoder, diacritics stripper, * separator remover, and obfuscation handler. * * Algorithm: Single-pass greedy longest-match for multi-char sequences, * followed by single-char substitution, repeat collapse, and separator strip. * * Performance: O(n) for single-char, O(n * maxSeqLen) for multi-char where * maxSeqLen is bounded at 4. Pre-sorted sequences by length (longest first) * ensure greedy matching is correct. */ /** * Fold Unicode obfuscations into ASCII-equivalent forms while tracking the * original-string index of every output character. This is the front door for * detection: tokenization and matching run on the folded text, then result * positions are mapped back to the original via the returned indexMap. * * Folds applied (per codepoint): * - Confusables: Cyrillic/Greek letters that visually impersonate Latin * (e.g. Cyrillic 'а' U+0430 → 'a'). * - NFKC compatibility decomposition: fullwidth (Fuck → Fuck), * mathematical alphanumeric (𝐟𝐮𝐜𝐤 → fuck), ligatures (fi → fi), etc. * * The indexMap has length `folded.length + 1`. For any folded slice * [start, end), the corresponding original slice is * [indexMap[start], indexMap[end]). * * Fast path: pure-ASCII input returns an identity index map without entering * the per-codepoint loop. Callers that already detect ASCII can skip this * entirely. */ export declare function unicodeFold(input: string): { text: string; indexMap: number[]; }; /** * Normalize a string by applying all transformations. * Returns the cleaned, lowercase form. * * Pipeline: * 1. Lowercase * 2. Strip invisible unicode * 3. Replace multi-char l33t sequences (greedy longest-first) * 4. Replace single-char substitutions * 5. Collapse repeated characters (3+ → 2) * 6. Strip separators between chars */ export declare function normalize(input: string): string; /** * Generate multiple normalized variants for broader matching. */ export declare function normalizeVariants(input: string): string[];