Simple autocompletion daemon
Haskell C
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Autocompletion server

This server takes about 2.6x more memory than the raw strings themselves, uncompressed. It's very fast, and quite simple to use.

The server itself runs as an HTTP server on port 8080 (you can change this in Main.hs) which serves autocompletions for words taken from /usr/share/dict/words. All words have a score of 0; this score can be any number you want to associate with a completion, such as its likelihood.

To try it out, build and run it:

$ cabal configure
$ cabal build
$ dist/build/acdaemon/acdaemon
Serving on port 8080

Then point your web browser at http://localhost:8080/complete/lobst and you will see something like this:


You can also get JSONP output if you include a ?callback=... argument, such as


How it works

The strings for autocompletion are stored in a JudySL trie, which is very fast and space-efficient for doing prefix searches. The HTTP serving is done with the fast and asynchronous Warp web server.