0

I'm trying to implement an algorithm in matlab which uses a suffix tree to compare strings.

I was thus wondering if there is a pre-implemented algortim to make a suffix tree for a certain string (or set of strings)? Or do I have to implement a Ukkonen algorithm myself? (Because I'm really new to using matlab for anything else than numerical analysis or algabra, so I would have the biggest problems with that).

So in short my question: 1. Is there a way to let matlab make suffix trees for you? 2. If there is not, any hints about how to implement Ukkonen yourself? For example knowing how to label edges with Strings (or vectors and then how to make a string array in matlab) would be a great help already...

Thank you to whoever is able to help me!

  • You could jus sort your set of strings and use binary search http://stackoverflow.com/questions/12698607/string-matching-in-an-alpbetically-ordered-list-the-matlab-way – Louis Ricci Oct 09 '15 at 18:17
  • Oh but I really need to compare suffixes to and prefixes afterwards, so I don't now if that will work? When I thought about my algorithm it's like a perfect opportunity to use a suffix tree, I just don't know how to implement it... – Chocolate_Althea Oct 09 '15 at 21:03
  • Unfortunately I have been unable to find an existing implementation. You might have to build your own. The answer [here](http://stackoverflow.com/questions/15517520/suffix-tree-in-matlab) gives some general pointers, but be aware that cell arrays are probably going to be slow. Matlab just isn't built for string manipulation. – beaker Oct 10 '15 at 15:13

0 Answers0