/** * Text handling shared by the loader, the builder, and every store. * * Two jobs live here. One is normalising a name so a reader's spelling reaches * the printed one. The other is turning a reader's whole question into a query * the full-text index will accept. */ /** * Fold a name to a lookup key: "Draven, Vanquisher" becomes "draven vanquisher". * * Readers type names without the accent, without the apostrophe, and with the * punctuation they happen to reach for. Folding all three away is what lets one * stored key answer every spelling of the same name. */ export declare function normalizeName(value: unknown): string; /** Fold a rule number: "103.1.B.2" becomes "103.1.b.2". */ export declare function normalizeRuleNumber(value: unknown): string; /** * Fold a whole question for exact-match caching. * * Conservative on purpose. It collapses the variants that mean the same thing — * a trailing question mark, a stray capital, a doubled space — and merges * nothing else. Two questions that fold together are served the same answer, so * a rule that folded too hard would hand one reader another reader's answer. */ export declare function normalizeQuestion(value: unknown): string; /** Split text into index-shaped tokens. A rule number stays one token. */ export declare function tokenize(value: unknown): string[]; /** * Turn a reader's question into an FTS5 MATCH expression, or null. * * Two things make this necessary rather than optional. FTS5 reads bare * punctuation as its own query syntax, so an unescaped question mark or hyphen * is a syntax error that throws instead of returning nothing. And a reader's * question is a sentence, not a query, so the words are joined with OR and the * ranking decides which document wins. * * Returns null when nothing searchable is left. A caller must treat that as "no * results", never as "match everything". */ export declare function ftsQuery(question: unknown): string | null; /** * The name a printed card is filed under, before any epithet. * * "Master Yi, Wuju Bladesman" files under "master yi". The comma is the boundary * a reader names a character at, and it is the only prefix treated as a name in * its own right. Without this a reader who types the character name matches no * printed card at all. */ export declare function nameStem(printedName: unknown): string; //# sourceMappingURL=text.d.ts.map