JSPM

datjs

0.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 39
  • Score
    100M100P100Q54231F
  • License MIT

A double array trie implementation

Package Exports

  • datjs

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (datjs) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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.

##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');