Skip to content

Repository files navigation

Aksharya

Real Sanskrit words. Intentionally meaningless arrangement.

Vṛkṣa pustaka gaja hasta nagara dugdha lekhaka rātri yantra.

Aksharya is a Sanskrit counterpart to Lorem Ipsum for developers, designers, typographers, educators, and product teams everywhere. It generates individually valid, secular Sanskrit dictionary words in Roman transliteration, then arranges them as deliberately incoherent “noun salad” for mockups, fixtures, demos, and layout testing.

Like Lorem Ipsum, Aksharya is intended to provide visual texture without distracting readers with meaningful prose. It can be used wherever a project benefits from an alternative typographic rhythm, regardless of the creator’s location or familiarity with Sanskrit.

Important

The words are real Sanskrit; the generated pseudo-sentences are not Sanskrit prose and are not intended to communicate a message or translation.

What “meaningless” means here

Aksharya does not invent fake words. Instead, it prevents the vocabulary from becoming generated prose:

  1. Only secular dictionary headwords are included—108 words across animals, body parts, food, nature, objects, people, places, time, and tools.
  2. Unrelated categories are forced together. Neither of the previous two semantic categories may be selected for the next word.
  3. Recent words cannot repeat. A word is excluded from the next five selections.
  4. There are no finite verbs, pronouns, conjunctions, particles, or sentence templates. Aksharya never constructs a subject–verb–object statement.
  5. Capitalization and periods are decorative. They create text-shaped blocks without adding Sanskrit grammar.
  6. Religious and philosophical vocabulary is excluded. The generator contains no sourced verses, prayers, mantras, deity names, or canonical opening phrase.

An honest linguistic limitation

Sanskrit has flexible word order, permits omitted verbs, and forms productive noun compounds. Because of that, no randomizer using real Sanskrit words can mathematically prove that every possible adjacent pair is uninterpretable. A reader may occasionally imagine a local association between two nouns.

Aksharya’s enforceable guarantee is narrower and practical: it does not use grammar templates or source passages, it excludes sentence-building and religious vocabulary, and it continuously mixes unrelated domains so the output does not form an intentionally generated proposition.

Install

Run it without a global installation:

npx aksharya 30

Install it in a project:

npm install aksharya

Or install the CLI globally:

npm install --global aksharya
aksharya 30

Aksharya requires Node.js 18 or newer and has zero runtime dependencies.

CLI

# 30 words in readable ASCII
aksharya 30

# Compact count abbreviation
aksharya aksharya30

# Standard IAST spelling with diacritics
aksharya 12 --iast

# Repeatable output for snapshots
aksharya 50 --seed homepage

# Words only, without visual sentence formatting
aksharya 20 --plain
Option Description
--ascii Readable ASCII transliteration; the default
--iast Standard IAST spelling with diacritics
--plain Disable decorative capitalization and punctuation
--seed <value> Produce repeatable selection and sentence lengths
-h, --help Show CLI help

A bare aksharya generates 30 words. Counts from 1 through 10,000 are supported.

TypeScript and JavaScript API

Aksharya ships ESM JavaScript with TypeScript declarations.

import {
  generate,
  parseAbbreviation,
  type GenerateOptions
} from "aksharya";

const options: GenerateOptions = {
  style: "iast",
  seed: "homepage"
};

const text = generate(30, options);
const abbreviation = parseAbbreviation("aksharya42");

if (abbreviation) {
  console.log(generate(abbreviation.count));
}

generate(count?, options?)

Returns a string containing exactly the requested number of words.

type OutputStyle = "ascii" | "iast";

interface GenerateOptions {
  style?: OutputStyle;
  seed?: string | number;
  punctuate?: boolean;
  random?: () => number;
}
  • count defaults to 30 and accepts integers from 1 to 10,000.
  • style defaults to "ascii".
  • seed makes word selection and sentence lengths repeatable.
  • punctuate: false returns a plain space-separated stream.
  • random injects a custom random source.

Vocabulary exports are also available:

import {
  SANSKRIT_WORD_GROUPS,
  SECULAR_SANSKRIT_WORDS,
  WORD_CATEGORIES,
  type WordCategory
} from "aksharya";

The curated headwords and category assignments live in src/vocabulary.ts. Standard Sanskrit lexicographic resources such as the Cologne Digital Sanskrit Lexicon are the reference point for spelling review.

VS Code expansion

When installed as a VS Code extension:

  1. Type aksharya30 in any file.
  2. Accept the completion suggestion, or press Ctrl+Alt+S (Cmd+Alt+S on macOS).
  3. The abbreviation is replaced by exactly 30 valid Sanskrit words in an incoherent arrangement.
Abbreviation Result
aksharya 30 words
aksharya12 12 words
sanskrit50 50 words; optional descriptive alias

Select transliteration with aksharya.style.

Command Palette entries:

  • Aksharya: Generate Incoherent Sanskrit Placeholder Text
  • Aksharya: Expand Abbreviation

Tested invariants

  • Exact lexical word count
  • 108 unique curated words across nine categories
  • Output contains only curated vocabulary
  • No category repeats within any three-word window
  • No word repeats within five selections
  • Known religious, philosophical, grammatical, and canonical phrase terms are absent
  • Seeded output is deterministic
  • ASCII and IAST output preserve the same vocabulary
  • Decorative punctuation does not change word count
  • No runtime dependencies

Development

The source is strict TypeScript. The build emits the ESM library, CLI, CommonJS VS Code extension, tests, and public declarations into dist/.

npm install
npm run build
npm test
npm run check
node dist/bin/aksharya.js 30 --iast
npm pack --dry-run
npm publish --dry-run

The prepublishOnly lifecycle performs a clean build, runs all tests, and executes strict type-checking before npm can publish the package.

License

MIT

About

Valid Sanskrit words arranged as deliberately incoherent placeholder text

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages