A package to generate grammatically valid but semantically nonsensical English sentences.
Project description
Green Ideas
Green Ideas is a Python package designed to generate grammatically valid but semantically nonsensical English sentences using a generative grammar approach. The package employs recursive rewrite rules to create sentence structures and converts these structures into templates compatible with the twaddle package for language templating.
Features
The project is in early development and currently does very little indeed. Once completed, core features will include:
- Generation of trees describing valid English sentence structures
- Support for recursive rewrite rules for sentence structure generation.
- Converting sentence trees into twaddle-compatible templates.
- Modular design allowing for easy extension and modification of grammar rules.
Installation
For now, just download the repository from Github and handle the package by hand. The package will be added to PyPi at a later date to allow installation via pip, etc.
The package uses Poetry for dependency management, dependencies can be installed by running
poetry install
Usage
To use the greenideas package, you can (or at least you will be able to, at some point) import the main classes from the package and start generating sentences. Here’s a simple example:
from greenideas.grammar_engine import GrammarEngine
from greenideas.tree_to_twaddle import TreeToTwaddle
# Initialize the grammar engine
grammar_engine = GrammarEngine()
# Generate a derivation tree
tree = grammar_engine.generate_tree()
# Convert the tree to a twaddle template
converter = TreeToTwaddle()
template = converter.convert_tree(tree)
print(template)
Contributing
Contributions are welcome! Please feel free to submit a pull request or open an issue for any enhancements or bug fixes.
License
This project is licensed under the MIT License. See the LICENSE file for more details.
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 greenideas-0.1.0.tar.gz.
File metadata
- Download URL: greenideas-0.1.0.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1973530dd4027c68df6fce96c471798b397dde216e989eff614cfb57fc03fff6
|
|
| MD5 |
998b8f7559adc12d16703c8c2edb5cc4
|
|
| BLAKE2b-256 |
56f2d8fa1a8aa37d45c66be5243ced0a385965e6441e90446479689ffaff6513
|
Provenance
The following attestation bundles were made for greenideas-0.1.0.tar.gz:
Publisher:
python-publish.yml on chrishengler/greenideas
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
greenideas-0.1.0.tar.gz -
Subject digest:
1973530dd4027c68df6fce96c471798b397dde216e989eff614cfb57fc03fff6 - Sigstore transparency entry: 330753050
- Sigstore integration time:
-
Permalink:
chrishengler/greenideas@bab052beacc5810dbcb10f18cbef356a96da7d88 -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/chrishengler
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@bab052beacc5810dbcb10f18cbef356a96da7d88 -
Trigger Event:
release
-
Statement type:
File details
Details for the file greenideas-0.1.0-py3-none-any.whl.
File metadata
- Download URL: greenideas-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3fcb1c189e6ff7f6ae3a0657c04905dc14556ac07d52004af939cb8009b2a260
|
|
| MD5 |
cdd8371dfb14e328107067beda939263
|
|
| BLAKE2b-256 |
19bbfd60eeb68b7cafe791a2ef17423ba3404e8a08c8bfc91f58051b72753dda
|
Provenance
The following attestation bundles were made for greenideas-0.1.0-py3-none-any.whl:
Publisher:
python-publish.yml on chrishengler/greenideas
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
greenideas-0.1.0-py3-none-any.whl -
Subject digest:
3fcb1c189e6ff7f6ae3a0657c04905dc14556ac07d52004af939cb8009b2a260 - Sigstore transparency entry: 330753094
- Sigstore integration time:
-
Permalink:
chrishengler/greenideas@bab052beacc5810dbcb10f18cbef356a96da7d88 -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/chrishengler
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@bab052beacc5810dbcb10f18cbef356a96da7d88 -
Trigger Event:
release
-
Statement type: