From 93c2813db07a0a556f97392381daeefe65e8ba0d Mon Sep 17 00:00:00 2001 From: Jakob Nybo Nissen Date: Mon, 15 Jan 2024 14:50:28 +0100 Subject: [PATCH] Correct typos in documentation --- docs/src/debugging.md | 4 +++- docs/src/index.md | 3 +-- docs/src/reader.md | 2 +- docs/src/tokenizer.md | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/src/debugging.md b/docs/src/debugging.md index 9970f5b6..a189eb00 100644 --- a/docs/src/debugging.md +++ b/docs/src/debugging.md @@ -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`. @@ -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! @@ -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`. diff --git a/docs/src/index.md b/docs/src/index.md index ac1513f6..13d85c55 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -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), diff --git a/docs/src/reader.md b/docs/src/reader.md index 1fedc46d..e2b95a2c 100644 --- a/docs/src/reader.md +++ b/docs/src/reader.md @@ -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. diff --git a/docs/src/tokenizer.md b/docs/src/tokenizer.md index e89e49a3..bcd0f6ea 100644 --- a/docs/src/tokenizer.md +++ b/docs/src/tokenizer.md @@ -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.