Skip to content
/ PySAIS Public

A Python C module wrapper around the SA-IS suffix array construction algorithm by Yuta Mori.

License

Notifications You must be signed in to change notification settings

AlexeyG/PySAIS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A Python C module wrapper for the SA-IS algorithm implementation by Yuta Mori. Additionally includes an implementation of a linear LCP construction algirthm.

The idea to create a C module wrapper was inspired by the CTypes wrapper from David Hughes.

Installation:

./setup.py build
./setup.py test    # optional
./setup.py install

Example:

import pysais
import numpy as np

sequence = 'mississippi$'
sa = pysais.sais(sequence)
lcp, lcp_lm, lcp_mr = pysais.lcp(sequence, sa)

for off in sa :
    print '%3d : %s' % (off, sequence[off:])

array = np.array([2, 3, 1, 0], dtype = np.int32)
sa_int = pysais.sais_int(array, 4)
lcp_int, lcp_lm_int, lcp_mr_int = pysais.lcp_int(array, sa_int)

License:

The code is available under the MIT license (see LICENSE file).

Status:

Build Status

About

A Python C module wrapper around the SA-IS suffix array construction algorithm by Yuta Mori.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •