Burrows–Wheeler Transform(简称BWT,也称作块排序压缩),我们得到了变换结果“annb$aa”。排序和组合, 下面的伪代码提供了一个逆过程的朴素实现(输入字符串s为原过程之输出): function inverseBWT(string s) 生成length(s)个空串 repeat length(s) times 将字符串s作为一列插入每个字符串的串首 对所有字符串排序 返回结尾为EOF的行 END = '\1' #必须不与原字符串中任何字符相同 def bwt(s): """对字符串进行Burrows-Wheeler变换""" s = s + END #创建所有循环字符串 table = [s[i:] + s[:i] for i in range(len(s))] #获取排序后的结果 table_sorted = table[:] table_sorted.sort() #取排序后结果的最后一列作为结果字符串 return ''.join([row[-1] for row in table_sorted]) def ibwt(r): table = [''] * len(r) for _ in r: table = sorted([r[m] + table[m] for m in range(len(r))]) s = [row for row in table if row.endswith(END)][0] return s.rstrip(END) 参考资料 外部链接 Compression comparison of BWT based file compressors Article by Mark Nelson on the BWT A Bijective String-Sorting Transform, by Gil and Scott Yuta's openbwt-v1.5.zip contains source code for various BWT routines including BWTS for bijective version On Bijective Variants of the Burrows–Wheeler Transform, by Kufleitner Blog post and project page for an open-source compression program and library based on the Burrows–Wheeler algorithm MIT open courseware lecture on BWT (Foundations of Computational and Systems Biology) 无损压缩算法 變換 带有伪代码示例的条目由此,我们得到了7对邻接字符串:

本文链接: http://488595.jzxsxx.com/html/71d299926.html (转载请保留)
作者:新涛,如若转载,请注明出处:http://488595.jzxsxx.com/html/71d299926.html




