Skip to content

Suffix Array

Algorithm to construct a suffix array.


Functions and classes

  • iv2py.create_suffixarray

Example usages

Constructs an suffix array and uses it to print a bwt.

import iv2py as iv

reference = "Hello World"
""" creates a suffix array """
sa = iv.create_suffixarray(reference)

""" prints the BWT """
for pos in sa:
    print(reference[pos-1])

Output:

o
d

H
W
e
l
o
l
r
o
t

API

Suffix Array construction

iv2py.create_suffixarray(reference)
Returns the suffix array of reference. It will assume each byte as a single character/position in the string.