suffixtree
v0.0.3
Published
Suffix tree implementation in JavaScript
Downloads
2
Readme
Suffix Tree in JavaScript
A suffix tree is a data structure that allows for performant checking of substrings within a particular string.
Conceptually, the construction of the suffix tree is explained in this video.
I did this as an academic exercise to build a data structure of low-level complexity in TypeScript. (View source code.) If you need a production-ready suffix tree implementation, be careful, this has not been exhaustively tested or optimized for performance.
Installation
$ npm install suffixtree
Usage
import SuffixTree from 'suffixtree';
suffixTree = new SuffixTree('poloyolo')
suffixTree.indexesOf('olo')
=> [1, 5]
suffixTree.contains('go')
=> false