ac

1.0.2 • Public • Published

AutoComplete

Build Status Coverage Status Code Climate Dependencies devDependency Status NPM version

Autocomplete all the words!

Background

The project we are currently working on requires auto-complete with a large number of possible words.

This is an experiment to create a great auto-complete experience on a shoe-string.

Demo: http://wordsy.herokuapp.com/

Tasks

  • Load all the words into LevelDB (no need to setup a Database!)
  • Search for a complete word in LevelDB
  • Search for a partial word (to get suggestions)
  • Implement simple example UI
  • Only start searching for suggestions after the person types second char
  • When a person clicks on a word in the UI we need to count that as a "vote" for the word, so we can get some stats.
  • Put demo app on Heroku: http://wordsy.herokuapp.com/
  • Remove surplus words files (to reduce bandwidth) note: extended list is: https://github.com/nelsonic/english-words

Example: search for the first four characters of the word awesome:

Returns the following four words:

awesome
awesomely
awesomeness
awest

Got Coverage ?

npm run-script cover

Ideas (remind me to do these later)

  • Use the zipped version of the words.txt file to reduce bandwidth when installing the the module.

  • delete un-compressed version of words.txt

  • Use Socket.io for faster transport of characters and suggestions.

Research

Existing Autocompletion Libraries

There are several solutions to the autocomplete/autosuggest problem. The two most popular are:

JQuery AutoComplete is Clunky and requires JQuery UI (#bloatware) try the demo on a mobile device: http://jqueryui.com/autocomplete/#remote to see what I mean.

Typeahead is quite slick. See: https://twitter.github.io/typeahead.js/examples but is focussed on the front-end. I needed the back-end component. (i.e. a fast way of returning word suggestions from a large dictionary of words - not just a small list of US States or Cities)

Which Database Why LevelDB?

Media Wiki API

Readme

Keywords

Package Sidebar

Install

npm i ac

Weekly Downloads

1

Version

1.0.2

License

MIT

Last publish

Collaborators

  • nelsonic