Skip to main content

glossa

Your own constructed language, in the terminal. Encoding runs three stages:

  1. Word substitution — every word is swapped for an invented one (coined on first sight, remembered forever).
  2. Word order shift — the sentence is re-ordered by a reversible rule.
  3. Invented alphabet — the result is written in a 26-symbol script of its own.

Decoding runs the exact inverse, so text survives a round trip — punctuation, capitalisation, numbers, and line breaks included.

$ glossa -code "Hello John, I eat bread!"
ⵈⵅⴷⴹⵖⴹ ⵁⵋⴽⵋ ◆ⵃⵅⵒⵂ ◆ⴵⴾⵔⵅ, ◆ⴴⵅⴷⵋⵊⴹⵃ!

$ glossa -code "Hello John, I eat bread!" | glossa -decode
Hello John, I eat bread!

Install

pip install glossa-lang

The distribution is named glossa-lang (the name glossa was already taken on PyPI); the command it installs is glossa.

From a checkout instead:

cd glossa && python3 -m venv .venv && .venv/bin/pip install -e ".[dev]"
ln -sf "$PWD/.venv/bin/glossa" ~/.local/bin/glossa

Commands

Command What it does
glossa -code TEXT plain text → language (also -encode, -e, encode)
glossa -decode TEXT language → plain text (also -d, decode)
glossa words list show the lexicon: source, invented word, symbols
glossa words add bread tamu fix a translation by hand (omit tamu to coin one)
glossa words remove bread forget one word
glossa learn notes.txt count words in files, coin the most common ones
glossa common -n 20 the most frequent words seen so far
glossa alphabet print the letter → symbol table
glossa alphabet regen --yes new script (old encoded text becomes unreadable)
glossa config set order rotate change the word-order rule
glossa stats summary of the language memory
glossa where print the memory file paths
glossa reset --yes wipe the language and start over

Text can come from arguments, -f FILE, or a pipe:

cat notes.txt | glossa -code

Word order rules

glossa config set order <rule> — every rule is exactly reversible.

  • reverse (default) — i eat breadbread eat i
  • rotate — last word to the front: i eat breadbread i eat
  • pairs — swap neighbours: a b c db a d c
  • none — keep the original order

Memory files

Everything lives in ~/.glossa (override with GLOSSA_HOME or --home DIR):

File Contents
lexicon.json {"words": {"bread": "tamu"}} — the word memory
alphabet.json {"seed": "glossa-a1b2c3d4", "map": {"a": "ⵜ"}} — the script
stats.json {"documents": 3, "counts": {"the": 42}} — which words are common
config.json {"order": "reverse", "seed": "…", "auto_coin": true}

Words are coined deterministically from the seed, so the same seed always invents the same word for the same source word.

Notes

  • Capitalisation is carried by a mark in front of the word: = first letter, = all caps.
  • Unknown words come back unchanged on decode, with a warning on stderr.
  • --no-new-words encodes without inventing anything new.

Tests

.venv/bin/python -m pytest --cov --cov-report=term-missing

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

glossa_lang-0.1.0.tar.gz (23.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

glossa_lang-0.1.0-py3-none-any.whl (22.5 kB view details)

Uploaded Python 3

File details

Details for the file glossa_lang-0.1.0.tar.gz.

File metadata

  • Download URL: glossa_lang-0.1.0.tar.gz
  • Upload date:
  • Size: 23.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for glossa_lang-0.1.0.tar.gz
Algorithm Hash digest
SHA256 55bdffc928e405e46bcb96d2ec13b2f79ceef4bc123375f706770e86ae737daf
MD5 00ce60eee541cfd47415c213b751f0f6
BLAKE2b-256 cfbfab2210cd91361acbe62ba37c7cb81421c4eedb2abbc0add0ed20b6d1df6f

See more details on using hashes here.

File details

Details for the file glossa_lang-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: glossa_lang-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 22.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for glossa_lang-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e0672b75b264206c45cfde85f730d767521377076bbcf28afa356ecde37dd682
MD5 2d043eac13fb8bf66462950beef7137d
BLAKE2b-256 ad4875b39a9d03aebd2cf5c6403e884ef44d661f02f7d42c953b9b2fd1f3cb78

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page