Suffix Trees in Ada 95

Rob Irving & Lorna Love, University of Glasgow

General

This is an Ada 95 package that provides for construction and use of suffix

trees. The procedures provided by the package are summarised as follows.

(Further details can be found in the header comments in the package specification,

suffix_tree.ads.)

 

The demonstration program

The demo program has a simple text-based interface. It should be run from a command line with one or two files as its parameters. With a single file parameter, it constructs the suffix tree for the string contained in that file (replacing new-lines by blanks in a text file), and reports some statistical information on the tree. It then finds a longest repeated substring, and offers the user the option to input a sequence of search strings, reporting the number of occurrences in each case. With two files as parameters, it constructs the generalised suffix tree for these two strings and finds a longest common substring.

 

Source code

The src folder contains the source code, written in Ada 95. It consists of the following:

These packages are portable, and may be compiled with any Ada 95 compiler.

 

Executable

The bin folder contains executable versions of a demonstration program for Windows and Unix (PC x86 and Sparc Solaris)

 

DISCLAIMER: this software is not supported, and although it has been subjected to extensive testing, the authors cannot take responsibility for any loss etc. resulting from errors or unexpected behaviour.

Copies of the source may be made freely for private study or educational use, provided that the program headers acknowledging the authors are retained.

 

References

1. E. Ukkonen, On-line construction of suffix trees, Algorithmica 14 (3), 249-260 (1995).