No description, website, or topics provided.
JavaScript
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 14 commits ahead of dmlicht:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
README.md
trie.js

README.md

trie-js

A key-value store using the trie data structure, and a word-frequency counter based on it.

var myTrie = new Trie();
myTrie.setValue("ate", 7);
myTrie.setValues({but: 4, atelier: 67, "apple juice": 90});
myTrie.inspect()

// { ate: 7,
// atelier: 67,
// 'apple juice': 90,
// but: 4 }

myTrie.getKeysFromPrefix("at");

// [ 'ate', 'atelier' ]

var wc = new myWordCountStore();
wc.insertWord("harry");
wc.insertWords(["harry", "george"]);
wc.getWordCounts();

// { harry: 2, george: 1 }