SuffixTreeJS
Generalized suffix tree (Ukkonen's algorithm) in javascript.
Install / Use
/learn @maclandrol/SuffixTreeJSREADME
SuffixTree JS
SuffixTree JS is a javascript implementation of Ukkonen's algorithm for "generalized suffix tree". The code is essentially based on the snippets provided here : http://www.allisons.org/ll/AlgDS/Tree/Suffix/.
This is intended for CS students or anyone who want to build a generalized suffix tree in an intuitive and easy way.
Visualization
You can enter your sequences and build your tree here : https://maclandrol.github.io/SuffixTreeJS/
The visualization is done using d3js.
####Important points:
- Your sequences should be separated by a coma (","). A space is considered as an actual character so don't put spaces between your sequences.
- The following characters are special chars used to denote the end of a sequence :
#$&%@?+* - Each internal node can be collapsed.
- The suffix on each leaf end with
[start, number]wherestartis the position of the suffix (starting at 0) andnumberis the sequence number of the sequence the suffix is from. I also use different colors for each sequence in the representation. - There is a maximum of 12 sequences allowed (since the color palette used has only 12 colors).
Check the gh-pages branch if you're interested in the visualization part. The theme used is Solo. I'm open to any suggestions and pull requests are welcome.
License
This is licensed under the MIT License
Related Skills
node-connect
339.3kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
83.9kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
339.3kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
83.9kCommit, push, and open a PR
