UNPKG

@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.

26 lines (25 loc) 1.02 kB
import { has } from "../../helpers/has.js"; import { caseToIthkuil } from "./case.js"; import { illocutionAndValidationToIthkuil, } from "./illocution-and-validation.js"; import { ALL_ILLOCUTIONS } from "./illocution.js"; import { ALL_VALIDATIONS } from "./validation.js"; export * from "./case.js"; export * from "./illocution-and-validation.js"; export * from "./illocution.js"; export * from "./validation.js"; /** * Converts Slot IX to Ithkuil. * * @param slot The case or illocution+validation of this slot. * @param metadata Additional information relevant to Slot IX. * @returns A string or `WithWYAlternative` containing romanized Ithkuilic text * representing Slot IX. */ export function slotIXToIthkuil(slot, metadata) { if (has(ALL_ILLOCUTIONS, slot) || has(ALL_VALIDATIONS, slot)) { return illocutionAndValidationToIthkuil(slot, metadata.elideIfPossible); } else { return caseToIthkuil(slot, metadata.elideIfPossible, metadata.isPartOfConcatenatedFormative); } }