1 / 68

IFT3295 Démonstration

IFT3295 Démonstration. 28 septembre 2011 Shift-And (avec erreurs). Plan. Présentation en détail de l'algorithme Shift-And (avec erreurs) Présentation de PROSITE. Shift-And (avec erreurs). Wu et Manber (1992) Base du logiciel agrep de Unix

Download Presentation

IFT3295 Démonstration

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. IFT3295Démonstration 28 septembre 2011 Shift-And (avec erreurs)

  2. Plan • Présentation en détail de l'algorithme Shift-And (avec erreurs) • Présentation de PROSITE

  3. Shift-And (avec erreurs) • Wu et Manber (1992) • Base du logiciel agrep de Unix • Recherche approximative d'un mot dans un texte • Permet les insertions, les délétions et les substitutions de caractères

  4. Shift-And (avec erreurs) • Exemple : • Texte : aabaacaabacab • Mot : aabac (|mot| = m) • Alphabet : {a, b, c} • Pré-traitement : • Pour chaque caractère x de l'alphabet, on construit un tableau de bits Sx tel que Sx[pos] = 1 si motpos = x (pour 1 <= pos <= m)

  5. Shift-And (avec erreurs) • Pré-traitement : • Pour chaque caractère x de l'alphabet, on construit un tableau de bits Sx tel que Sx[pos] = 1 si motpos = x (pour 1 <= pos <= m) a a b a c Mot : Sa Sb Sc

  6. Shift-And (avec erreurs) • Soit k, le nombre d'erreurs que l'on veut permettre • On doit construire (k+1) tableaux de bits R de taille m * (n+1) (où n = |texte|) (quoique la plupart des colonnes pourront être oubliées) : • R0, R1, …, Rk

  7. Shift-And (avec erreurs) • Les tableaux R doivent être construits dans l'ordre croissant du nombre d'erreurs • Regardons d'abord la construction de R0, qui est l'équivalent de Shift-Or (recherche exacte)

  8. Shift-And (avec erreurs) • Au départ : R0

  9. Shift-And (avec erreurs) • Objectif : trouver 1 sur la ligne m  match R0

  10. Shift-And (avec erreurs) 1 si R0j[i-1] = 1 et moti = textej+1 0 sinon R0j+1[i] = j j+1 R0 i-1 i

  11. Shift-And (avec erreurs) 1 si R0j[i-1] = 1 et moti = textej+1 0 sinon R0j+1[i] = j j+1 R0 i-1 i

  12. Shift-And (avec erreurs) 1 si R0j[i-1] = 1 et moti = textej+1 0 sinon R0j+1[i] = j j+1 R0 i-1 i

  13. Shift-And (avec erreurs) 1 si R0j[i-1] = 1 et moti = textej+1 0 sinon R0j+1[i] = j j+1 R0 i-1 i

  14. Shift-And (avec erreurs) 1 si R0j[i-1] = 1 et moti = textej+1 0 sinon R0j+1[i] = j j+1 R0 i-1 i

  15. Shift-And (avec erreurs) 1 si R0j[i-1] = 1 et moti = textej+1 0 sinon R0j+1[i] = j j+1 R0 i-1 i

  16. Shift-And (avec erreurs) 1 si R0j[i-1] = 1 et moti = textej+1 0 sinon R0j+1[i] = R0

  17. Shift-And (avec erreurs) 1 si R0j[i-1] = 1 et moti = textej+1 0 sinon R0j+1[i] = R0

  18. Shift-And (avec erreurs) • Qu'est-ce que ça représente? j j+1 R0 i-1 i

  19. Shift-And (avec erreurs) • Qu'est-ce que ça représente? j j+1 R0 i-1 i

  20. Shift-And (avec erreurs) • Qu'est-ce que ça représente? j j+1 R0 i-1 i

  21. Shift-And (avec erreurs) • Qu'est-ce que ça représente? j j+1 R0 i-1 i

  22. Shift-And (avec erreurs) • Qu'est-ce que ça représente? j j+1 R0 i-1 i

  23. Shift-And (avec erreurs) • Qu'est-ce que ça représente? j j+1 R0 i-1 i

  24. Shift-And (avec erreurs) • Cette transition peut être calculée bien plus efficacement • R0j+1 = Rshift[R0j] AND Sj+1 où Sj+1 est la table de pré-traitement du caractère qui est à la position j+1 dans le texte Sa Sb Sc

  25. Shift-And (avec erreurs) • Rshift : • On décale les bits à droite d'une position, on élimine le dernier bit et on insère 1 à gauche Rshift[00000] = 10000 Rshift[10001] = 11000

  26. Shift-And (avec erreurs) • R0j+1 = Rshift[R0j] AND Sj+1 Sa Sb Sc R0

  27. Shift-And (avec erreurs) • R0j+1 = Rshift[R0j] AND Sj+1 Sa Sb Sc j j+1 R0

  28. Shift-And (avec erreurs) • R0j+1 = Rshift[R0j] AND Sj+1 Sa Sb Sc j j+1 R0 0

  29. Shift-And (avec erreurs) • R0j+1 = Rshift[R0j] AND Sj+1 Sa Sb Sc j j+1 R0

  30. Shift-And (avec erreurs) • R0j+1 = Rshift[R0j] AND Sj+1 Sa Sb Sc j j+1 R0

  31. Shift-And (avec erreurs) • R0j+1 = Rshift[R0j] AND Sj+1 Sa Sb Sc j j+1 R0

  32. Shift-And (avec erreurs) • R0j+1 = Rshift[R0j] AND Sj+1 Sa Sb Sc j j+1 R0 0

  33. Shift-And (avec erreurs) • R0j+1 = Rshift[R0j] AND Sj+1 Sa Sb Sc j j+1 R0

  34. Shift-And (avec erreurs) • R0j+1 = Rshift[R0j] AND Sj+1 Sa Sb Sc j j+1 R0

  35. Shift-And (avec erreurs) • R0j+1 = Rshift[R0j] AND Sj+1 Sa Sb Sc j j+1 R0

  36. Shift-And (avec erreurs) • R0j+1 = Rshift[R0j] AND Sj+1 Sa Sb Sc j j+1 R0 0

  37. Shift-And (avec erreurs) • R0j+1 = Rshift[R0j] AND Sj+1 Sa Sb Sc j j+1 R0

  38. Shift-And (avec erreurs) • R0j+1 = Rshift[R0j] AND Sj+1 Sa Sb Sc j j+1 R0

  39. Shift-And (avec erreurs) • R0j+1 = Rshift[R0j] AND Sj+1 Sa Sb Sc R0

  40. Shift-And (avec erreurs) • Nous venons de voir la construction de R0, qui est l'équivalent de Shift-Or (recherche exacte) • Que fait-on pour R1, R2, …, Rk? • Trois types d'erreurs sont permises : insertions, délétions et substitutions

  41. Shift-And (avec erreurs) • Insertion (1er cas) : j+1 a a b a a c a a b a c a b a a R0j+1[2] = 0 i = 2

  42. Shift-And (avec erreurs) • Insertion (1er cas) : j+1 a a b a a c a a b a c a b a a b R0j+1[2] = 0 i = 2 R1j+1[2] = 1

  43. Shift-And (avec erreurs) • Insertion (2e cas) : j+1 a a b a a c a a b a c a b a a R0j+1[2] = 0 i = 2

  44. Shift-And (avec erreurs) • Insertion (2e cas) : j+1 a a b a a c a a b a c a b a b a R0j+1[2] = 0 i = 2 R1j+1[2] = 1

  45. Shift-And (avec erreurs) • Délétion (1er cas) : j+1 a a b a a c a a b a c a b a b a a b R0j+1[5] = 0 i = 5

  46. Shift-And (avec erreurs) • Délétion (1er cas) : j+1 a a b a a c a a b a c a b a b a a b R0j+1[5] = 0 i = 5 R1j+1[5] = 1

  47. Shift-And (avec erreurs) • Délétion (2e cas) : j+1 a a b a a c a a b a c a b a b a a b c R0j+1[6] = 0 i = 6 R1j+1[6] = 1

  48. Shift-And (avec erreurs) • Substitution (1er cas) : j+1 a a b a a c a a b a c a b a a b a c R0j+1[5] = 0 i = 5

  49. Shift-And (avec erreurs) • Substitution (1er cas) : j+1 a a b a a c a a b a c a b a a b a c R0j+1[5] = 0 i = 5 R1j+1[5] = 1

  50. Shift-And (avec erreurs) • Substitution (2e cas) : j+1 a a b a a c a a b a c a b a a b c a R0j+1[5] = 0 i = 5 R1j+1[5] = 1

More Related