actree
Makes an auxilary tree structure to get O(m) efficient autocomplete results, (where m is the length of a search string), without use of external dependencies.<br /> The repo is holds a list of 300k english letter already formatted as tree and available fo
Last updated 2 years ago by nevos .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install actree 
SYNC missed versions from official npm registry.

actree

Creates a tree for fast and efficient autocomplete string queries. The library doesnt rely on external libs. (Trie search structure).

O(m) efficiency (where m is the length of a search string).

The repo includes a full english dictionary (data.json) decoded into a tree format, and ready for autocomplate use.

Node.js install

npm install actree

API

require
var acTree = require("actree");
#letterNode - create a word
var node = new acTree.letterNode("someword");
#addToTree - create a tree / add to tree
var tree = acTree.addToTree(null,node); 
#autocomplete - find all the words in tree that start with input text
var res = acTree.autocomplete(tree,"some");        
#autocompleteInput(tree)
call this function from <FILE.JS> that included acTree, and run it with node input: node <FILE.JS> <input search words with spaces>

var res = acTree.autocompleteInput(tree);
#createJSONTree()
call this function to recreate a new tree in data.json from sampleList file

actree.createJSONTree() ;
#useJSONTree()
call this function to view an existing usage sample

actree.useJSONTree() ;

actree.useJSONTree() ;

LICENSE

ISC , nevonat@gmail.com

Current Tags

  • 2.0.2                                ...           latest (2 years ago)

7 Versions

  • 2.0.2                                ...           2 years ago
  • 2.0.0                                ...           3 years ago
  • 1.0.4                                ...           3 years ago
  • 1.0.3                                ...           3 years ago
  • 1.0.2                                ...           3 years ago
  • 1.0.1                                ...           3 years ago
  • 1.0.0                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 4
Dependencies (0)
None
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |