Skip to content
Simple data structures and algorithms revolved mostly around tries, suffix trees, suffix arrays and other text mining activities.
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib
test
.gitignore
.npmignore
LICENSE-MIT
Makefile
README.md
grunt.js
package.json
text-tree.js
text-tree.min.js

README.md

text-tree

Simple data structure and algorithms for use in tries, suffix trees and the like.

Getting Started

Install the module with: npm install text-tree

var textTree = require('text-tree');
var trie = new textTree.trie();
trie.insert('hello world');
trie.insert('hi');
trie.insert('world');
trie.insert('wonderful');
trie.insert('wicked');
trie.autoComplete('wo'); // ['wonderful', 'world']
// Alternatively if you are using client side javascript
<script type="text/javascript" src="text-tree.min.js"></script>
<script type="text/javascript">
var trie = new textTree.trie();
trie.insert('hello world');
trie.insert('hi');
trie.insert('world');
trie.insert('wonderful');
trie.insert('wicked');
console.log(trie.autoComplete('wo')); // ['wonderful', 'world']
</script>

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using grunt.

License

Copyright (c) 2013 Thomas Holloway
Licensed under the MIT license.

Something went wrong with that request. Please try again.