首页 | 本学科首页   官方微博 | 高级检索  
     

分块法的模式匹配算法的研究
引用本文:巫喜红. 分块法的模式匹配算法的研究[J]. 重庆邮电大学学报(自然科学版), 2014, 26(4): 551-555
作者姓名:巫喜红
作者单位:嘉应学院 计算机学院,广东梅州 514015
基金项目:广东省科技创新项目(2012KJCX0097)
摘    要:为提高模式匹配算法性能,介绍经典的模式匹配算法Byoer-Moore和Sunday,分析它们改进后的效率,根据分块法的特点,提出一种新的分块模式匹配(block pattern matching,BPM)算法?BPM算法在预处理阶段先确定模式串的首字符在文本串的位置,再确定此字符后长度等于模式串长度的字符是否等于模式串的尾字符,若符合条件,采用单链表存储结构进行存储,在匹配阶段,利用单链表信息进行双向匹配?实验结果表明,BPM算法大大减少了匹配次数和字符比较个数,从而提高匹配效率?

关 键 词:分块法  模式匹配  分块模式匹配(BPM)算法  BM算法  Sunday算法
收稿时间:2013-06-27
修稿时间:2014-02-28

Pattern matching algorithm based on block method
WU Xihong. Pattern matching algorithm based on block method[J]. Journal of Chongqing University of Posts and Telecommunications, 2014, 26(4): 551-555
Authors:WU Xihong
Affiliation:Department of Computer Science and Technology,Jiaying University,Meizhou 514015,P.R.China
Abstract:In order to improve the performance of pattern matching algorithms,the paper analyses the classic BM and Sunday algorithm and their improved efficiency,then it poses a new pattern matching algorithm: block-pattern-matching (BPM) algorithm according to the characteristics of the block method.In the Preprocessing stage,firstly,the BPM algorithm confirms the position of the pattern string''s first character in the text string,secondly,after skipping some characters which the length equal to the pattern string minus 1,it confirms whether the character equals to the texts tring''s tail character.If it matches the condition,the BPM algorithm saves the position of the first and the tail characters through the single link list storage structure.In the matching stage,the BPM algorithm uses the mode of bidirectional parallel matching.The experimental results show that the BPM algorithm reduces greatly the match number times and the character comparison,thus it improves the matching efficiency.
Keywords:block method  pattern matching  block pattern matching(BPM) algorithm  BM algorithm  Sunday algorithm
点击此处可从《重庆邮电大学学报(自然科学版)》浏览原始摘要信息
点击此处可从《重庆邮电大学学报(自然科学版)》下载全文
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号