/** * Topic token tuple shape used by downstream ranking logic: * [term, termCategory, uniqueness, metadata] */ export type TopicToken = [string, number, number, string]; /** * Trie structure for phrase completion lookup keyed by first two letters, then full token. */ type PhraseEntry = [string | null, number, number]; export type PhrasesModel = Record>; export interface ConvertTextToTokensOptions { phrasesModel: PhrasesModel; typosModel?: Record; checkTypos?: 0 | 1; ignoreStopWords?: 0 | 1; checkRootWords?: 0 | 1; } /** * @typedef {Object} Token * @property {number} termCategory - The category of the term * @property {number} uniqueness - The uniqueness score of the term * @property {string} term - The actual term or phrase */ /** * ### Convert Text Query to Topic Phrase Tokens * * * Returns a list of phrases that are found in Wiki Titles/ dictionary phrases World Model * that match the input phrase, or just the single word if found. Search results will be * more accurate if we infer likely phrases and search for those words occuring together and * not just split into words and find frequency. Examples are "white house" or "state of the art" * which should be searched as a phrase but would return different context if split into words. * As Led Zeppelin famously put it: \u266b "'Cause you know sometimes words have two meanings." * * @param {string} phrase * @param {Object} [options] * @param {Object} options.phrasesModel - remote model * @param {Object} options.typosModel - remote model * @param {number} options.checkTypos - check for typos * @param {number} options.ignoreStopWords - ignore 300+ overused words * @param {number} options.checkRootWords - check for word's root stem * @returns {Array<{termCategory: number, uniqueness: number, term: string}>} * @example * const result = convertTextToTokens("The president of the united states is in the white house", { phrasesModel, typosModel }); * console.log(result); * * @author [vtempest (2025)](https://github.com/vtempest) * @category Topics */ export declare function convertTextToTokens(phrase: string, options?: Partial): TopicToken[]; export {};