/tinysa

🔤 Minimal implementation for constructing a suffix array

Primary LanguagePythonMIT LicenseMIT

tinysa

tinysa is a minimal implementation for constructing a suffix array.

Quick Start

To install tinysa, run this command in your terminal:

$ pip install tinysa

Using tinysa, you can construct a suffix array as follows:

from tinysa.tinysa import TinySA

suffix_array = TinySA()
suffix_array.index('banana')

Then, you can find a suffix that begins with a substring as follows:

position = suffix_array.search('ana')
print(position)  # => 1