@juspay/neurolink
Version:
The pipe layer of an AI nervous system: one interface connecting provider neurons to your application, across three inference types — generate, stream and decide. `decide` returns typed, calibrated judgements from a non-generative model (~400ms, ~$0.00002
33 lines (32 loc) • 1.39 kB
TypeScript
/**
* Deterministic text normalization for knowledge grounding.
*
* The SAME normalizer runs at index-build time and query time so that a
* configuration key, a technical identifier, and a user's phrasing all
* collapse to the same comparable token stream:
*
* "Multi-Step Flow" -> "multi step flow"
* "enableMultiStepFlow" -> "enable multi step flow"
* "ACCOUNT_STATUS" -> "account status"
* " Access Policy " -> "access policy"
*
* The pipeline is intentionally conservative: it splits identifiers and
* separators and folds case/diacritics, but it NEVER invents synonyms.
* Reviewed acronym and spelling expansions belong in an entry's `aliases`,
* not in this function.
*/
/**
* Normalize an arbitrary string into a single space-delimited lowercase
* phrase. Idempotent: `normalizeText(normalizeText(x)) === normalizeText(x)`.
*/
export declare const normalizeText: (input: string) => string;
/**
* Normalize then split into tokens. Empty input yields an empty array.
* Numbers and alphanumeric identifiers are preserved as their own tokens.
*/
export declare const tokenize: (input: string) => string[];
/**
* Normalize each candidate phrase and drop blanks/duplicates while preserving
* first-seen order. Used to build the exact-key and alias key sets.
*/
export declare const normalizePhrases: (phrases: string[]) => string[];