1 / 85

Dictionary Matching and Indexing with Edits and Don’t Cares

Dictionary Matching and Indexing with Edits and Don’t Cares. Richard Cole NYU. Lee-Ad Gottlieb NYU. Moshe Lewenstein Bar-Ilan. Pattern Matching. Various problems of the following flavor: Preprocess a text t , or a collection of strings d 1 ,…,d x ,

shyla
Télécharger la présentation

Dictionary Matching and Indexing with Edits and Don’t Cares

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Dictionary Matching and Indexing with Edits and Don’t Cares Richard Cole NYU Lee-Ad Gottlieb NYU Moshe Lewenstein Bar-Ilan

  2. Pattern Matching • Various problems of the following flavor: • Preprocess a text t, or a collection of strings d1,…,dx, • so that given a query string p, all matches with the text can be found quickly. Indexing Dictionary queries Dictionary matching All-to-all matching

  3. Pattern Matching • Dictionary queries. BateBeat Boat Boot Beta

  4. Pattern Matching • Dictionary matching. BateBeat Boat Boot The fish beat my boot.

  5. Pattern Matching • Text indexing. abracadabra ra ra

  6. Pattern Matching • All-to-all matching. BateBeat Boat Boot bat boots be

  7. Previous Work b Dictionary Queries BateBeat Boat Boot a e o t a Beta a o e t t t

  8. Previous Work b Dictionary Queries BateBeat Boat Boot a e o t a Beta a o e t t t

  9. Suffix Tree g o Text Indexing Oogog oogog ogog gog og g o g o g g o g o oog g

  10. Suffix Tree g o Text Indexing Oogog oogog ogog gog og g o g o g g o g o oog g

  11. Suffix Tree g o Text Indexing Oogog oogog ogog gog og g o g o g g o g o oog g

  12. Suffix Tree g o Text Indexing Oogog oogog ogog gog og g o g o g g o g o oog g

  13. Approximate Matches • Wildcards (don’t cares) Boat Bo*t • Substitutions Boat Boot • Edits – insertions and deletions Boat B_at

  14. Previous Work – Best Results • Indexing and Dictionary Matching (edits) • Buchsbaum, Goodrich, Westbrook. k=1 p log log n + occ query time n log n space • Dictionary Queries (substitutions) • Brodal, Gasieniec. k=1 p + occ query time n space

  15. Previous Work – Basic Intuition • abracadabra • Build a suffix tree for • abracadab • abracada • abracad • abraca • abrac • abra • abr • ab • a • abracadabra • And for • a • ar • arb • arba • arbad • arbada • arbadac • arbadaca • arbadacar abrac*dabra

  16. New Results • Indexing, Dictionary Queries, Dictionary Matches • Substitutions k< log np + [(c1log n)k log log n] / k! + occ query time n(c2log n)k / k! space • Edits k< log np + [(c3log n)k log log n] / k! + 3kocc query time n(c4log n)k / k! space • Wildcards in pattern k< log np + 2klog log n / k! + occ query time n +(k+log n)k / k! space

  17. Dictionary Wildcard Queries Three data structures for dictionary wildcard queries • Naïve: • O(n) space kp query time • Less-naïve: • O(n1+k) p • New data structure: • O(n logkn) 2kp

  18. Naïve Approach Query string: *it f p s a i a i i r t y n t t

  19. Naïve Approach Query string: *it f p s a i a i i r t y n t t

  20. Naïve Approach Query string: *it f p s a i a i i r t y n t t

  21. Naïve Approach Query string: *it f p s a i a i i r t y n t t

  22. Naïve Approach Query string: *it f p s a i a i i r t y n t t

  23. Naïve Approach Query string: *it f p s a i a i i r t y n t t

  24. Naïve Approach Query string: *it f p s a i a i i Query time: k p r t y n t t

  25. Less-Naïve Approach f p s a i a i i r t y n t t

  26. Less-Naïve Approach f p s * a i a i i a i n r t y n t r t t t y

  27. Less-Naïve Approach Query string: *it f p s * a i a i i a i n r t y n t r t t t y

  28. Less-Naïve Approach Query string: *it f p s * a i a i i a i n r t y n t r t t t y

  29. Less-Naïve Approach Query string: *it f p s * a i a i i a i n r t y n t r t t t y

  30. Less-Naïve Approach Query string: *it f p s * a i a i i a i n r t y n t r t t t y Query time: p

  31. Less-Naïve Approach * f p s a i a i i * * r t y n t * t Space: O(n1+k)

  32. New Approach f p s a i a i i r t y n t t

  33. New Approach f p s * a i a i i a i r t y n t n y t t

  34. New Approach Query string: *it f p s * a i a i i a i r t y n t n y t t

  35. New Approach Query string: *it f p s * a i a i i a i r t y n t n y t t

  36. New Approach Query string: *it f p s * a i a i i a i r t y n t n y t t

  37. New Approach Query string: *it f p s * a i a i i a i r t y n t n y t t

  38. New Approach Query string: *it f p s * a i a i i a i r t y n t n y t t

  39. New Approach Query string: *it f p s * a i a i i a i r t y n t n y t t Query time: 2kp

  40. Space Analysis • Create a wildcard subtree at each node in the original trie. • heaviest child is not in the wildcard tree. • Look at any leaf of the trie • How many of its ancestors were not the heaviest child? log2n • So it appears in at most log nwildcard trees. • Space: n log n n logkn

  41. Edit Distance • Wildcards is (algorithmically) the simplest type of approximate search. • What issues come up when dealing with substitutions, insertions and deletions?

  42. Substitution Search Query string: aab a b a b a a b a

  43. Substitution Search Query string: aab a b a b a a b a

  44. Substitution Search Query string: aab a b a b a a b a

  45. Substitution Search Query string: aab a b a b a a b a

  46. Substitution Search Query string: aab a b a b a a b a

  47. Substitution Search Query string: aab a b a b a a b a

  48. Substitution Search Query string: aab a b a b a a b a

  49. Substitution Search Query string: aab a b a b a a b a

  50. Substitution Tree Query string: aab a b a b a a b a

More Related