An alphabet is a defined set of symbols used to form strings. In string matching, assigning numbers to those symbols lets a hash function encode a pattern or text window. section 4.1
Table 4.2 Character mapping to numeric values
|
Character
|
Value
|
|
A
|
1
|
|
B
|
2
|
|
C
|
3
|
|
….
|
…
|
|
Z
|
26
|
The mapping assigns A the value 1 through Z the value 26, illustrating how symbols can be represented numerically. section 4.1
An alphabet in biological sequences
DNA uses A, T, C, and G; RNA uses the same bases but substitutes U for T; proteins use a 20-symbol alphabet corresponding to amino acids. section 4.2.2
Turning letters into a hash
With A=1 through Z=26, JOE hashes to 10 + 13 + 5 = 28, while ALI hashes to 1 + 12 + 9 = 22. section 4.1
