@dcoffey/espells
Version:
Pure JS/TS spellchecker, using Hunspell dictionaries. Based on Spylls.
31 lines (30 loc) • 1.08 kB
TypeScript
import type { PhonetTable } from "../aff/phonet-table.js";
import type { Word } from "../dic/word.js";
/**
* Builder for phonetic suggestions.
*
* @see {@link PhonetTable}
*/
export declare class PhonetSuggestionBuilder {
/** The misspelling that suggestions are being built for. */
private misspelling;
/** A metaphone transformed version of the misspelling. */
private misspellingPH;
/** The {@link PhonetTable} being used to build suggestions. */
private table;
/** The list of scores and guesses being assembled. */
private scores;
/**
* @param misspelling - The misspelling to build suggestions for.
* @param table - The {@link PhonetTable} to use.
*/
constructor(misspelling: string, table: PhonetTable);
/**
* Steps the builder forward by providing another {@link Word} to process.
*
* @param word - The {@link Word} to process.
*/
step(word: Word): void;
/** Finishes the builder and yields the resulting suggestions (as strings). */
finish(): Generator<string, void, unknown>;
}