The project is in a healthy, maintained state
Construct Generalized Suffix tree using Ukkonen's algorithm
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
 Project Readme

Generalised Suffix Tree - Ruby

Set up

gem install suffix_tree_ruby
           or
gem 'suffix_tree_ruby', '~> 0.0.1'

Open a ruby interactive console:

require 'suffix_tree'

Construct suffix tree using Ukkonen's algorithm

To create Suffix tree

tree = SuffixTree::Base.new(["sandollar", "sandlot", "handler", "grand", "pantry"])
tree.build

To get the longest common substring from all the words

tree.longest_common_substring
=> "an"

To get the longest common substring from at least k strings

tree.longest_common_substring(2)
=> "sand" # from the first 2 strings

tree.longest_common_substring(3)
=> "and" # from first 3 strings

Referrances

https://en.wikipedia.org/wiki/Ukkonen%27s_algorithm

https://en.wikipedia.org/wiki/Longest_common_substring_problem

http://web.stanford.edu/~mjkay/gusfield.pdf

https://web.cs.ucdavis.edu/~gusfield/cs224f09/commonsubstrings.pdf

Author

Sudheer Meka

License

Suffix Tree Ruby is released under the MIT License.