Skip to main content

Agglutinative language toolkit with logical symbols, translator, and font generator.

Project description

Agglutinative Language Toolkit

This project bootstraps a synthetic agglutinative language with:

  • A GPT-powered dictionary generator and translator (g4f API)
  • A logical symbol system where glyph form encodes meaning + sound
  • A font generator that compiles symbols into a .ttf font

1) Setup

python -m venv .venv
.venv\Scripts\Activate.ps1
pip install -r requirements.txt
pip install -e .

After editable install, you can use:

  • logiglyph ... (console command)
  • python -m logiglyph ...
  • from logiglyph import LanguageModule

2) Generate dictionary

python -m src.tool generate-dictionary --count 96 --out data/dictionary.json

This calls g4f (gpt-5-mini) and enriches each root with:

  • semantic_class
  • onset, vowel, coda (sound parts)
  • symbol_id (logical glyph key)
  • symbol (ASCII token: lg_<class>_<root>)
  • char (optional Private Use Area glyph)

If API output is malformed/unavailable, the tool falls back to deterministic local roots.

3) Build font

python -m src.tool build-font --dict data/dictionary.json --out dist/LogiGlyph.ttf

This creates:

  • dist/LogiGlyph.ttf
  • dist/glyph_map.json

4) Translate text

python -m src.tool translate --dict data/dictionary.json --text "the person builds a house"
python -m src.tool translate --dict data/dictionary.json --text "lg_e_pa_ lg_e_pan lg_e_pak" --reverse

--reverse expects ASCII symbols (lg_<class>_<root>), not PUA glyph characters.

5) Build specimen (visual check)

python -m src.tool build-specimen --dict data/dictionary.json --font dist/LogiGlyph.ttf --out dist/specimen.html

Open dist/specimen.html in a browser. Keep LogiGlyph.ttf in the same folder so @font-face can load it.

Font rendering troubleshooting

Default translation output is ASCII (lg_<class>_<root>) and renders in any font. The optional visual glyph mode uses Private Use Area (U+E100+) and needs LogiGlyph.ttf.

  • Terminal/editor showing squares only affects PUA glyphs; ASCII symbols are always safe.
  • Browser: use CSS @font-face and set font-family: 'LogiGlyph' only when rendering PUA glyph text.
  • Windows app: install dist/LogiGlyph.ttf only if you choose PUA glyph rendering.

Example VS Code setting:

{
  "editor.fontFamily": "LogiGlyph, Consolas, 'Courier New', monospace"
}

Use as a Python module

from logiglyph import LanguageModule

lang = LanguageModule("data/dictionary.json")
res = lang.translate("person_0 house_1 water_2")
print(res.text)        # e.g. lg_e_pa_ lg_e_pan lg_e_pak
print(res.codepoints)  # ['U+E100', 'U+E101', 'U+E102']

print(lang.reverse(res.text))  # person_0 house_1 water_2
print(lang.install_note())

Logical symbol design

Each glyph is compositional and fully rule-driven:

  • Semantic radical (base shape):
    • entity: box
    • action: diagonal cross
    • quality: diamond
    • relation: bridge bar
    • abstract: circle-ish octagon
  • Onset class adds a stem direction.
  • Vowel places a dot mark in one of 5 anchor positions.
  • Coda adds a terminal notch/tick style.

So related meanings and sounds share visible structure.

Direct g4f usage

The dictionary generator internally uses this same API pattern:

from g4f.client import Client

client = Client()
response = client.chat.completions.create(
    model="gpt-5-mini",
    messages=[{"role": "user", "content": "..." }],
    web_search=False
)
print(response.choices[0].message.content)

Project details


Download files

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

Source Distribution

logiglyph-0.1.1.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

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

logiglyph-0.1.1-py3-none-any.whl (13.7 kB view details)

Uploaded Python 3

File details

Details for the file logiglyph-0.1.1.tar.gz.

File metadata

  • Download URL: logiglyph-0.1.1.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for logiglyph-0.1.1.tar.gz
Algorithm Hash digest
SHA256 7350e61bb6cc0495c24d7b8f28448cc0fec7e92f1d47324b3f21669e3f5438a2
MD5 4612f34fc3f79bcafe1abd6e0c79f9fc
BLAKE2b-256 f9053c7a6e337d066effd0c21dceb511bff268f9c7abf2892df146debcadf76e

See more details on using hashes here.

File details

Details for the file logiglyph-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: logiglyph-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 13.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for logiglyph-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7679bade63892666373ba50d83b00b3c48386cbc09d10a9b88de01777b8948f8
MD5 48dd8cbdfb45c22cadca27e074ce7b44
BLAKE2b-256 15d4b69f3240c0fb8e5061801da708eb03938e3f6a2ac0889dfb26c35170efca

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