Computer Facts
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
doc/license
etc
images
pkg.debian
sbin
src/compfacts
.gitignore
COPYING.txt
MANIFEST.in
Makefile
README.rst
setup.py

README.rst

Computer facts generator

CompFacts uses a context-free grammar to generate computer facts.

These facts are regularly posted to the Twitter account @CompFacts.

An Atom feed is available at http://www.torwuf.com/compfacts/compfacts.atom.

How to help

You can help by submitting enhancements on my GitHub repository https://github.com/chfoo/CompFacts. Just fork, change, commit, and request me to pull your changes.

The Python version supported is 2.7.

Programming

The grammar productions requires the Python Natual Languge Toolkit. It can be installed through the Python Package Index.

Corpus and grammar format

The files are located in directory corpus_data.

Corpus text files are simple lists. The first portion of the filename before the dot is the nonterminal name.

Grammar text files are the production rules. The filename does not matter. The grammar follows the NLTK format.

All files support using # at the start of a line as a comment.

Generating facts

You can test out the generator by running:

python -m compfacts.grammar

Running the server

I included a sample Debian package which I use for running the package as a service. A sample nginx config file is provided. The service will refuse to run if the default compfacts.conf is not configured. Symlink debian to pkg.debian for Debian package building. The commands debuild -b -us -uc and dh_clean will build and clean respectively.

The service requires Tweepy for Twitter status updates and Tornado Web for the RSS and service status pages. Make sure to install Tweepy using pip for latest version.

The Twitter posting service's status can be checked at http://www.torwuf.com/compfacts/server_status.