doc: fix a few typos

PR #86
This commit is contained in:
Eli Doran 2021-07-03 07:52:44 -04:00 committed by GitHub
parent 4499d7fdb4
commit f8197afced
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -250,8 +250,8 @@ A DFA's search code, by contrast, looks like this:
// An Aho-Corasick DFA *never* has a missing state that requires
// failure transitions to be followed. One byte of input advances the
// automaton by one state. Always.
state_id = trie.next_state(state_id, b);
if fsm.is_match(state_id) {
state_id = dfa.next_state(state_id, b);
if dfa.is_match(state_id) {
return true;
}
}
@ -278,7 +278,7 @@ there are a small number of patterns.
# More DFA tricks
As described in the previous section, one of the downsides of using a DFA
is that is uses more memory and can take longer to build. One small way of
is that it uses more memory and can take longer to build. One small way of
mitigating these concerns is to map the alphabet used by the automaton into
a smaller space. Typically, the alphabet of a DFA has 256 elements in it:
one element for each possible value that fits into a byte. However, in many
@ -425,7 +425,7 @@ method.
Since Aho-Corasick is an automaton, it is possible to do partial searches on
partial parts of the haystack, and then resume that search on subsequent pieces
of the haystack. This is useful when the haystack you're trying to search is
not stored contiguous in memory, or if one does not want to read the entire
not stored contiguously in memory, or if one does not want to read the entire
haystack into memory at once.
Currently, only standard semantics are supported for stream searching. This is