0.1.0 • Published 9 years ago

yati v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
9 years ago

yati

yet another trie implementation written for practice purposes.

Installation

npm install yati

API

var T = new Trie()

Creates a new Trie

T.add(str)

Adds a new word to the Trie and increases the count of words +1.

T.find(str)

Finds a word in the trie. Returns the Node of the last char or null if the word doesn't exist.

T.suggestions(prefix)

Returns all the word that start with the passed prefix, providing an autocomplete like set of words.

T.count()

Returns the current amount of words in the Trie.

Tests

npm tests

License

MIT

0.1.0

9 years ago