Skip to content

lazyplatypus/DAT.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

DAT.js

This library implements a Double Array Trie (DAT) System in JavaScript. A Double-Array Trie is a structure designed to make the size compact while maintaining fast access with algorithms for retrieval. Read more about it here.

Designed as a library to support my DAT-AC algorithm, this library naturally provides support for the aho-corasick algorithm, but keeps the more traditionally linked list trie when building the double array trie. ##Install

npm install datjs

##Instructions ####Node.js

var doublearray = require('datjs');

var data = new doublearray(
{
    'redundant': 1,
    'rambunctious': 2,
    'pies': 3,
    'puncture': 4,
    'whistle': 5
 });

####Bower.js

var data = new doublearray(
{
    'redundant': 1,
    'rambunctious': 2,
    'pies': 3,
    'puncture': 4,
    'whistle': 5
 });

####With Source

var doublearray = require('./dat.js');
var data = new doublearray(
{
    'redundant': 1,
    'rambunctious': 2,
    'pies': 3,
    'puncture': 4,
    'whistle': 5
 });

##Usage ####Insert Data

data.insert('apples');
data.insert('dudes');

####Query Data

trie.contains('redundant');
trie.contains('eggs');

####Delete Data

trie.delete('rambunctious');
trie.delete('pies');

About

Double Array Trie implemented in Javascript

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published