首页 | 官方网站   微博 | 高级检索  
     

一种改进的字符串模式匹配算法
引用本文:胡金柱,熊春秀,舒江波,周星,程文涛. 一种改进的字符串模式匹配算法[J]. 模式识别与人工智能, 2010, 23(1): 103-106
作者姓名:胡金柱  熊春秀  舒江波  周星  程文涛
作者单位:华中师范大学 计算机科学系 武汉 430079
基金项目:国家教育部重点研究基地重大研究项目,湖北省科技攻关项目
摘    要:提出一种改进的字符串模式匹配算法。该算法对文本串进行预处理,即对文本串中不存在于模式串中的字符以及文本串中剩下的出现次数最少的字符分别进行标记,再通过匹配模式串的首尾字符来减少出现次数最少的字符的标记个数。发生匹配失败时,将模式串直接滑动到标记了的出现次数最少的字符处。通过实验证明,该算法的移动次数和比较次数有较大减少,耗费的额外空间的大小也不超过模式串的长度,进一步提高模式匹配的效率。

关 键 词:模式匹配  文本串  模式串  预处理  
收稿时间:2009-04-06

An Improved Character String Pattern Matching Algorithm
HU Jin-Zhu,XIONG Chun-Xiu,SHU Jiang-Bo,ZHOU Xin,CHENG Wen-Tao. An Improved Character String Pattern Matching Algorithm[J]. Pattern Recognition and Artificial Intelligence, 2010, 23(1): 103-106
Authors:HU Jin-Zhu  XIONG Chun-Xiu  SHU Jiang-Bo  ZHOU Xin  CHENG Wen-Tao
Affiliation:Department of Computer Science,Huazhong Normal University,Wuhan 430079
Abstract:By analyzing a variety of improved pattern matching algorithms,an pattern matching algorithm is improved.Firstly,the text string is preprocessed.Two kinds of characters are made up.One does not exist in the pattern string,and the other is the characters that appear the least.Secondly,through matching both the first character and the last character of the pattern string,the number of the marked characters which appear the least is reduced.If the matching fails,the pattern string directly slides to the next marked character which appears the least.Finally,experimental results show that the frequencies of the movement and the comparison decreased greatly by the improved algorithm,and the additional cost of space is less than the length of the pattern string.Moreover,the efficiency of the pattern matching is improved.
Keywords:Pattern Matching  Text String  Pattern String  Preprocessing
本文献已被 万方数据 等数据库收录!
点击此处可从《模式识别与人工智能》浏览原始摘要信息
点击此处可从《模式识别与人工智能》下载全文
设为首页 | 免责声明 | 关于勤云 | 加入收藏

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

京公网安备 11010802026262号