Skip to content

rankWords beta ​

Function of @v12-engine/client/kit

ts
export declare function rankWords(query: string | readonly string[], label: string, all?: string): number | undefined;

How well a thing matches the words typed, the lower the better: 0 its label is the words, 1 it starts with them, 2 each word starts a word of its label, 3 the words are only somewhere in what it says of itself (all: its label and the rest), 4 and up a word is only nearly there (a typo: the nearer the lower); none when a word is nowhere near. rankBy for a list (faster, by far, for thousands: it keeps the words it read), fuzzyRank for the letters that matched