hunspell-reader
Version:
A library for reading Hunspell Dictionary Files
38 lines • 1.34 kB
TypeScript
import { Aff } from './aff.js';
import type { AffInfo, Fx } from './affDef.js';
import { Aff as AffLegacy } from './affLegacy.js';
export interface ConvEntry {
from: string;
to: string;
}
declare function tablePfxOrSfx(fieldValue: Afx | undefined, line: AffLine): Afx;
interface AffixRule {
type: 'PFX' | 'SFX';
flag: string;
stripping: string;
replace: RegExp;
affix: string;
condition: RegExp;
extra?: string;
}
/**
* `PFX|SFX flag stripping prefix [condition [morphological_fields...]]`
*/
declare function parseAffixRule(line: AffLine): AffixRule | undefined;
export declare function parseAffFile(filename: string, encoding?: string): Promise<AffInfo>;
export declare function parseAff(affFileContent: string, encoding?: string): AffInfo;
export declare function parseAffFileToAff(filename: string, encoding?: string): Promise<Aff>;
export declare function parseAffFileToAffLegacy(filename: string, encoding?: string): Promise<AffLegacy>;
declare function parseLine(line: string): AffLine;
export interface AffLine {
option: string;
value: string | undefined;
}
type Afx = Map<string, Fx>;
export declare const testing: {
parseAffixRule: typeof parseAffixRule;
tablePfxOrSfx: typeof tablePfxOrSfx;
parseLine: typeof parseLine;
};
export {};
//# sourceMappingURL=affReader.d.ts.map