@dcoffey/espells
Version:
Pure JS/TS spellchecker, using Hunspell dictionaries. Based on Spylls.
19 lines (18 loc) • 888 B
TypeScript
import type { AffixForm } from "./forms.js";
import { LKFlags } from "./lk-flags.js";
import type { LKWord } from "./lk-word.js";
/**
* Yields the allowed {@link AffixForm}s for this word, as in all ways the
* word can be split into stems and affixes, with all stems and affixes
* being mutually compatible.
*/
export declare function affixForms(word: LKWord, allowNoSuggest?: boolean, withForbidden?: boolean, flags?: LKFlags): Generator<AffixForm, void, unknown>;
/**
* Determines if this form is valid for the {@link LKWord} specified.
*
* @param word - The word to validate against.
* @param allowNoSuggest - If false, words which are in the dictionary, but
* are flagged with the `NOSUGGEST` flag (if provided), will not be
* considered correct. Defaults to true.
*/
export declare function validForm(form: AffixForm, word: LKWord, allowNoSuggest?: boolean): boolean;