Skip to main content

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


Download files

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

Source Distribution

greenideas-0.1.0.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

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

greenideas-0.1.0-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

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

Hashes for greenideas-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1973530dd4027c68df6fce96c471798b397dde216e989eff614cfb57fc03fff6
MD5 998b8f7559adc12d16703c8c2edb5cc4
BLAKE2b-256 56f2d8fa1a8aa37d45c66be5243ced0a385965e6441e90446479689ffaff6513

See more details on using hashes here.

Provenance

The following attestation bundles were made for greenideas-0.1.0.tar.gz:

Publisher: python-publish.yml on chrishengler/greenideas

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for greenideas-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3fcb1c189e6ff7f6ae3a0657c04905dc14556ac07d52004af939cb8009b2a260
MD5 cdd8371dfb14e328107067beda939263
BLAKE2b-256 19bbfd60eeb68b7cafe791a2ef17423ba3404e8a08c8bfc91f58051b72753dda

See more details on using hashes here.

Provenance

The following attestation bundles were made for greenideas-0.1.0-py3-none-any.whl:

Publisher: python-publish.yml on chrishengler/greenideas

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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