Skip to main content
===========
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)

Metadata

Release files for PyJoke 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for PyJoke 0.3.1
File Size Uploaded
PyJoke-0.3.1.tar.gz 7.7 kB Details

Release files / PyJoke-0.3.1.tar.gz

Download URL PyJoke-0.3.1.tar.gz
Size 7.7 kB
Tags Source
SHA-256 checksum
How to use checksums
b92092af37ed742c559b2052ce5700ed85431b9407104a4c6c19bbf846ba27d8
BLAKE2b-256 checksum
How to use checksums
19c6f93aa3b2c9e09c9e3cf5b72ad66ce936722d72d535e82cbc61ba9a183287
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

0.3.3

1 release file

0.3.2

1 release file

This release

0.3.1 This release

1 release file

0.3.0

1 release file

0.2.2

1 release file

0.2.1

1 release file

0.2.0

1 release file

0.1.9

1 release file

0.1.8

1 release file

0.1.7

1 release file

0.1.6

1 release file

0.1.5

1 release file

0.1.4

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page