Skip to content

Commit

Permalink
Correct typos in documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
jakobnissen committed Jan 15, 2024
1 parent cfaa529 commit 93c2813
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
4 changes: 3 additions & 1 deletion docs/src/debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Is the `B` part of `alphabet` (in which case it should do nothing), or is it par
Automa will not compile this, and will raise the error:
```
ERROR: Ambiguous NFA.
After inputs "XYZ A", observing 'B' lead to conflicting action sets [:cool_band] and nothing
```

Note the error shows an example input which will trigger the ambiguity: `XYZ A`, then `B`.
Expand Down Expand Up @@ -82,6 +83,7 @@ end
@assert fasta_machine isa Automa.Machine
# output
```

When all else fails, you can also pass `unambiguous=false` to the `compile` function - but beware!
Expand Down Expand Up @@ -140,7 +142,7 @@ julia> debug(">abc\nTAG")
Note that if your machine relies on its actions to work correctly, for example by actions modifying `p`,
this kind of debugger will not work, as it replaces all actions.

## More advanced debuggning
## More advanced debugging
The file `test/debug.jl` contains extra debugging functionality and may be `include`d.
In particular it defines the functions `debug_execute` and `create_debug_function`.

Expand Down
3 changes: 1 addition & 2 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ You can view Automa as a regex engine that can insert arbitrary Julia code into

![Schema of Automa.jl](figure/Automa.png)

Automa.jl is designed to generate very efficient code to scan large text data, which is often much faster than handcrafted code.
Automa.jl is a regex engine that can insert arbitrary Julia code into its input matching process, that will be executed in when certain parts of the regex matches an input.
Automa.jl is designed to generate very efficient code to scan large text data, which is often much faster than handcrafted code.

## Where to start
If you're not familiar with regex engines, start by reading the [theory section](theory.md),
Expand Down
2 changes: 1 addition & 1 deletion docs/src/reader.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ end
```

# Creating a `Reader` type
The use of `generate_reader` as we learned in the previous section "Parsing from an io" has an issue we need to address:
The use of `generate_reader` as we learned in the previous section "Parsing from an IO" has an issue we need to address:
While we were able to read multiple records from the reader by calling `read_record` multiple times, no state was preserved between these calls, and so, no state can be preserved between reading individual records.
This is also what made it necessary to clumsily reset `p` after emitting each record.

Expand Down
2 changes: 1 addition & 1 deletion docs/src/tokenizer.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Such that e.g. `("XY", "A")` can be represented as the token sequence `lparens,

Breaking the text down to its tokens is called tokenization or lexing.
Note that lexing in itself is not sufficient to parse the format:
Lexing is _context unaware_ and doesn't understand syntax, so e.g. the test `"((A` can be perfectly well tokenized to `quote lparens lparens A`, even if it's invalid syntax.
Lexing is _context unaware_ and doesn't understand syntax, so e.g. the text `"((A` can be perfectly well tokenized to `quote lparens lparens A`, even if it's invalid syntax.

The purpose of tokenization is to make subsequent parsing easier, because each part of the text has been classified. That makes it easier to, for example, search for letters in the input.
Instead of having to muck around with regex to find the letters, you use regex once to classify all text.
Expand Down

0 comments on commit 93c2813

Please sign in to comment.