我只是想知道你是否知道有没有基于C语言的Python扩展,可以帮助我以线性时间构建后缀树或后缀数组?
你可以查看以下这些实现方式。
http://www.daimi.au.dk/~mailund/suffix_tree.html
https://hkn.eecs.berkeley.edu/~dyoo/python/suffix_trees/
https://github.com/kvh/Python-Suffix-Tree
有个朋友改进了第一个实现,并把它放在这里。
http://researchonsearch.blogspot.com/2010/05/suffix-tree-implementation-with-unicode.html
这些都是用C语言写的实现。