【问题标题】:What are the available string matching algorithms besides Knuth-Morris-Pratt, Rabin-Karp and likes of it?除了 Knuth-Morris-Pratt、Rabin-Karp 等,还有哪些可用的字符串匹配算法?
【发布时间】:2011-02-24 15:18:31
【问题描述】:

除了 Knuth-Morris-Pratt、Rabin-Karp 等,还有哪些可用的字符串匹配算法?

【问题讨论】:

    标签: string algorithm pattern-matching knuth-morris-pratt rabin-karp


    【解决方案1】:

    这些算法被广泛引用的纲要可以在以下位置找到:

    http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.133.4896&rep=rep1&type=pdf

    包括以下算法:

    Karp-Rabin 
    Shift Or 
    Morris-Pratt 
    Knuth-Morris-Pratt
    Simon 
    Colussi 
    Galil-Giancarlo 
    Apostolico-Crochemore
    Not So Naive 
    Forward Dawg Matching  
    Boyer-Moore 
    Turbo-BM 
    Apostolico-Giancarlo 
    Reverse Colussi 
    Horspool 
    Quick Search 
    Tuned Boyer-Moore
    Zhu-Takaoka 
    Berry-Ravindran 
    Smith 
    Raita 
    Reverse Factor 
    Turbo Reverse Factor 
    Backward Oracle Matching 
    

    加上大约 15 个人。

    顺便说一句,如果您确实对此感兴趣,您可能想澄清一下您是否也对密切相关的字符串 相似度 算法(例如,Levenshtein 距离等)感兴趣。

    【讨论】:

    • 我的眼睛!我可怜的眼睛!使用 Adob​​e Acrobat 无法查看该文件。非常感谢......我只是很难过它不可读(不,我不是在开玩笑)
    • 如果你放大,还不错。还有其他版本,包括 PostScript 和 HTML(我觉得没什么用,但是 YMMV):scholar.google.com/…
    【解决方案2】:

    这个页面有很多算法的简要描述:http://www-igm.univ-mlv.fr/~lecroq/string/index.html

    【讨论】:

      【解决方案3】:

      Simone Faro 和 Thierry Lecroq 提供了一个 C 实现和对 86 种精确字符串匹配算法的参考 "String Matching Algorithms Research Tool".

      他们还提供了一个框架来对字符串匹配算法进行基准测试:

      ____________________________________________________________
      Experimental results on englishTexts
      Searching for a set of 200 patterns with length 128
      Testing 5 algorithms
      
       - [1/5] BM ..................[OK]      0.88 ms       
       - [2/5] EPSM ................[OK]      0.38 ms       
       - [3/5] KMP .................[OK]      6.23 ms       
       - [4/5] KR ..................[OK]      1.84 ms       
       - [5/5] TW ..................[OK]      2.70 ms       
      

      算法

      • BM = 博耶摩尔 (1977)
      • EPSM = 精确压缩字符串匹配算法 (2013)
      • KMP = Knuth Morris-Pratt (1977)
      • KR = 卡普·拉宾 (1987)
      • TW = 两路 (1991)

      【讨论】:

        猜你喜欢
        • 2016-10-16
        • 1970-01-01
        • 2014-02-21
        • 1970-01-01
        • 2014-05-01
        • 2014-11-26
        • 1970-01-01
        • 2020-12-07
        • 1970-01-01
        相关资源
        最近更新 更多