Sponsored Links

Sabtu, 02 Juni 2018

Sponsored Links

Fast approximate string matching with large edit distances - talart.ru
src: image2.slideserve.com

In computer science, approximate string matching (often colloquially referred to as fuzzy string searching) is the technique of finding strings that match a pattern approximately (rather than exactly). The problem of approximate string matching is typically divided into two sub-problems: finding approximate substring matches inside a given string and finding dictionary strings that match the pattern approximately.


Video Approximate string matching



Overview

The closeness of a match is measured in terms of the number of primitive operations necessary to convert the string into an exact match. This number is called the edit distance between the string and the pattern. The usual primitive operations are:[1]

  • insertion: cot -> coat
  • deletion: coat -> cot
  • substitution: coat -> cost

These three operations may be generalized as forms of substitution by adding a NULL character (here symbolized by *) wherever a character has been deleted or inserted:

  • insertion: co*t -> coat
  • deletion: coat -> co*t
  • substitution: coat -> cost

Some approximate matchers also treat transposition, in which the positions of two letters in the string are swapped, to be a primitive operation.[2]

  • transposition: cost -> cots

Different approximate matchers impose different constraints. Some matchers use a single global unweighted cost, that is, the total number of primitive operations necessary to convert the match to the pattern. For example, if the pattern is coil, foil differs by one substitution, coils by one insertion, oil by one deletion, and foal by two substitutions. If all operations count as a single unit of cost and the limit is set to one, foil, coils, and oil will count as matches while foal will not.

Other matchers specify the number of operations of each type separately, while still others set a total cost but allow different weights to be assigned to different operations. Some matchers permit separate assignments of limits and weights to individual groups in the pattern.


Maps Approximate string matching



Problem formulation and algorithms

One possible definition of the approximate string matching problem is the following: Given a pattern string P = p 1 p 2 . . . p m {\displaystyle P=p_{1}p_{2}...p_{m}} and a text string T = t 1 t 2 ... t n {\displaystyle T=t_{1}t_{2}\dots t_{n}} , find a substring T j ? , j = t j ? ... t j {\displaystyle T_{j',j}=t_{j'}\dots t_{j}} in T, which, of all substrings of T, has the smallest edit distance to the pattern P.

A brute-force approach would be to compute the edit distance to P for all substrings of T, and then choose the substring with the minimum distance. However, this algorithm would have the running time O(n3 m).

A better solution, which was proposed by Sellers[3], relies on dynamic programming. It uses an alternative formulation of the problem: for each position j in the text T and each position i in the pattern P, compute the minimum edit distance between the i first characters of the pattern, P i {\displaystyle P_{i}} , and any substring T j ? , j {\displaystyle T_{j',j}} of T that ends at position j.

For each position j in the text T, and each position i in the pattern P, go through all substrings of T ending at position j, and determine which one of them has the minimal edit distance to the i first characters of the pattern P. Write this minimal distance as E(ij). After computing E(ij) for all i and j, we can easily find a solution to the original problem: it is the substring for which E(mj) is minimal (m being the length of the pattern P.)

Computing E(mj) is very similar to computing the edit distance between two strings. In fact, we can use the Levenshtein distance computing algorithm for E(mj), the only difference being that we must initialize the first row with zeros, and save the path of computation, that is, whether we used E(i - 1,j), E(i,j - 1) or E(i - 1,j - 1) in computing E(ij).

In the array containing the E(xy) values, we then choose the minimal value in the last row, let it be E(x2y2), and follow the path of computation backwards, back to the row number 0. If the field we arrived at was E(0, y1), then T[y1 + 1] ... T[y2] is a substring of T with the minimal edit distance to the pattern P.

Computing the E(xy) array takes O(mn) time with the dynamic programming algorithm, while the backwards-working phase takes O(n + m) time.


Web Search & Information Retrieval - ppt download
src: slideplayer.com


On-line versus off-line

Traditionally, approximate string matching algorithms are classified into two categories: on-line and off-line. With on-line algorithms the pattern can be processed before searching but the text cannot. In other words, on-line techniques do searching without an index. Early algorithms for on-line approximate matching were suggested by Wagner and Fisher[4] and by Sellers[5]. Both algorithms are based on dynamic programming but solve different problems. Sellers' algorithm searches approximately for a substring in a text while the algorithm of Wagner and Fisher calculates Levenshtein distance, being appropriate for dictionary fuzzy search only.

On-line searching techniques have been repeatedly improved. Perhaps the most famous improvement is the bitap algorithm (also known as the shift-or and shift-and algorithm), which is very efficient for relatively short pattern strings. The Bitap algorithm is the heart of the Unix searching utility agrep. A review of on-line searching algorithms was done by G. Navarro.[6]

Although very fast on-line techniques exist, their performance on large data is unacceptable. Text preprocessing or indexing makes searching dramatically faster. Today, a variety of indexing algorithms have been presented. Among them are suffix trees[7], metric trees[8] and n-gram methods.[9][10] A detailed survey of indexing techniques that allows one to find an arbitrary substring in a text is given by Navarro et al.[11] A computational survey of dictionary methods (i.e., methods that permit finding all dictionary words that approximately match a search pattern) is given by Boytsov[12].


PPT - Approximate String Matching using Compressed Suffix Arrays ...
src: image.slideserve.com


Applications

The most common application of approximate matchers until recently has been spell checking.[13] With the availability of large amounts of DNA data, matching of nucleotide sequences has become an important application.[14] Approximate matching is also used in spam filtering.[15] String matching cannot be used for most binary data, such as images and music. They require different algorithms, such as acoustic fingerprinting.


Vakhitov Alexander Approximate Text Indexing. Using simple ...
src: images.slideplayer.com


See also

  • Concept search
  • Jaro-Winkler distance
  • Levenshtein distance
  • Locality-sensitive hashing
  • Metaphone
  • Needleman-Wunsch algorithm
  • Plagiarism detection
  • Regular expressions for fuzzy and non-fuzzy matching
  • Smith-Waterman algorithm
  • Soundex
  • String metric

Web Search & Information Retrieval - ppt download
src: slideplayer.com


References


Fast approximate string matching with large edit distances 4060073 ...
src: image2.slideserve.com


External links

  • Flamingo Project
  • Efficient Similarity Query Processing Project with recent advances in approximate string matching based on an edit distance threshold.
  • StringMetric project a Scala library of string metrics and phonetic algorithms
  • Natural project a JavaScript natural language processing library which includes implementations of popular string metrics


Source of the article : Wikipedia

Comments
0 Comments