@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.
36 lines (35 loc) • 930 B
JavaScript
import { deepFreeze } from "../../helpers/deep-freeze.js";
import {} from "./ca-shortcut-type.js";
import {} from "./concatenation-type.js";
export * from "./ca-shortcut-type.js";
export * from "./concatenation-type.js";
/**
* An object mapping from concatenation types and Ca shortcut types to their
* Ithkuilic translations.
*/
export const SLOT_I_MAP = /* @__PURE__ */ deepFreeze({
none: {
none: "",
w: "w",
y: "y",
},
1: {
none: "h",
w: "hl",
y: "hm",
},
2: {
none: "hw",
w: "hr",
y: "hn",
},
});
/**
* Converts Slot I of a formative into Ithkuil.
*
* @param slot The concatenation type and Ca shortcut type of the formative.
* @returns Romanized Ithkuilic text representing Slot I of the formative.
*/
export function slotIToIthkuil(slot) {
return SLOT_I_MAP[`${slot.concatenationType}`][`${slot.caShortcutType}`];
}