Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

Suffix array implementation in python.

Project description

# pysuffixarray Suffix array implementation in python.

## Usage ### pysuffixarray.core.SuffixArray(string) Constructs a suffix array. `python from pysuffixarray.core import SuffixArray sa = SuffixArray('MISSISSIPPI') `

### SuffixArray.suffix_array() Returns a suffix array. `python sa = SuffixArray('MISSISSIPPI') sa.suffix_array() >>> [11, 10, 7, 4, 1, 0, 9, 8, 6, 3, 5, 2] `

### SuffixArray.longest_common_prefix() Returns an array of longest common prefix(LCP). LCP[i] contains the length of common prefix between SA[i] and SA[i-1]. `python sa = SuffixArray('MISSISSIPPI') sa.longest_common_prefix() >>> [0, 0, 1, 1, 4, 0, 0, 1, 0, 2, 1, 3] `

### SuffixArray.longest_repeated_substring() Returns one of the longest repeated substrings within the string. `python sa = SuffixArray('MISSISSIPPI') sa.longest_repeated_substring() >>> 'ISSI' `

Project details


Release history Release notifications

This version

0.0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pysuffixarray, version 0.0.1
Filename, size File type Python version Upload date Hashes
Filename, size pysuffixarray-0.0.1.tar.gz (2.8 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page