Skip to content
/ PySAIS Public
forked from AlexeyG/PySAIS

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

alpae/PySAIS

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 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

Languages

  • C 96.8%
  • Python 3.2%