15

I am looking for a Java implementation of the Generalized Suffix Tree (GST) with the following features:

After the creation of the GST from say 1000 strings I would like find out how many of these 1000 strings contains some other string 's'.

The search must be quiet fast, as I need to apply the search on about 100'000 candidate strings of average length 10.

Ceki
  • 26,753
  • 7
  • 62
  • 71
  • Hi, i Was wondering is you could tell me which soulution did you use in the end, i have the same issue!!! – Julia Jul 17 '10 at 06:00
  • look here: http://stackoverflow.com/questions/9452701/ukkonens-suffix-tree-algorithm-in-plain-english/9513423#9513423 – YAMM May 31 '13 at 18:34

5 Answers5

4

I created a suffix tree in Java that allows you easily add your own search functionality and other matching algorithms. My blog post, Suffix Trees in Java, has an overview as well as instructions for downloaded the latest version. My Java implementation is based on Mark Nelson's Fast String Searching With Suffix Trees article.

Update 2023-04-01

Garret Wilson
  • 18,219
  • 30
  • 144
  • 272
  • The blog post is informative but the source is not currently available (Aug'2015) as it points to https://svn.globalmentor.com/java/trunk/globalmentor-core/ which password protected. – codeDr Aug 19 '15 at 15:24
  • I'm doing my best to convert our repository from Subversion to Git and make it public again. That should happen within a week or two. Feel free to ping me if it's not available by then. Cheers. – Garret Wilson Aug 20 '15 at 05:26
  • The source code is now available via Git and on Maven Central. I've updated the answer above with the new location. – Garret Wilson Jun 18 '16 at 21:17
  • 1
    Thanks for pointing that out, @trincot. I've updated the links here and in the blog entry as well. – Garret Wilson Apr 01 '23 at 17:54
4

Try The Semantic Discovery Toolkit. It has an implementation on text/src/java/org/sd/text/radixtree

HMM
  • 2,987
  • 1
  • 20
  • 30
3

There is a Java implementation of a Non-General Suffix Tree is available at: http://illya-keeplearning.blogspot.com/2009/04/suffix-trees-java-ukkonens-algorithm.html

Dr. Max Völkel
  • 1,780
  • 2
  • 17
  • 24
2

You can find an implementation of a Generalized Suffix Tree in Java here. I tried to document it as much as I could, so you might find it useful.

abahgat
  • 13,360
  • 9
  • 35
  • 42
0

Here is my implementation of SuffixTree: https://github.com/losvald/sglj/blob/master/src/main/java/org/sglj/util/PATTrie.java

Among other things, it supports storing arbitrary data in nodes, and finding the set of values associated with the prefix.

eold
  • 5,972
  • 11
  • 56
  • 75