This is Ruby implementation of Ukkonen’s algorithm based on:
-
Mark Nelson’s C++ implementation marknelson.us/1996/08/01/suffix-trees/
-
Illya Havsiyevych’s Java implementation illya-keeplearning.blogspot.com/2009/05/suffix-trees-refactored-java-code.html
require "ukkonen" tree = SuffixTree.new("abc") p tree.contains?("bc")