d11 theme
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

23 lines
1.4 KiB

import { TrieNode } from './TrieNode';
import { CompoundWordsMethod } from './walker';
export { CompoundWordsMethod, JOIN_SEPARATOR, WORD_SEPARATOR } from './walker';
export declare type Cost = number;
export declare type MaxCost = Cost;
export interface SuggestionResult {
word: string;
cost: Cost;
}
export declare type SuggestionIterator = Generator<SuggestionResult, any, MaxCost | undefined>;
export declare function suggest(root: TrieNode, word: string, maxNumSuggestions?: number, compoundMethod?: CompoundWordsMethod, numChanges?: number): SuggestionResult[];
export declare function genSuggestions(root: TrieNode, word: string, compoundMethod?: CompoundWordsMethod): SuggestionIterator;
export declare function genCompoundableSuggestions(root: TrieNode, word: string, compoundMethod: CompoundWordsMethod): SuggestionIterator;
export declare function compSuggestionResults(a: SuggestionResult, b: SuggestionResult): number;
export interface SuggestionCollector {
collect: (src: SuggestionIterator) => void;
add: (suggestion: SuggestionResult) => SuggestionCollector;
readonly suggestions: SuggestionResult[];
readonly maxCost: number;
readonly word: string;
readonly maxNumSuggestions: number;
}
export declare function suggestionCollector(wordToMatch: string, maxNumSuggestions: number, filter?: (word: string) => boolean, changeLimit?: number): SuggestionCollector;