Skip to content

@lexiconlang/language

The language system: phonotactics, lexicon generation, morpheme packs, and name templates.

bash
pnpm add @lexiconlang/language

What it does

A culture in Lexiconlang owns a language — a phonotactic recipe and a set of meaning packs. The package generates conlang forms on demand from the seed, so a culture's vocabulary is consistent and reproducible without storing a dictionary.

Generate a name from a culture

ts
import { createContext } from "@lexiconlang/core";
import { generateName } from "@lexiconlang/language";
import { dwarvish } from "@lexiconlang/fantasy";

const ctx = createContext({ seed: "my-world" });
const name = generateName(dwarvish, "given", ctx.child("hero"));

name.form;         // "Drakaztum"
name.translation;  // "Strong-anvil"
name.language;     // "fantasy.dwarvish"

Build a lexicon directly

ts
import { buildLexicon } from "@lexiconlang/language";

const lexicon = buildLexicon(dwarvish, ctx);
lexicon.lookup("anvil"); // "ztum" — the dwarvish form for "anvil"
lexicon.lookup("strong"); // "drakaz"

The lexicon is content-addressable: lookup("anvil") is deterministic given the culture seed.

Key types

TypePurpose
CulturePhonotactic system + meaning packs + name templates
GlyphSystemPhonotactic configuration (consonants, vowels, syllables)
MeaningPackSet of morphemes with class and tag metadata
MorphemeSingle semantic unit (class, tags, label, id)
NameTemplateRecipe for composing morphemes into a name
TranslatedNameOutput: { form, translation, language, parts?, glyphs? }
LexiconCulture-specific meaning → conlang form mapping

Built-in archetypes

ts
import { archetypes } from "@lexiconlang/language";
// archetypes.flowing, .guttural, .sibilant, .clipped, .resonant

See Cultures & morphemes for the full guide.

Released under the MIT License.