Skip to content

BaconAndEggs/palabras_locas

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Palabras Locas

What is it?

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.

Why?

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.

Installation

  1. Clone this repo down, or download and extract the archive.
  2. cd into the directory
  3. Create a virtual environment for dependencies (python 3.6 recommended)
    virtualenv -p python3 venv
  4. Source that virtual environment
    source venv/bin/activate
  5. Install dependencies into the virtual environment
    pip install -r requirements.txt

Running Palabras Locas

python palabras_locas.py ${path/to/your/text/file.txt}
eg: python palabras_locas.py test_texts/teapot.txt

Recommendations

  1. Don't tell your audience what the source text is, it ruins the fun man...
  2. 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.
  3. 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.

Lame Issues

  1. The name, sorry.
  2. 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.
  3. Probably should not be fed shell commands, since the say command is a simple os execution of stuff that was typed.
  4. (Probably many other bugs...)

Example Execution

$ 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
########################################

About

Python script for random word replacement fun.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages