@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.
244 lines (243 loc) • 8.44 kB
TypeScript
import { WithWYAlternative } from "../../helpers/with-wy-alternative.js";
/** A case. */
export type Case = "THM" | "INS" | "ABS" | "AFF" | "STM" | "EFF" | "ERG" | "DAT" | "IND" | "POS" | "PRP" | "GEN" | "ATT" | "PDC" | "ITP" | "OGN" | "IDP" | "PAR" | "APL" | "PUR" | "TRA" | "DFR" | "CRS" | "TSP" | "CMM" | "CMP" | "CSD" | "FUN" | "TFM" | "CLA" | "RSL" | "CSM" | "CON" | "AVR" | "CVS" | "SIT" | "PRN" | "DSP" | "COR" | "CPS" | "COM" | "UTL" | "PRD" | "RLT" | "ACT" | "ASI" | "ESS" | "TRM" | "SEL" | "CFM" | "DEP" | "VOC" | "LOC" | "ATD" | "ALL" | "ABL" | "ORI" | "IRL" | "INV" | "NAV" | "CNR" | "ASS" | "PER" | "PRO" | "PCV" | "PCR" | "ELP" | "PLM";
/** An array containing all cases. */
export declare const ALL_CASES: readonly Case[];
/**
* An array containing all cases that has empty values in the skipped positions
* where the RLT, VOC, NAV, and PLM cases would normally be.
*/
export declare const ALL_CASES_SKIPPING_DEGREE_8: readonly (Case | undefined)[];
/** An object mapping cases to their Ithkuilic translations. */
export declare const CASE_TO_ITHKUIL_MAP: {
readonly false: {
readonly THM: "a";
readonly INS: "ä";
readonly ABS: "e";
readonly AFF: "i";
readonly STM: "ëi";
readonly EFF: "ö";
readonly ERG: "o";
readonly DAT: "ü";
readonly IND: "u";
readonly POS: "ai";
readonly PRP: "au";
readonly GEN: "ei";
readonly ATT: "eu";
readonly PDC: "ëu";
readonly ITP: "ou";
readonly OGN: "oi";
readonly IDP: "iu";
readonly PAR: "ui";
readonly APL: WithWYAlternative;
readonly PUR: WithWYAlternative;
readonly TRA: WithWYAlternative;
readonly DFR: WithWYAlternative;
readonly CRS: "eë";
readonly TSP: WithWYAlternative;
readonly CMM: WithWYAlternative;
readonly CMP: WithWYAlternative;
readonly CSD: WithWYAlternative;
readonly FUN: "ao";
readonly TFM: "aö";
readonly CLA: "eo";
readonly RSL: "eö";
readonly CSM: "oë";
readonly CON: "öe";
readonly AVR: "oe";
readonly CVS: "öa";
readonly SIT: "oa";
readonly PRN: "a'a";
readonly DSP: "ä'ä";
readonly COR: "e'e";
readonly CPS: "i'i";
readonly COM: "ë'i";
readonly UTL: "ö'ö";
readonly PRD: "o'o";
readonly RLT: "u'u";
readonly ACT: "a'i";
readonly ASI: "a'u";
readonly ESS: "e'i";
readonly TRM: "e'u";
readonly SEL: "ë'u";
readonly CFM: "o'u";
readonly DEP: "o'i";
readonly VOC: "u'i";
readonly LOC: "i'a";
readonly ATD: "i'e";
readonly ALL: "i'o";
readonly ABL: "i'ö";
readonly ORI: "e'ë";
readonly IRL: "u'ö";
readonly INV: "u'o";
readonly NAV: "u'a";
readonly CNR: "a'o";
readonly ASS: "a'ö";
readonly PER: "e'o";
readonly PRO: "e'ö";
readonly PCV: "o'ë";
readonly PCR: "ö'e";
readonly ELP: "o'e";
readonly PLM: "o'a";
};
readonly true: {
readonly THM: "a";
readonly INS: "ä";
readonly ABS: "e";
readonly AFF: "i";
readonly STM: "ëi";
readonly EFF: "ö";
readonly ERG: "o";
readonly DAT: "ü";
readonly IND: "u";
readonly POS: "ai";
readonly PRP: "au";
readonly GEN: "ei";
readonly ATT: "eu";
readonly PDC: "ëu";
readonly ITP: "ou";
readonly OGN: "oi";
readonly IDP: "iu";
readonly PAR: "ui";
readonly APL: WithWYAlternative;
readonly PUR: WithWYAlternative;
readonly TRA: WithWYAlternative;
readonly DFR: WithWYAlternative;
readonly CRS: "eë";
readonly TSP: WithWYAlternative;
readonly CMM: WithWYAlternative;
readonly CMP: WithWYAlternative;
readonly CSD: WithWYAlternative;
readonly FUN: "ao";
readonly TFM: "aö";
readonly CLA: "eo";
readonly RSL: "eö";
readonly CSM: "oë";
readonly CON: "öe";
readonly AVR: "oe";
readonly CVS: "öa";
readonly SIT: "oa";
readonly PRN: "a";
readonly DSP: "ä";
readonly COR: "e";
readonly CPS: "i";
readonly COM: "ëi";
readonly UTL: "ö";
readonly PRD: "o";
readonly RLT: "u";
readonly ACT: "ai";
readonly ASI: "au";
readonly ESS: "ei";
readonly TRM: "eu";
readonly SEL: "ëu";
readonly CFM: "ou";
readonly DEP: "oi";
readonly VOC: "ui";
readonly LOC: WithWYAlternative;
readonly ATD: WithWYAlternative;
readonly ALL: WithWYAlternative;
readonly ABL: WithWYAlternative;
readonly ORI: "eë";
readonly IRL: WithWYAlternative;
readonly INV: WithWYAlternative;
readonly NAV: WithWYAlternative;
readonly CNR: "ao";
readonly ASS: "aö";
readonly PER: "eo";
readonly PRO: "eö";
readonly PCV: "oë";
readonly PCR: "öe";
readonly ELP: "oe";
readonly PLM: "oa";
};
};
/** An object mapping from cases to their names. */
export declare const CASE_TO_NAME_MAP: {
readonly THM: "Thematic";
readonly INS: "Instrumental";
readonly ABS: "Absolutive";
readonly AFF: "Affective";
readonly STM: "Stimulative";
readonly EFF: "Effectuative";
readonly ERG: "Ergative";
readonly DAT: "Dative";
readonly IND: "Inducive";
readonly POS: "Possessive";
readonly PRP: "Proprietive";
readonly GEN: "Genitive";
readonly ATT: "Attributive";
readonly PDC: "Productive";
readonly ITP: "Interpretative";
readonly OGN: "Originative";
readonly IDP: "Interdependent";
readonly PAR: "Partitive";
readonly APL: "Applicative";
readonly PUR: "Purposive";
readonly TRA: "Transmissive";
readonly DFR: "Deferential";
readonly CRS: "Contrastive";
readonly TSP: "Transpositive";
readonly CMM: "Commutative";
readonly CMP: "Comparative";
readonly CSD: "Considerative";
readonly FUN: "Functive";
readonly TFM: "Transformative";
readonly CLA: "Classificative";
readonly RSL: "Resultative";
readonly CSM: "Consumptive";
readonly CON: "Concessive";
readonly AVR: "Aversive";
readonly CVS: "Conversive";
readonly SIT: "Situative";
readonly PRN: "Pertinential";
readonly DSP: "Descriptive";
readonly COR: "Correlative";
readonly CPS: "Compositive";
readonly COM: "Comitative";
readonly UTL: "Utilitative";
readonly PRD: "Predicative";
readonly RLT: "Relative";
readonly ACT: "Activative";
readonly ASI: "Assimilative";
readonly ESS: "Essive";
readonly TRM: "Terminative";
readonly SEL: "Selective";
readonly CFM: "Conformative";
readonly DEP: "Dependent";
readonly VOC: "Vocative";
readonly LOC: "Locative";
readonly ATD: "Attendant";
readonly ALL: "Allative";
readonly ABL: "Ablative";
readonly ORI: "Orientative";
readonly IRL: "Interrelative";
readonly INV: "Intrative";
readonly NAV: "Navigative";
readonly CNR: "Concursive";
readonly ASS: "Assessive";
readonly PER: "Periodic";
readonly PRO: "Prolapsive";
readonly PCV: "Precursive";
readonly PCR: "Postcursive";
readonly ELP: "Elapsive";
readonly PLM: "Prolimitive";
};
/**
* An object mapping from case-related affix types and whether they're inverse
* accessor affixes to their Cs forms (omitting the -w or -y at the end).
*/
export declare const CASE_AFFIX_TO_CS_MAP: {
readonly false: readonly [never?, "s"?, "z"?, "č"?];
readonly true: readonly [never?, "š"?, "ž"?, "j"?];
};
/**
* Converts a case into Ithkuil.
*
* @param case_ The case to be converted.
* @param elideIfPossible Whether the THM case can be eliminated.
* @param hideGlottalStop Whether to hide the glottal stop. This is typically
* used in concatenated formatives and in case-related affixes.
* @returns A string or `WithWYAlternative` containing romanized Ithkuilic text
* representing the case.
*/
export declare function caseToIthkuil(case_: Case, elideIfPossible: boolean, hideGlottalStop: boolean): string | WithWYAlternative;