Skip to main content Accessibility help
×
Hostname: page-component-77c89778f8-7drxs Total loading time: 0 Render date: 2024-07-22T03:19:30.355Z Has data issue: false hasContentIssue false

4 - Seminumerical String Matching

from I - Exact String Matching: The Fundamental String Problem

Published online by Cambridge University Press:  23 June 2010

Dan Gusfield
Affiliation:
University of California, Davis
Get access

Summary

Arithmetic versus comparison-based methods

All of the exact matching methods in the first three chapters, as well as most of the methods that have yet to be discussed in this book, are examples of comparison-based methods. The main primitive operation in each of those methods is the comparison of two characters. There are, however, string matching methods based on bit operations or on arithmetic, rather than character comparisons. These methods therefore have a very different flavor than the comparison-based approaches, even though one can sometimes see character comparisons hidden at the inner level of these “seminumerical” methods. We will discuss three examples of this approach: the Shift-And method and its extension to a program called agrep to handle inexact matching; the use of the Fast Fourier Transform in string matching; and the random fingerprint method of Karp and Rabin.

The Shift-And method

R. Baeza-Yates and G. Gonnet [35] devised a simple, bit-oriented method that solves the exact matching problem very efficiently for relatively small patterns (the length of a typical English word for example). They call this method the Shift-Or method, but it seems more natural to call it Shift-And. Recall that pattern P is of size n and the text T is of size m.

Definition Let M be an n by m + 1 binary valued array, with index i running from 1 to n and index j running from 1 to m.

Type
Chapter
Information
Algorithms on Strings, Trees and Sequences
Computer Science and Computational Biology
, pp. 70 - 86
Publisher: Cambridge University Press
Print publication year: 1997

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

Save book to Kindle

To save this book to your Kindle, first ensure coreplatform@cambridge.org is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about saving to your Kindle.

Note you can select to save to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.

Find out more about the Kindle Personal Document Service.

  • Seminumerical String Matching
  • Dan Gusfield, University of California, Davis
  • Book: Algorithms on Strings, Trees, and Sequences
  • Online publication: 23 June 2010
  • Chapter DOI: https://doi.org/10.1017/CBO9780511574931.006
Available formats
×

Save book to Dropbox

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Dropbox.

  • Seminumerical String Matching
  • Dan Gusfield, University of California, Davis
  • Book: Algorithms on Strings, Trees, and Sequences
  • Online publication: 23 June 2010
  • Chapter DOI: https://doi.org/10.1017/CBO9780511574931.006
Available formats
×

Save book to Google Drive

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Google Drive.

  • Seminumerical String Matching
  • Dan Gusfield, University of California, Davis
  • Book: Algorithms on Strings, Trees, and Sequences
  • Online publication: 23 June 2010
  • Chapter DOI: https://doi.org/10.1017/CBO9780511574931.006
Available formats
×