作者投稿和查稿 主编审稿 专家审稿 编委审稿 远程编辑

计算机工程 ›› 2011, Vol. 37 ›› Issue (17): 248-249. doi: 10.3969/j.issn.1000-3428.2011.17.083

• 开发研究与设计技术 • 上一篇    下一篇

一种改进的BM模式匹配算法

刘沛骞,冯晶晶   

  1. (河南理工大学计算机科学与技术学院,河南 焦作 454001)
  • 收稿日期:2011-04-08 出版日期:2011-09-05 发布日期:2011-09-05
  • 作者简介:刘沛骞(1979-),男,副教授,主研方向:信息检索,模式识别;冯晶晶,硕士
  • 基金资助:
    河南省教育厅基金资助项目(2008B520010)

Improved BM Pattern Matching Algorithm

LIU Pei-qian, FENG Jing-jing   

  1. (College of Computer Science and Technology, Henan Polytechnic University, Jiaozuo 454001, China)
  • Received:2011-04-08 Online:2011-09-05 Published:2011-09-05

摘要: 针对BM模式匹配算法的效率问题,提出其改进算法。分析BM模式匹配算法的原理,若文本串中连续的几个字符不在模式字符串中出现,则不需要被比对,以此改变模式字符串的匹配顺序,提高算法的匹配效率。实验结果表明,改进的BM模式匹配算法可以有效地减少字符串的匹配次数和比对次数,能获得良好的字符串匹配效率。

关键词: 模式匹配, 滑动距离函数, 比对算法, 模式串

Abstract: Considering the efficiency problem of the BM pattern matching algorithm, this paper proposes an improved BM pattern matching algorithm. Analyzing the character of it, if some continuous characters are not appearing in the model string, then the characters needn’t to be compared, so this method changes the model string comparing order, and the matching efficiency of BM algorithm is enhanced. Experimental results show that the improved BM pattern matching algorithm can effectively decrease the times of string matching and comparing, and get the good string matching efficiency.

Key words: pattern matching, sliding distance function, comparison algorithm, pattern string

中图分类号: