@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.
90 lines (89 loc) • 3.57 kB
TypeScript
/** A register adjunct. */
export type RegisterAdjunct = "NRR" | "DSV" | "PNT" | "SPF" | "EXM" | "CGT" | "END";
/** A single register adjunct. */
export type SingleRegisterAdjunct = "DSV:START" | "DSV:END" | "PNT:START" | "PNT:END" | "SPF:START" | "SPF:END" | "EXM:START" | "EXM:END" | "CGT:START" | "CGT:END" | "END:END";
/** An array containing all register adjuncts. */
export declare const ALL_REGISTER_ADJUNCTS: readonly RegisterAdjunct[];
/** An array containing all single register adjuncts. */
export declare const ALL_SINGLE_REGISTER_ADJUNCTS: readonly SingleRegisterAdjunct[];
/** An object mapping from all register adjuncts to their Ithkuilic translations. */
export declare const REGISTER_ADJUNCT_TO_ITHKUIL_MAP: {
readonly NRR: [start: "", end: ""];
readonly DSV: [start: "ha", end: "hai"];
readonly PNT: [start: "he", end: "hei"];
readonly SPF: [start: "hi", end: "hiu"];
readonly EXM: [start: "ho", end: "hoi"];
readonly CGT: [start: "hu", end: "hui"];
readonly END: [start: "", end: "h\u00FC"];
};
/**
* An object mapping from all single register adjuncts to their Ithkuilic
* translations.
*/
export declare const SINGLE_REGISTER_ADJUNCT_TO_ITHKUIL_MAP: {
readonly "NRR:START": "";
readonly "NRR:END": "";
readonly "DSV:START": "ha";
readonly "DSV:END": "hai";
readonly "PNT:START": "he";
readonly "PNT:END": "hei";
readonly "SPF:START": "hi";
readonly "SPF:END": "hiu";
readonly "EXM:START": "ho";
readonly "EXM:END": "hoi";
readonly "CGT:START": "hu";
readonly "CGT:END": "hui";
readonly "END:END": "hü";
};
/**
* An object mapping from all Ithkuil translations of single register adjuncts
* to their adjuncts.
*/
export declare const SINGLE_REGISTER_ITHKUIL_TO_ADJUNCT_MAP: {
readonly ha: "DSV:START";
readonly hai: "DSV:END";
readonly he: "PNT:START";
readonly hei: "PNT:END";
readonly hi: "SPF:START";
readonly hiu: "SPF:END";
readonly ho: "EXM:START";
readonly hoi: "EXM:END";
readonly hu: "CGT:START";
readonly hui: "CGT:END";
readonly hü: "END:END";
};
/** An object mapping from all register adjuncts to their names. */
export declare const REGISTER_ADJUNCT_TO_NAME_MAP: {
readonly NRR: "Narrative";
readonly DSV: "Discursive";
readonly PNT: "Parenthetical";
readonly SPF: "Specificative";
readonly EXM: "Exemplificative";
readonly CGT: "Cogitant";
readonly END: "Carrier-End";
};
/** An object mapping from all register adjuncts to descriptions of them. */
export declare const REGISTER_ADJUNCT_TO_DESCRIPTION_MAP: {
readonly NRR: "default register";
readonly DSV: "direct speech";
readonly PNT: "parenthetical aside";
readonly SPF: "proper name of preceding referent";
readonly EXM: "“For example, ...”";
readonly CGT: "silent/subjective thoughts";
readonly END: "end of term/phrase governed by carrier stem/adjunct";
};
/**
* Converts a register adjunct into Ithkuil.
*
* @param adjunct The adjunct to be converted.
* @returns An array with two strings of romanized Ithkuilic text. The first is
* the beginning adjunct; the second is the final adjunct.
*/
export declare function registerAdjunctToIthkuil(adjunct: RegisterAdjunct): readonly [start: string, end: string];
/**
* Converts a single register adjunct into Ithkuil.
*
* @param adjunct The adjunct to be converted.
* @returns Romanized Ithkuilic text representing the adjunct.
*/
export declare function singleRegisterAdjunctToIthkuil(adjunct: SingleRegisterAdjunct): string;