Boyer-Moore string search: Difference between revisions

m
(Python example)
Line 68:
 
def alphabet_index(c: str) -> int:
"""Return the index of the given ASCII character. in the English alphabet, counting from 0."""
val = ord(c)
assert val >= 0 and val < ALPHABET_SIZE
4,103

edits