===========
PyJoke
===========
PyJoke is a package for fetching the perfect joke in a database.
You give a sentence, you get a joke. Isn't that great? Common usage is::
#!/usr/bin/env python
from pyjoke.PyJoke import *
p = PyJoke()
p.changeParams() # To change the parameters on the fly
print p.getTheJoke("keywords listed as such")
PyJoke has been developed for as a NAO module (in French), but can also work as a standalone.
It should be possible to make it work in English.
### How does it work?
* Give a sentence to PyJoke (see script above)
* PyJoke will analyse the sentence
* First, create a keywords list (by removing stopwords)
* If POSTAG is active, it will add a score to each kword
* Then, create a query, connect to database and send query
* The query (above) is meant to filter the jokes
It will get the jokes with at least 1 keyword
* Then, score each joke
* And return the best one
### What can the user change?
* Config a MySQL or a SQLite database
* Use of Postag (and the scores)
* NAO mode
* Language (French by default)
* Maximum joke length
* Conversation mode (experimental)
### Database format
The joke database needs to have two fields at least:
* text
* score
Text being the joke itself, and score being an arbitrary score that's not going to be used, really (should do that...)
### Useful libs and dependencies
PyJoke has dependencies, some are optional
* NTLK
* SQLite (or MySQL)
* YAML
* TreeTagger (opt)
* /usr/lib/sqlite3/pcre.so (opt)
PyJoke
===========
PyJoke is a package for fetching the perfect joke in a database.
You give a sentence, you get a joke. Isn't that great? Common usage is::
#!/usr/bin/env python
from pyjoke.PyJoke import *
p = PyJoke()
p.changeParams() # To change the parameters on the fly
print p.getTheJoke("keywords listed as such")
PyJoke has been developed for as a NAO module (in French), but can also work as a standalone.
It should be possible to make it work in English.
### How does it work?
* Give a sentence to PyJoke (see script above)
* PyJoke will analyse the sentence
* First, create a keywords list (by removing stopwords)
* If POSTAG is active, it will add a score to each kword
* Then, create a query, connect to database and send query
* The query (above) is meant to filter the jokes
It will get the jokes with at least 1 keyword
* Then, score each joke
* And return the best one
### What can the user change?
* Config a MySQL or a SQLite database
* Use of Postag (and the scores)
* NAO mode
* Language (French by default)
* Maximum joke length
* Conversation mode (experimental)
### Database format
The joke database needs to have two fields at least:
* text
* score
Text being the joke itself, and score being an arbitrary score that's not going to be used, really (should do that...)
### Useful libs and dependencies
PyJoke has dependencies, some are optional
* NTLK
* SQLite (or MySQL)
* YAML
* TreeTagger (opt)
* /usr/lib/sqlite3/pcre.so (opt)
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
PyJoke-0.3.0.tar.gz
(7.0 kB
view details)
File details
Details for the file PyJoke-0.3.0.tar.gz.
File metadata
- Download URL: PyJoke-0.3.0.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b612baf44072d98e5a1b0fde324751aed72b951a5c9b32c608e57fe041c39f37
|
|
| MD5 |
afa1b6f757bb9709c3137bc3efb5ce39
|
|
| BLAKE2b-256 |
38959041cf38ea9dbefc8838ba4b980f46d14848558798bccee60f2320bc1547
|