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.

55 lines (54 loc) 2.04 kB
import { type Adjunct } from "./adjunct/index.js"; import { type PartialFormative } from "./formative/index.js"; import { type PartialReferential } from "./referential/referential.js"; export * from "./adjunct/index.js"; export * from "./affix/index.js"; export * from "./ca/index.js"; export * from "./formative/index.js"; export * from "./helpers/deep-freeze.js"; export * from "./helpers/dipthongs.js"; export * from "./helpers/enum.js"; export * from "./helpers/fill-defaults.js"; export * from "./helpers/has.js"; export * from "./helpers/insert-glottal-stop.js"; export * from "./helpers/permutations.js"; export * from "./helpers/stress.js"; export * from "./helpers/vowel-table.js"; export * from "./helpers/with-wy-alternative.js"; export * from "./phonotactics/index.js"; export * from "./referential/index.js"; /** The type of a generic Ithkuilic word. */ export type Word = PartialReferential | PartialFormative | Adjunct; /** * Converts a single word into Ithkuil. * * @param word The word to be converted. * @returns Romanized Ithkuilic text representing the word. * * Note that while this function aims to always capture the caller's intent and * return the correct type of word, there is one edge case. Specifically, all * Suppletive Adjuncts can alternately be parsed as referentials with * suppletive referents. To resolve this ambiguity, this function always * converts Suppletive Adjuncts to their standard adjunct forms if possible. * * Here is an example of such an ambiguity, and how `wordToIthkuil` resolves it. * * ```ts * suppletiveAdjunctToIthkuil({ type: "NAM", case: "STM" }) * // "hnëi" * * referentialToIthkuil({ type: "NAM", case: "STM" }) * // "üohnëi" * * wordToIthkuil({ type: "NAM", case: "STM" }) * // "hnëi" * ``` * * Of course, it calls `referentialToIthkuil` when needed. * * ```ts * wordToIthkuil({ type: "NAM", case: "STM", essence: "RPV" }) * // "üohnêi" * ``` */ export declare function wordToIthkuil(word: Word): string;