Skip to content

Latest commit

 

History

History
40 lines (28 loc) · 715 Bytes

README.md

File metadata and controls

40 lines (28 loc) · 715 Bytes

datrie4ts

About

Double Array Trie written in TypeScript

  • sdatrie.ts
    • static double array
  • ddatrie.ts
    • dynamic double array(coming soon)

Usage

///<reference path="sdatrie.ts" />
var keys = ['aa', 'ab', 'bb', 'bc']; //keys must be sorted alphabetically
var results = [1, 2, 3, 4]; //results are values corresponding to keys
var datrie = new DATrie.StaticDoubleArrayTrieImpl<number>();
datrie.build(keys, results);
var r = datrie.commonPrefixSearch('a'); //return [1, 2]
var e = datrie.exactMatchSearch('aa'); //return 1

Test

$ karma start

Install

$ npm install datrie4ts

Author

Takayuki Hasegawa takayuki.hasegawa0311@gmail.com