rumbleinthejungle
The Squabble in Strobl...
The Wrangle in Spangle...
The Quarrel in Sorell...
rumbleinthejungle prints humorous rhyming phrases of the form "the dispute in Beirut", as appears in the 2009 film The Slammin' Salmon, itself an homage to the historic boxing match, The Rumble in the Jungle.
For more information on this package, see
For the impatient
virtualenv env -p python3
. env/bin/activate
pip install rumbleinthejungle
python -m rumbleinthejungle
Copyright licenses
The code comprising this program is copyright 2014, 2017 Jeffrey Finkelstein.
It is licensed under the GNU General Public License, version 3 (or later). For
more information, see LICENSE.txt
in this directory.
The thesaurus data is copyright 2005 Princeton University. It is licensed under
a custom license, similar to the BSD license. For more information, see
LICENSE_WN.txt
in this directory.
This product includes data created by MaxMind, available from
http://www.maxmind.com/. The city name data is copyright 2008 MaxMind Inc. It
is licensed under a custom license, similar to the BSD license. For more
information, see LICENSE_WC.txt
in this directory.
Contents
This is a partial listing of the contents of this package.
-
data/
- the city name and thesaurus data files -
LICENSE.txt
- the copyright license for the Python code in this package -
LICENSE_WC.txt
- the copyright license for the city name data -
LICENSE_WN.txt
- the copyright license for the thesaurus data -
requirements.txt
- the pip requirements for installing this package -
requirements-test.txt
- the pip requirements for testing this package -
rumbleinthejungle.py
- the Python module containing the program -
README.md
- this file -
setup.py
- Python setuptools configuration file for packaging this program -
test_rumbleinthejungle.py
- unit tests for rumbleinthejungle
The data/
directory contains the following files:
-
cities.dat
- a list of cities of the world -
th_en_US_v2.dat
- the thesaurus database -
th_en_US_v2.idx
- an index of the thesaurus database
How it works
The algorithm is relatively simple.
- get synonyms for some simple "fight" words from a thesaurus
(
data/th_en_US_v2.dat
) that appears to have come originally from WordNet - get a list of cities from a trimmed version of a database from MaxMind
(
data/cities.dat
) - get the pronunciation of the words from the CMU Pronunciation Dictionary, via the pronunciation library.
- compare the last few sounds in the pronunciation of each "fight" word and each city to check if they rhyme
Installing
This application requires Python version 3.2 or later.
It also requires the Python package pronouncing to be installed.
pip install pronouncing
How to use
python -m rumbleinthejungle
Testing
The Python unit tests are contained in the test_rumbleinthejungle.py
file. To run the test suite, run the command
python setup.py test
Contact
Jeffrey Finkelstein jeffrey.finkelstein@gmail.com