Suffix array implementation in python