No project description provided
Project description
Language Change
A Python package for simulating language evolution across different historical periods of English.
Installation
pip install languagechange
Or using Poetry:
poetry install
Overview
This package provides tools to transform Modern English sentences into approximations of Old English and Middle English. It works by applying word-by-word replacements based on historical linguistic patterns.
Usage
Command Line Interface
# Transform a custom sentence
python -m languagechange.languagechange "Nothing ever comes to one that is worth having, except as a result of hard work."
# Use the default test sentence
python -m languagechange.languagechange
Python API
from languagechange import LanguageEvolution
# Initialize the language evolution engine
evolution = LanguageEvolution()
# Transform a sentence
sentence = "Nothing ever comes to one that is worth having, except as a result of hard work."
# Get Old English version
old_english = evolution.transform_sentence(sentence, evolution.old_english_replacements)
print(f"Old English: {old_english}") # Output: Nothing ever comes tō ān þæt iƿ worth having, except as ān result of hard work.
# Get Middle English version
middle_english = evolution.transform_sentence(sentence, evolution.middle_english_replacements)
print(f"Middle English: {middle_english}") # Output: Nothing ever comes to oon that is worth having, except as a result of hard work.
# Using the generator to get all forms
for i, version in enumerate(evolution.generate_evolution(sentence)):
stage = ["Old English", "Middle English", "Modern English"][i]
print(f"{stage}: {version}")
Features
- Transform Modern English text to Old English (approximately 5th to 11th century)
- Transform Modern English text to Middle English (approximately 11th to 15th century)
- Preserve capitalization and punctuation during transformation
- Command-line interface with Typer
- Python API for programmatic usage
Development
Running Tests
pytest
License
This work is licensed under CC BY-NC-ND 4.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file languagechange-0.4.0.tar.gz.
File metadata
- Download URL: languagechange-0.4.0.tar.gz
- Upload date:
- Size: 2.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c1526e658de3a78af293bc0da500a9820b59b75d0244ae9d1bc67fa8f388cb4
|
|
| MD5 |
dd5f1cdb6605ede3a25cd0b432d46064
|
|
| BLAKE2b-256 |
3fe1693f4cddd4128b79d0b2d0319136b80c992900530871049cf18833a8e0d2
|
File details
Details for the file languagechange-0.4.0-py3-none-any.whl.
File metadata
- Download URL: languagechange-0.4.0-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
23c2c04e95886542ac56dbe987cfaf876c89ae76375438f791b9c5908218306c
|
|
| MD5 |
ce01577b1aa5a447b4edf4ff7a24b8f9
|
|
| BLAKE2b-256 |
620818b1530c25d94ca4f0eaee1dd4da3b5a7e5afd1659f7550b0c0fc2aec8ac
|