suffixtree

0.0.3 • Public • Published

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

Dependents (0)

Package Sidebar

Install

npm i suffixtree

Weekly Downloads

0

Version

0.0.3

License

none

Unpacked Size

14.9 kB

Total Files

8

Last publish

Collaborators

  • jimmcgaw