Palabras Locas is a simple python program which can be fed a file with english plane text, and for every sentence in that file, it will select a random word from each sentence, and ask you for a replacement of the same type (noun, verb, etc). Upon completion, it will ask you to hit enter for the resulting Palabras Locas.
I was visiting Mexico with my family, and decided to take a break one afternoon, because I was cooking my carcus in the sun. I hid in the room and wrote this, for family entertainment.
- Clone this repo down, or download and extract the archive.
cd
into the directory- Create a virtual environment for dependencies (python 3.6 recommended)
virtualenv -p python3 venv
- Source that virtual environment
source venv/bin/activate
- Install dependencies into the virtual environment
pip install -r requirements.txt
python palabras_locas.py ${path/to/your/text/file.txt}
eg: python palabras_locas.py test_texts/teapot.txt
- Don't tell your audience what the source text is, it ruins the fun man...
- If your source text has a lot of run-on sentences, replace some of those commas and semicolons with periods, so word replacements are not few, and far between.
- Running on a Mac is recommended, because it will use the
say
tts utility to prompt your audience and when done, its default tinny voice will read the output while you can drink a cervesa.
- The name, sorry.
- It should be more descriptive in input specification, for example: probably tell you if it needs a plural noun, thing ending with "ing", a name should ask for a name, etc... The Vocabulary community python module would cover a bit of that.. however, I decided to use PyDictionary library, because it does not run into frequent rate limiting.
- Probably should not be fed shell commands, since the say command is a simple os execution of stuff that was typed.
- (Probably many other bugs...)
$ python palabras_locas.py example_texts/teapot.txt Give me a Noun: beer Give me a Noun: fart Give me a Noun: whiskey Give me a Verb: burp Give me a Noun: poop Give me a Noun: pee Press any key for your Palabras Locas... ###### teapot.txt ###### I’m beer little teapot Short and stout Here is my fart Here is my whiskey When I get all steamed burp Hear poop shout Tip pee over and pour me out ########################################