@zsnout/ithkuil
Version:
A set of tools which can generate and parse romanized Ithkuil text and which can generate Ithkuil script from text and JSON data.
41 lines (40 loc) • 1.45 kB
TypeScript
/** The types of stress markings in an Ithkuil word. */
export type Stress = "antepenultimate" | "penultimate" | "ultimate" | "monosyllabic" | "zerosyllabic";
/** The type of a transformed word. */
export interface TransformedWord {
/** The original word, unmodified. */
readonly original: string;
/**
* The transformed word, with stress markings and grave accents removed and
* with alternate forms of letters changed (e.g. ḍ -> ḑ, ù -> u, ê -> ë).
*/
readonly word: string;
/** The stress of the word. */
readonly stress: Stress;
}
export declare const STRESSED_TO_UNSTRESSED_VOWEL_MAP: {
readonly á: "a";
readonly é: "e";
readonly í: "i";
readonly ó: "o";
readonly ú: "u";
readonly â: "ä";
readonly ê: "ë";
readonly ô: "ö";
readonly û: "ü";
};
/**
* Transforms a word by normalizing spelling and parsing and removing stress
* markings.
*
* @param word The word to be transformed.
* @returns An object containing information about the transformed word.
*/
export declare function transformWord(word: string): TransformedWord;
/**
* Transforms a word by normalizing spelling. Does not remove stress markings.
*
* @param word The word to be transformed.
* @returns An object containing information about the transformed word.
*/
export declare function transformWordButLeaveStressMarkings(word: string): Pick<TransformedWord, "original" | "word">;