/** * @fileoverview Field name ranking for ranked invalid-field suggestions. * * Blends token-set overlap (split on `.`/`_`) with Jaro-Winkler similarity. * Zero dependencies. Designed for short structured identifiers like OpenAlex * field names — not document-search use cases. * * @module services/openalex/field-ranker */ /** * Return the top-N candidate field names from `pool` ranked by similarity * to `query`. Results are ordered by score descending. * * Zero-scoring candidates are dropped — this backs the "did you mean" line on an * invalid-field error, where a candidate sharing nothing with the rejected name is noise. * To browse a whole pool, use `rankAllFields`: a lexical scorer cannot rank a nested leaf * against its parent, so filtering there removes the answer instead of deprioritizing it. * * @param query - The rejected field name submitted by the caller. * @param pool - All valid field names for this entity_type + context. * @param topN - Maximum number of suggestions to return. Default 5. */ export declare function rankFields(query: string, pool: string[], topN?: number): string[]; /** * Rank the entire `pool` against `query`, retaining every member. Zero-scoring candidates * sort last rather than being dropped: a query reorders the pool, it does not reduce it. * * @param query - The partial or guessed field name submitted by the caller. * @param pool - All valid field names for this entity_type + context. */ export declare function rankAllFields(query: string, pool: string[]): string[]; //# sourceMappingURL=field-ranker.d.ts.map