type OpType = "MATCH" | "INSERT" | "DELETE" | "SUBSTITUTE"; declare const OP_TYPES: ["MATCH", "INSERT", "DELETE", "SUBSTITUTE"]; type Slice = [number, number]; /** Class representing an operation with its type and cost. */ declare class Alignment { opType: OpType; refSlice: Slice | null; hypSlice: Slice | null; ref: string | null; hyp: string | null; leftCompound: boolean; rightCompound: boolean; constructor(opType: OpType, refSlice?: Slice | null, hypSlice?: Slice | null, ref?: string | null, hyp?: string | null, leftCompound?: boolean, rightCompound?: boolean); /** Return the hypothesis with compound markers if applicable. */ get hypWithCompoundMarkers(): string | null; toString(): string; } /** * Generate all possible combinations of operation types, except the empty set. * * @returns All possible combinations of operation types. */ declare function opTypePowerset(): IterableIterator[]>; declare function reversed(iterable: Iterable): T[]; declare const START_DELIMITER = "<"; declare const END_DELIMITER = ">"; declare const DELIMITERS: Set; declare const OP_TYPE_MAP: { DELETE: "DELETE"; MATCH: "MATCH"; INSERT: "INSERT"; SUBSTITUTE: "SUBSTITUTE"; }; declare const OP_TYPE_COMBO_MAP: Record; declare function getOpTypeComboIndex(ops: OpType[]): number; declare const NUMERIC_TOKEN = "\\p{N}+([,.]\\p{N}+)*(?=\\s|$)"; declare const STANDARD_TOKEN = "[\\p{L}\\p{N}]+(['][\\p{L}\\p{N}]+)*'?"; /** * Check if the normalized character is a vowel. * * @param c The character to check. * @returns True if the character is a vowel, false, otherwise. */ declare function isVowel(c: string): boolean; /** * Check if the normalized character is a consonant. * * @param c The character to check. * @returns True if the character is a consonant, false, otherwise. */ declare function isConsonant(c: string): boolean; /** * Categorize a character as 'vowel', 'consonant', or 'unvoiced'. * * @param c The character to check. * @returns The category of the character. */ declare function categorizeChar(c: string): number; /** * Default tokenizer that splits text into words based on whitespace. * * @param text The input text to tokenize. * @returns A list of tokens (words). */ declare function basicTokenizer(text: string): RegExpMatchArray[]; /** * Default normalizer that only converts text to lowercase. * * @param text The input text to normalize. * @returns The normalized text. */ declare function basicNormalizer(text: string): string; /** * Decorator to ensure that the normalizer preserves the length of the input text. * * @param normalizer The normalizer function to wrap. * @returns The wrapped normalizer that preserves length. */ declare function ensureLengthPreservation(normalizer: (text: string, ...args: Args) => string): (text: string, ...args: Args) => string; /** * Unpack a regex match array to extract the matched string. * * @param tokenizer A function to tokenize the sequences. Must be regex-based and return match arrays. * @returns A function that unpacks a list of match arrays into tuples (match string, span). */ declare function unpackRegexMatch(tokenizer: (text: string, ...args: Args) => RegExpMatchArray[]): (text: string, ...args: Args) => [string, [number, number]][]; /** * Translate a slice from the alignment sequenc back to the original sequenc. * * @param segmentSlice The slice in the alignment sequence * @param indexMap The mapping from alignment indices to original sequence indices. * @returns The translated slice in the original sequence, or None if no valid indices. */ declare function translateSlice(segmentSlice: Slice, indexMap: number[]): Slice | null; declare class Counter { private counts; constructor(init?: Iterable | Map); elements(): IteratorObject; mostCommon(n?: number): [T, number][]; total(): number; subtract(update: Iterable | Map): void; update(update: Iterable | Map): void; get(element: T): number; set(element: T, count: number): void; } export { Alignment, Counter, DELIMITERS, END_DELIMITER, NUMERIC_TOKEN, OP_TYPES, OP_TYPE_COMBO_MAP, OP_TYPE_MAP, type OpType, STANDARD_TOKEN, START_DELIMITER, type Slice, basicNormalizer, basicTokenizer, categorizeChar, ensureLengthPreservation, getOpTypeComboIndex, isConsonant, isVowel, opTypePowerset, reversed, translateSlice, unpackRegexMatch };