Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A chatty IRC bot
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib/Failo
utils
.bashrc
.gitignore
.inputrc
.screenrc
README.mkdn
setup.sh

README.mkdn

failo

Train

pv ~avar/.irssi/logs/freenode/#avar.log\  | irchailo-seed -f irssi -b failo -n failo -r '^,\w' > avar.trn

Import

With SQLite:

time hailo --brain failo.sqlite --train avar.trn

With PostgreSQL:

dropdb failo
createdb -E UTF8 -O failo failo

# Train via sqlite
sqlite3 failo.sqlite .dump | pv > /tmp/failo.sql
pv /tmp/failo.sql | grep -e ^BEGIN -e ^INSERT -e ^COMMIT | perl -pe "s[,\K'][E']" | perl -pe 's[\\][\\\\]g' > /tmp/failo.pgsql
pv /tmp/failo.sql | grep -e ^BEGIN -e ^INSERT -e ^COMMIT | grep -v '^INSERT INTO "sqlite_sequence"' | perl -pe "s[,\K'][E']" | perl -pe 's[\\][\\\\]g' > /tmp/failo.pgsql

# Just create an empty db, hailo won't learn from this:
hailo --brain hinrk-fails --learn "token" --storage DBD::Pg --storage-args dbname=failo
echo 'delete from token;' | psql

# Import it
pv /tmp/failo.pgsql | psql failo 2>&1 | tee /tmp/pgsql.err

time hailo --brain hinrk-fails --train avar.trn --storage DBD::Pg --storage-args dbname=failo
Something went wrong with that request. Please try again.