https://github.com/lp1dev/wordsgenerator
A pseudo-random based words generator
https://github.com/lp1dev/wordsgenerator
Last synced: 6 months ago
JSON representation
A pseudo-random based words generator
- Host: GitHub
- URL: https://github.com/lp1dev/wordsgenerator
- Owner: lp1dev
- Created: 2016-12-20T12:59:45.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2016-12-28T10:48:02.000Z (about 9 years ago)
- Last Synced: 2025-07-25T09:46:18.974Z (7 months ago)
- Language: Python
- Size: 15.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Words Generator
### Version 0.0.6
Wordgen - Words generator using pseudo random generation.
It is a HTTP API to generate random letters associations according to a list of rules, the goal is to be able to build an entire dictionnary of meaningful words of a randomly built language.
### Working
- HTTP API with the following routes :
- GET / : Generates a word of a random length with an audio output
- GET /generate/{length} : Generates a word of a given length
### TODO
- Store the created words and the associated outputs
- Generate a definition for each word
### Prequisites
- Python 3.4+
- Flask
- festival
### Install
With Python-Pip installed
pip install -r requirements.txt
### Usage
python wordgen.py or chmod +x wordgen.py && ./wordgen.py to run the API.
### Rules syntax
The rules for the words generation are stored in the rules.py file.
They are written in a Python syntax and evaluated using eval* in the code.
Every rule must concern 'new_letter', since it is the variable component.
You can access the following objects and methods :
- word (the whole word minus the new letter)
- new_letter (the letter to be added)
- last_letter (the last letter of the word) (usable only if len(word) > 0)
- vowels (an array of all the vowels)
- consonants (an array of all the consonants)
- self.num_vowels(word)
- self.num_consonants(word)
*Since the rules are evaluated using eval(), YOU MUST NOT use the generator on an environment containing sensitive data and only give access to the rules to restricted authorized users !*