Skip to main content

English to Monsu Translator

English to Monsu Translator

A zero-dependency Python CLI and library that translates English text into the fictional Monsu language using a word dictionary.

Python 3.8+ Version 0.1.0 License: MIT Made by rkriad585

Overview

emtranslator is a dictionary-based translator for English and the fictional Monsu language. It ships with a 90-word built-in dictionary, a emtrans command line tool, and an embeddable Translator Python API. The package uses only the Python standard library, so it installs and runs anywhere Python 3.8+ is available.

Screenshot

home screen

More screenshots: View all screenshots

Table of Contents

Key Features

  • Word-by-word translation using a built-in 90-word English-to-Monsu dictionary.
  • Reverse translation (Monsu to English) via the -r/--reverse flag or the Translator(reverse=True) constructor.
  • Punctuation- and whitespace-aware: surrounding punctuation and spacing pass through translation unchanged.
  • Case-insensitive lookup with casing preserved on the translated output.
  • Unknown words are kept as-is and reported via missing_words() / --json.
  • Extensible dictionary: add words from the CLI (emtrans add) or the API (add_word()); additions persist to ~/.config/neostore/emtranslator/config.toml.
  • Zero dependencies — standard library only.

Installation

Requires Python 3.8+.

git clone https://github.com/rkriad585/EMTranslator.git
cd EMTranslator
pip install -e .

This installs the emtrans command and the emtranslator package. On systems where the Python user scripts directory is not on PATH, install with python -m pip install -e . instead.

Quick Start

emtrans "Hello world"
# Monsu_1 monsu_2
from emtranslator import Translator

t = Translator()
print(t.translate("Hello world"))  # Monsu_1 monsu_2

Usage Examples

Translate a sentence, preserving punctuation and unknown words:

emtrans "Hello, world! This is a test."
# Monsu_1, monsu_2! monsu_3 monsu_4 monsu_5 monsu_6.

Translate from Monsu back to English:

emtrans --reverse "monsu_1 monsu_2"
# hello world

Read from stdin:

echo "good morning" | emtrans
# monsu_13 monsu_14

Translate a file to another file:

emtrans translate -i input.txt -o output.txt

Get JSON output including words missing from the dictionary:

emtrans --json "hello zebra"
# {
#   "original": "hello zebra",
#   "translated": "monsu_1 zebra",
#   "missing": ["zebra"],
#   "reverse": false
# }

Add a word and list the active dictionary:

emtrans add hi monsu_91
# Added hi -> monsu_91
emtrans list
# a: monsu_5
# ...
# hi: monsu_91

Use the library with a custom dictionary, in reverse mode, or with word persistence:

from emtranslator import Translator

t = Translator({"hi": "salut"})
t.translate("hi there")            # salut there

rev = Translator(reverse=True)
rev.translate("monsu_1")           # hello

t2 = Translator()
t2.add_word("hola", "monsu_91")    # persisted to config.toml
t2.missing_words("hello antelope") # ['antelope']

Documentation

Document Description
Getting Started First steps: install, first translation, first word
Installation Requirements and install instructions
Usage CLI and library usage with examples
CLI Reference Full emtrans command reference
Configuration User dictionary, TOML format, migration
Architecture Project layout and translation flow
Development Set up a dev environment and run tests
Deployment Packaging and running via Docker
FAQ Frequently asked questions
Troubleshooting Common problems and fixes
Screenshots Screenshots of the project
API Reference Translator class API

Interface

CLIemtrans with three subcommands: translate (the default), add, and list. Run emtrans --help or emtrans <subcommand> --help for details.

Library — the emtranslator package exposes Translator, DEFAULT_DICTIONARY, and __version__ from the top level:

from emtranslator import Translator, DEFAULT_DICTIONARY, __version__

Architecture

EMTranslator/
├── pyproject.toml              # packaging + emtrans console script
├── src/emtranslator/
│   ├── __init__.py             # public API surface
│   ├── __main__.py             # python -m emtranslator entry point
│   ├── cli.py                  # argparse CLI (translate/add/list)
│   ├── core.py                 # Translator class + tokenizer
│   └── dictionary.py           # DEFAULT_DICTIONARY + TOML persistence
├── tests/                      # pytest suite (core + CLI)
├── tools/generate_screenshots.py  # dev tool: renders Screenshots/*.png (Pillow)
├── docs/                       # documentation
├── logo/logo.svg               # project logo
└── Screenshots/                # screenshots

Translation flow:

Input text
   -> tokenize into words / punctuation / whitespace
   -> lower-case each word and look it up
      (built-in dict + user config + optional --dictionary file)
   -> unknown words pass through unchanged
   -> re-attach punctuation and whitespace
   -> output

Requirements

  • Python 3.8 or newer (declared as requires-python = ">=3.8").
  • No third-party runtime dependencies.

Prerequisites

  • git to clone the repository.
  • pip for the package and its build backend (setuptools>=61.0, pulled in automatically by pip).

Development

git clone https://github.com/rkriad585/EMTranslator.git
cd EMTranslator
python -m pip install -e .
python -m pytest

The test suite covers the Translator API and the CLI (via subprocess). See Development for details.

Contributing

Contributions are welcome. Please read CONTRIBUTING.md before opening an issue or pull request, and note that all interactions are governed by our Code of Conduct.

Security

This tool reads and writes only local files: your input text and the user dictionary at ~/.config/neostore/emtranslator/config.toml. It makes no network requests. To report a security issue, see SECURITY.md.

License

Distributed under the MIT License. See LICENSE for details.

Acknowledgments

  • The fictional Monsu language and its vocabulary were created for this project.
  • Built and maintained by RK Riad Khan.

Release files for emtranslator 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for emtranslator 0.1.0
File Size Uploaded
emtranslator-0.1.0.tar.gz 15.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for emtranslator 0.1.0
File Interpreter ABI Platform
emtranslator-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 27.5 kB

Release files / emtranslator-0.1.0.tar.gz

Download URL emtranslator-0.1.0.tar.gz
Size 15.6 kB
Tags Source
SHA-256 checksum
How to use checksums
1bf9f2a3441513776fcb8876615496db20becf8e2a5cce42cdfc92cf7bc26940
BLAKE2b-256 checksum
How to use checksums
883060bc88ac8454ae6e080998e2bf3eb16bf2818d7fcf41288f73e994f1b6e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.7

Release files / emtranslator-0.1.0-py3-none-any.whl

Download URL emtranslator-0.1.0-py3-none-any.whl
Size 11.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0fe0f001b40fcfaa146fc1d3db5d13fb3b536c40c1780db935ec1b94489f04cd
BLAKE2b-256 checksum
How to use checksums
e5f3eb7994af8d67e1ee187cda4323568f5f00f46116d9804ad5b06670063f56
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.7

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page