Is there a nice implementation of suffix trees in JavaScript? Something that will take a string (and a separator) and make the appropriate suffix tree?
4 Answers
Here's another implementation I wrote:
https://github.com/eikes/suffixtree/blob/master/js/suffixtree.js

- 4,811
- 2
- 31
- 31
Probably the most know implementation: http://felix-halim.net/pg/suffix-tree/index.php. But you want to search for an alternative at google site:www.cut-the-knot.org suffix-tree, too. You want too look for Matt Mahoney tutorial about the suffix-tree, too. The best tutorial on the net from a compression expert with source code in c.

- 12,486
- 7
- 35
- 72
-
Thanks! It's quite easy to understand what it's doing and modify it for my purposes. – silverasm Apr 21 '11 at 15:20
-
More specifically - Is there an easy way to check whether or not a substring exists in the tree? I went over the code and couldn't found one. Thanks – Nativ Feb 01 '17 at 20:12
-
@Nativ:Do u mean aho-corasick? I tried a little:https://phpahocorasick.codeplex.com/! – Micromega Feb 01 '17 at 20:50
find another implementation (ukkonen's) here: http://code.google.com/p/text-indexing/ ; suffixtree.JS is provided along with a HTML visualization

- 97
- 1
Here is a live website and open source project which developed that.
live version: https://zamgo.github.io/suffix-tree/website/visualizer/
source code: https://github.com/ZaMgo/suffix-tree