There is a wonderful example of a rank extension provided in the sqlite3 documentation for full-text search. However, the example requires building an extension which is not explicitly detailed in the example. This repository is for the sole purpose of building the un-adulterated* example from the docs.
git clone http://github.com/coolaj86/sqlite3-fts4-rank.git
cd sqlite3-fts4-rank
make linux # or darwin (OSX) or win32 (Visual Studio)
sqlite3 --init test-fts4.sql ':memory:'
Note: *There were a few typos / errors in the example function. They have been corrected to behave as documented.