Abstract
I introduce two performance improvements to the Commentz-Walter family of multiple-keyword (exact) pattern matching algorithms. These algorithms (which are in the Boyer-Moore-Horspool style of keyword pattern matchers) consist of two nested loops: the outer one to process the input text and the inner one processing possible keyword matches. The guard of each loop is improved, thereby leading to non-trivial speedup, which could reach 20 % in practice, depending up on the input text and keywords.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
For example on Knuth’s MMIX [8], which is broadly representative.
References
Aho, A.V., Corasick, M.J.: Efficient string matching: an aid to bibliographic search. Commun. ACM 18(6), 333–340 (1975)
Cleophas, L., Watson, B.W., Zwaan, G.: A new taxonomy of sublinear right-to-left scanning keyword pattern matching algorithms. Sci. Comput. Program. 75, 1095–1112 (2010). doi:10.1016/j.scico.2010.04.012
Commentz-Walter, B.: A string matching algorithm fast on the average. In: Maurer, H. (ed.) Proceedings of the Sixth International Colloquium on Automata, Languages and Programming, pp. 118–131. Springer, Berlin (1979)
Commentz-Walter, B.: A string matching algorithm fast on the average. Tech. Rep. 79.09.007, IBM Heidelberg Scientific Center (1979)
Crochemore, M.A., Rytter, W.: Text Algorithms. Oxford University Press, Oxford (1994)
Crochemore, M.A., Rytter, W.: Jewels of Stringology. World Scientific, Singapore (2003)
Hume, A., Sunday, D.: Fast string searching. Softw. Pract. Exp. 21(11), 1221–1248 (1991)
Knuth, D.E.: MMIX—A RISC Computer for the New Millennium, vol. 1, fascicle 1. Addison-Wesley, Reading (2005)
Smyth, W.F.: Computing Patterns in Strings. Addison-Wesley, Reading (2003)
Watson, B.W.: Taxonomies and toolkits of regular language algorithms. Ph.D. thesis, Faculty of Computing Science, Eindhoven University of Technology, the Netherlands (1995)
Watson, B.W.: A new family and structure for Commentz-Walter-style multiple-keyword pattern matching algorithms. South Afr. Comput. J. 30, 29–33 (2003)
Watson, B.W., Zwaan, G.: A taxonomy of sublinear multiple keyword pattern matching algorithms. Sci. Comput. Program. 27(2), 85–118 (1996)
Acknowledgements
This chapter is dedicated to Judith Bishop—good friend and colleague, and an outstanding computer scientist. In the 1990’s, I was invited by Judith to present a colloquium on keyword pattern matching algorithms, then at the University of Pretoria. This research work grew directly out of the discussions surrounding the colloquium and research visit.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2012 Springer-Verlag London
About this chapter
Cite this chapter
Watson, B.W. (2012). Tuning Keyword Pattern Matching. In: Breitman, K., Horspool, R. (eds) Patterns, Programming and Everything. Springer, London. https://doi.org/10.1007/978-1-4471-2350-7_11
Download citation
DOI: https://doi.org/10.1007/978-1-4471-2350-7_11
Publisher Name: Springer, London
Print ISBN: 978-1-4471-2349-1
Online ISBN: 978-1-4471-2350-7
eBook Packages: Computer ScienceComputer Science (R0)