Skip to main content

Tuning Keyword Pattern Matching

  • Chapter
Book cover Patterns, Programming and Everything
  • 1140 Accesses

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 84.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 109.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info
Hardcover Book
USD 109.99
Price excludes VAT (USA)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    For example on Knuth’s MMIX [8], which is broadly representative.

References

  1. Aho, A.V., Corasick, M.J.: Efficient string matching: an aid to bibliographic search. Commun. ACM 18(6), 333–340 (1975)

    Article  MathSciNet  MATH  Google Scholar 

  2. 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

    Article  MATH  Google Scholar 

  3. 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)

    Chapter  Google Scholar 

  4. Commentz-Walter, B.: A string matching algorithm fast on the average. Tech. Rep. 79.09.007, IBM Heidelberg Scientific Center (1979)

    Google Scholar 

  5. Crochemore, M.A., Rytter, W.: Text Algorithms. Oxford University Press, Oxford (1994)

    MATH  Google Scholar 

  6. Crochemore, M.A., Rytter, W.: Jewels of Stringology. World Scientific, Singapore (2003)

    MATH  Google Scholar 

  7. Hume, A., Sunday, D.: Fast string searching. Softw. Pract. Exp. 21(11), 1221–1248 (1991)

    Article  Google Scholar 

  8. Knuth, D.E.: MMIX—A RISC Computer for the New Millennium, vol. 1, fascicle 1. Addison-Wesley, Reading (2005)

    Google Scholar 

  9. Smyth, W.F.: Computing Patterns in Strings. Addison-Wesley, Reading (2003)

    Google Scholar 

  10. Watson, B.W.: Taxonomies and toolkits of regular language algorithms. Ph.D. thesis, Faculty of Computing Science, Eindhoven University of Technology, the Netherlands (1995)

    Google Scholar 

  11. 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)

    Google Scholar 

  12. Watson, B.W., Zwaan, G.: A taxonomy of sublinear multiple keyword pattern matching algorithms. Sci. Comput. Program. 27(2), 85–118 (1996)

    Article  MathSciNet  MATH  Google Scholar 

Download references

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

Authors

Corresponding author

Correspondence to Bruce W. Watson .

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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)

Publish with us

Policies and ethics