From 1b9526e585b579884dd84657f9f69bbbd9299ae2 Mon Sep 17 00:00:00 2001 From: John Kerl Date: Mon, 3 Jan 2022 21:40:53 -0500 Subject: [PATCH] More codespell fixes (#834) * Fix mlr tail -n4 * More codespell fixes --- .codespellignore | 8 +++++++ .github/workflows/codespell.yml | 1 + docs/src/_static/classic.css | 2 +- docs/src/file-formats.md | 22 ++----------------- docs/src/file-formats.md.in | 22 ++----------------- docs/src/genmd-filter | 2 +- docs/src/glossary.md | 4 ++-- docs/src/glossary.md.in | 4 ++-- docs/src/manpage.md | 6 ++--- docs/src/manpage.txt | 6 ++--- docs/src/performance.md | 2 +- docs/src/performance.md.in | 2 +- docs/src/reference-dsl-control-structures.md | 2 +- .../reference-dsl-control-structures.md.in | 2 +- docs/src/reference-dsl-output-statements.md | 2 +- .../src/reference-dsl-output-statements.md.in | 2 +- docs/src/reference-main-arithmetic.md | 2 +- docs/src/reference-main-arithmetic.md.in | 2 +- docs/src/reference-main-flag-list.md | 4 ++-- docs/src/reference-main-null-data.md | 8 +++---- docs/src/reference-main-null-data.md.in | 8 +++---- docs/src/sorting.md | 2 +- docs/src/sorting.md.in | 2 +- docs/src/streaming-and-memory.md | 2 +- docs/src/streaming-and-memory.md.in | 2 +- internal/pkg/cli/option_parse.go | 4 ++-- internal/pkg/dsl/cst/emit_emitp.go | 2 +- internal/pkg/lib/regex.go | 4 ++-- internal/pkg/pbnjay-strptime/strptime.go | 4 ++-- internal/pkg/scan/type.go | 14 ++++++------ internal/pkg/transformers/head.go | 10 +++++++++ internal/pkg/transformers/tail.go | 10 +++++++++ internal/pkg/types/mlrval_typing.go | 2 +- man/manpage.txt | 2 +- man/mlr.1 | 4 ++-- 35 files changed, 85 insertions(+), 92 deletions(-) diff --git a/.codespellignore b/.codespellignore index e69de29bb..47d74f273 100644 --- a/.codespellignore +++ b/.codespellignore @@ -0,0 +1,8 @@ +denom +inTerm +inout +iput +nd +nin +numer +Wit diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml index 6a6e7f431..efc551780 100644 --- a/.github/workflows/codespell.yml +++ b/.github/workflows/codespell.yml @@ -32,4 +32,5 @@ jobs: check_filenames: true ignore_words_file: .codespellignore exclude_file: docs/src/data/english-words.txt + exclude_file: docs/src/data/colours.csv diff --git a/docs/src/_static/classic.css b/docs/src/_static/classic.css index c18792d87..ecc196ac8 100644 --- a/docs/src/_static/classic.css +++ b/docs/src/_static/classic.css @@ -244,7 +244,7 @@ code { } th, dl.field-list > dt { - background-color: #ede; + background-color: #e0d0e0; } .warning code { diff --git a/docs/src/file-formats.md b/docs/src/file-formats.md index df48e3ffc..1cbda18d8 100644 --- a/docs/src/file-formats.md +++ b/docs/src/file-formats.md @@ -206,7 +206,7 @@ purple square 0 91 0.259926 0.824322 0.723735 6.854221 ### Nested JSON objects -Additionally, Miller can **tabularize nested objects by concatentating keys**. If your processing has +Additionally, Miller can **tabularize nested objects by concatenating keys**. If your processing has input as well as output in JSON format, JSON structure is preserved throughout the processing:
@@ -466,7 +466,7 @@ resource=/some/other/path,loadsec=0.97,ok=false
 etc. and I just log them as needed. Then later, I can use `grep`, `mlr --opprint group-like`, etc.
 to analyze my logs.
 
-See the [seprators page](reference-main-separators.md) regarding how to specify separators other than the default equals-sign and comma.
+See the [separators page](reference-main-separators.md) regarding how to specify separators other than the default equals-sign and comma.
 
 ## NIDX: Index-numbered (toolkit style)
 
@@ -550,24 +550,6 @@ No help found for "format-conversion". Please try 'mlr help find format-conversi
 See also 'mlr help topics'.
 
- - ## Comments in data You can include comments within your data files, and either have them ignored, or passed directly through to the standard output as soon as they are encountered: diff --git a/docs/src/file-formats.md.in b/docs/src/file-formats.md.in index f34aca686..699baa8a9 100644 --- a/docs/src/file-formats.md.in +++ b/docs/src/file-formats.md.in @@ -88,7 +88,7 @@ GENMD-EOF ### Nested JSON objects -Additionally, Miller can **tabularize nested objects by concatentating keys**. If your processing has +Additionally, Miller can **tabularize nested objects by concatenating keys**. If your processing has input as well as output in JSON format, JSON structure is preserved throughout the processing: GENMD-RUN-COMMAND @@ -262,7 +262,7 @@ GENMD-EOF etc. and I just log them as needed. Then later, I can use `grep`, `mlr --opprint group-like`, etc. to analyze my logs. -See the [seprators page](reference-main-separators.md) regarding how to specify separators other than the default equals-sign and comma. +See the [separators page](reference-main-separators.md) regarding how to specify separators other than the default equals-sign and comma. ## NIDX: Index-numbered (toolkit style) @@ -308,24 +308,6 @@ GENMD-RUN-COMMAND mlr help format-conversion GENMD-EOF - - ## Comments in data You can include comments within your data files, and either have them ignored, or passed directly through to the standard output as soon as they are encountered: diff --git a/docs/src/genmd-filter b/docs/src/genmd-filter index 5da3a4731..d2fc0f334 100755 --- a/docs/src/genmd-filter +++ b/docs/src/genmd-filter @@ -96,7 +96,7 @@ end # Our job is to read foo.md.in and write foo.md. Then Mkdocs will create HTML # in the build directory. However, Mkdocs writes not foo.html but # foo/index.html. This is true for all pages except the base index.html. Also, -# in this funciton we're writing raw HTML not Markdown so we can't leverage +# in this function we're writing raw HTML not Markdown so we can't leverage # Mkdocs foo.md -> foo/index.html renaming. This also means we need to be # mindful of directory structure. Given input # index.md.in diff --git a/docs/src/glossary.md b/docs/src/glossary.md index b2c21898a..21a0624eb 100644 --- a/docs/src/glossary.md +++ b/docs/src/glossary.md @@ -325,7 +325,7 @@ A [keyword](#keyword) used for defining a A bit of callable code in the [Miller programming language](miller-programming-language.md) -which takes zero or more arguments, and optionall returns a value. +which takes zero or more arguments, and optionally returns a value. See the [page on built-in functions](reference-dsl-builtin-functions.md) to see functions which are present in Miller. @@ -456,7 +456,7 @@ entire [record stream](#streaming). See the ## manpage / manual page A form of on-line help which is [common in Unix-like operating -systems](https://en.wikipedia.org/wiki/Man_page), includig MacOS and BSD +systems](https://en.wikipedia.org/wiki/Man_page), including MacOS and BSD variants. If you've [installed Miller](installing-miller.md) using your system's package-install tools diff --git a/docs/src/glossary.md.in b/docs/src/glossary.md.in index 43b32bea4..4e7ae7961 100644 --- a/docs/src/glossary.md.in +++ b/docs/src/glossary.md.in @@ -309,7 +309,7 @@ A [keyword](#keyword) used for defining a A bit of callable code in the [Miller programming language](miller-programming-language.md) -which takes zero or more arguments, and optionall returns a value. +which takes zero or more arguments, and optionally returns a value. See the [page on built-in functions](reference-dsl-builtin-functions.md) to see functions which are present in Miller. @@ -440,7 +440,7 @@ entire [record stream](#streaming). See the ## manpage / manual page A form of on-line help which is [common in Unix-like operating -systems](https://en.wikipedia.org/wiki/Man_page), includig MacOS and BSD +systems](https://en.wikipedia.org/wiki/Man_page), including MacOS and BSD variants. If you've [installed Miller](installing-miller.md) using your system's package-install tools diff --git a/docs/src/manpage.md b/docs/src/manpage.md index e7a958405..b946fa3d3 100644 --- a/docs/src/manpage.md +++ b/docs/src/manpage.md @@ -383,7 +383,7 @@ FILE-FORMAT FLAGS csv` is the same as `--ocsv`. FLATTEN-UNFLATTEN FLAGS - These flags control how Miller converts record values which are maps or arrays, when input is JSON and ouput is non-JSON (flattening) or input is non-JSON and output is JSON (unflattening). + These flags control how Miller converts record values which are maps or arrays, when input is JSON and output is non-JSON (flattening) or input is non-JSON and output is JSON (unflattening). See the Flatten/unflatten doc page for more information. @@ -530,7 +530,7 @@ MISCELLANEOUS FLAGS --nr-progress-mod {m} With m a positive integer: print filename and record count to os.Stderr every m input records. --ofmt {format} E.g. `%.18f`, `%.0f`, `%9.6e`. Please use - sprintf-style codes for floating-point nummbers. If + sprintf-style codes for floating-point numbers. If not specified, default formatting is used. See also the `fmtnum` function and the `format-values` verb. --records-per-batch {n} This is an internal parameter for maximum number of @@ -3040,5 +3040,5 @@ SEE ALSO - 2021-12-30 MILLER(1) + 2022-01-04 MILLER(1) diff --git a/docs/src/manpage.txt b/docs/src/manpage.txt index 1a44c5f79..e0acde7ac 100644 --- a/docs/src/manpage.txt +++ b/docs/src/manpage.txt @@ -362,7 +362,7 @@ FILE-FORMAT FLAGS csv` is the same as `--ocsv`. FLATTEN-UNFLATTEN FLAGS - These flags control how Miller converts record values which are maps or arrays, when input is JSON and ouput is non-JSON (flattening) or input is non-JSON and output is JSON (unflattening). + These flags control how Miller converts record values which are maps or arrays, when input is JSON and output is non-JSON (flattening) or input is non-JSON and output is JSON (unflattening). See the Flatten/unflatten doc page for more information. @@ -509,7 +509,7 @@ MISCELLANEOUS FLAGS --nr-progress-mod {m} With m a positive integer: print filename and record count to os.Stderr every m input records. --ofmt {format} E.g. `%.18f`, `%.0f`, `%9.6e`. Please use - sprintf-style codes for floating-point nummbers. If + sprintf-style codes for floating-point numbers. If not specified, default formatting is used. See also the `fmtnum` function and the `format-values` verb. --records-per-batch {n} This is an internal parameter for maximum number of @@ -3019,4 +3019,4 @@ SEE ALSO - 2021-12-30 MILLER(1) + 2022-01-04 MILLER(1) diff --git a/docs/src/performance.md b/docs/src/performance.md index dbd7e0406..a6de11989 100644 --- a/docs/src/performance.md +++ b/docs/src/performance.md @@ -35,7 +35,7 @@ Miller can do many kinds of processing on key-value-pair data using elapsed time ## Some examples This is some data from [https://community.opencellid.org](https://community.opencellid.org): approximately 40 -million records, 0.9GB compressed, 3.2GB uncommpressed. +million records, 0.9GB compressed, 3.2GB uncompressed. First we see that decompression is much cheaper than compression: 10 seconds vs. 2.5 minutes: diff --git a/docs/src/performance.md.in b/docs/src/performance.md.in index 7c642e136..d1123e5da 100644 --- a/docs/src/performance.md.in +++ b/docs/src/performance.md.in @@ -19,7 +19,7 @@ Miller can do many kinds of processing on key-value-pair data using elapsed time ## Some examples This is some data from [https://community.opencellid.org](https://community.opencellid.org): approximately 40 -million records, 0.9GB compressed, 3.2GB uncommpressed. +million records, 0.9GB compressed, 3.2GB uncompressed. First we see that decompression is much cheaper than compression: 10 seconds vs. 2.5 minutes: diff --git a/docs/src/reference-dsl-control-structures.md b/docs/src/reference-dsl-control-structures.md index 0322dbf19..798c4e129 100644 --- a/docs/src/reference-dsl-control-structures.md +++ b/docs/src/reference-dsl-control-structures.md @@ -546,7 +546,7 @@ a=wye,b=pan,i=5,x=0.573288,y=0.863624 x_sum=2.26476 -Since uninitialized out-of-stream variables default to 0 for addition/substraction and 1 for multiplication when they appear on expression right-hand sides (not quite as in `awk`, where they'd default to 0 either way), the above can be written more succinctly as +Since uninitialized out-of-stream variables default to 0 for addition/subtraction and 1 for multiplication when they appear on expression right-hand sides (not quite as in `awk`, where they'd default to 0 either way), the above can be written more succinctly as
 mlr put '
diff --git a/docs/src/reference-dsl-control-structures.md.in b/docs/src/reference-dsl-control-structures.md.in
index 5307cfcfb..358dc2ca4 100644
--- a/docs/src/reference-dsl-control-structures.md.in
+++ b/docs/src/reference-dsl-control-structures.md.in
@@ -355,7 +355,7 @@ mlr put '
 ' ./data/small
 GENMD-EOF
 
-Since uninitialized out-of-stream variables default to 0 for addition/substraction and 1 for multiplication when they appear on expression right-hand sides (not quite as in `awk`, where they'd default to 0 either way), the above can be written more succinctly as
+Since uninitialized out-of-stream variables default to 0 for addition/subtraction and 1 for multiplication when they appear on expression right-hand sides (not quite as in `awk`, where they'd default to 0 either way), the above can be written more succinctly as
 
 GENMD-RUN-COMMAND
 mlr put '
diff --git a/docs/src/reference-dsl-output-statements.md b/docs/src/reference-dsl-output-statements.md
index 00493cdc5..84a839f44 100644
--- a/docs/src/reference-dsl-output-statements.md
+++ b/docs/src/reference-dsl-output-statements.md
@@ -360,7 +360,7 @@ parser not being able to efficiently disambiguate all the punctuational
 opportunities.
 
 So, `emit1` can handle syntactic richness in the one thing being emitted;
-`emitf`, `emit`, and `emitp` can handle syntatic richness in the side-by-side
+`emitf`, `emit`, and `emitp` can handle syntactic richness in the side-by-side
 placement, indexing, and redirection.
 
 (Mnemonic: If all you want is to insert a new record into the record stream, `emit1` is probably the one you want.)
diff --git a/docs/src/reference-dsl-output-statements.md.in b/docs/src/reference-dsl-output-statements.md.in
index 88d231145..b9da227c2 100644
--- a/docs/src/reference-dsl-output-statements.md.in
+++ b/docs/src/reference-dsl-output-statements.md.in
@@ -171,7 +171,7 @@ parser not being able to efficiently disambiguate all the punctuational
 opportunities.
 
 So, `emit1` can handle syntactic richness in the one thing being emitted;
-`emitf`, `emit`, and `emitp` can handle syntatic richness in the side-by-side
+`emitf`, `emit`, and `emitp` can handle syntactic richness in the side-by-side
 placement, indexing, and redirection.
 
 (Mnemonic: If all you want is to insert a new record into the record stream, `emit1` is probably the one you want.)
diff --git a/docs/src/reference-main-arithmetic.md b/docs/src/reference-main-arithmetic.md
index 2c42aa605..d5f5363a9 100644
--- a/docs/src/reference-main-arithmetic.md
+++ b/docs/src/reference-main-arithmetic.md
@@ -25,7 +25,7 @@ Three flags control input-scanning for numbers: `mlr -O`, `mlr -A`, and `mlr -S`
 Prefix `0x` means hexadecimal, e.g. `0xcafe`; prefix `0b` means binary, e.g.
 `0b1011`; prefix `0o` means octal, e.g. `0o377`. Numbers in data files with
 leading zeroes, e.g. `0377` or `06789`, are treated as strings in Miller,
-unless you specifiy `mlr -O`: then `0377` will scan as an octal integer (with
+unless you specify `mlr -O`: then `0377` will scan as an octal integer (with
 value 255), and `06789` will scan as a decimal integer (with value 6789).
 
 If you want all numbers from data files to be treated as floats, then you may
diff --git a/docs/src/reference-main-arithmetic.md.in b/docs/src/reference-main-arithmetic.md.in
index cbf584643..7eecc3522 100644
--- a/docs/src/reference-main-arithmetic.md.in
+++ b/docs/src/reference-main-arithmetic.md.in
@@ -9,7 +9,7 @@ Three flags control input-scanning for numbers: `mlr -O`, `mlr -A`, and `mlr -S`
 Prefix `0x` means hexadecimal, e.g. `0xcafe`; prefix `0b` means binary, e.g.
 `0b1011`; prefix `0o` means octal, e.g. `0o377`. Numbers in data files with
 leading zeroes, e.g. `0377` or `06789`, are treated as strings in Miller,
-unless you specifiy `mlr -O`: then `0377` will scan as an octal integer (with
+unless you specify `mlr -O`: then `0377` will scan as an octal integer (with
 value 255), and `06789` will scan as a decimal integer (with value 6789).
 
 If you want all numbers from data files to be treated as floats, then you may
diff --git a/docs/src/reference-main-flag-list.md b/docs/src/reference-main-flag-list.md
index 270457798..3b03fd50e 100644
--- a/docs/src/reference-main-flag-list.md
+++ b/docs/src/reference-main-flag-list.md
@@ -180,7 +180,7 @@ are overridden in all cases by setting output format to `format2`.
 
 ## Flatten-unflatten flags
 
-These flags control how Miller converts record values which are maps or arrays, when input is JSON and ouput is non-JSON (flattening) or input is non-JSON and output is JSON (unflattening).
+These flags control how Miller converts record values which are maps or arrays, when input is JSON and output is non-JSON (flattening) or input is non-JSON and output is JSON (unflattening).
 
 See the Flatten/unflatten doc page for more information.
 
@@ -268,7 +268,7 @@ These are flags which don't fit into any other category.
 * `--no-fflush`: Let buffered output not be written after every output record. The default is flush output after every record if the output is to the terminal, or less often if the output is to a file or a pipe. The default is a significant performance optimization for large files.  Use this flag to allow less-frequent updates when output is to the terminal. This is unlikely to be a noticeable performance improvement, since direct-to-screen output for large files has its own overhead.
 * `--no-hash-records`: See --hash-records.
 * `--nr-progress-mod {m}`: With m a positive integer: print filename and record count to os.Stderr every m input records.
-* `--ofmt {format}`: E.g. `%.18f`, `%.0f`, `%9.6e`. Please use sprintf-style codes for floating-point nummbers. If not specified, default formatting is used.  See also the `fmtnum` function and the `format-values` verb.
+* `--ofmt {format}`: E.g. `%.18f`, `%.0f`, `%9.6e`. Please use sprintf-style codes for floating-point numbers. If not specified, default formatting is used.  See also the `fmtnum` function and the `format-values` verb.
 * `--records-per-batch {n}`: This is an internal parameter for maximum number of records in a batch size. Normally this does not need to be modified.
 * `--seed {n}`: with `n` of the form `12345678` or `0xcafefeed`. For `put`/`filter` `urand`, `urandint`, and `urand32`.
 * `--tz {timezone}`: Specify timezone, overriding `$TZ` environment variable (if any).
diff --git a/docs/src/reference-main-null-data.md b/docs/src/reference-main-null-data.md
index 078ec734e..c07a1de1d 100644
--- a/docs/src/reference-main-null-data.md
+++ b/docs/src/reference-main-null-data.md
@@ -26,9 +26,9 @@ Miller has three kinds of null data:
 
 * **Absent (key not present)**: a field name is not present, e.g. input record is `x=1,y=2` and a `put` or `filter` expression refers to `$z`. Or, reading an out-of-stream variable which hasn't been assigned a value yet, e.g.  `mlr put -q '@sum += $x; end{emit @sum}'` or `mlr put -q '@sum[$a][$b] += $x; end{emit @sum, "a", "b"}'`.
 
-* **JSON null**: The main purpose of this is to support reading the `null` type in JSON files. The [Miller programming language](miller-programming-language.md) has a `null` keyword as well, so you can also write the null type using `$x = null`. Addtionally, though, when you write past the end of an array, leaving gaps -- e.g. writing `a[12]` when the array `a` has length 10 -- JSON-null is used to fill the gaps. See also the [arrays page](reference-main-arrays.md#auto-extend-and-null-gaps).
+* **JSON null**: The main purpose of this is to support reading the `null` type in JSON files. The [Miller programming language](miller-programming-language.md) has a `null` keyword as well, so you can also write the null type using `$x = null`. Additionally, though, when you write past the end of an array, leaving gaps -- e.g. writing `a[12]` when the array `a` has length 10 -- JSON-null is used to fill the gaps. See also the [arrays page](reference-main-arrays.md#auto-extend-and-null-gaps).
 
-You can test these programatically using the functions `is_empty`/`is_not_empty`, `is_absent`/`is_present`, and `is_null`/`is_not_null`. For the last pair, note that null means either empty or absent. Here is a full list of such functions:
+You can test these programmatically using the functions `is_empty`/`is_not_empty`, `is_absent`/`is_present`, and `is_null`/`is_not_null`. For the last pair, note that null means either empty or absent. Here is a full list of such functions:
 
 
 mlr -f | grep is_
@@ -146,7 +146,7 @@ The reasoning is as follows:
 
 * Empty values are explicit in the data so they should explicitly affect accumulations: `mlr put '@sum += $x'` should accumulate numeric `x` values into the sum but an empty `x`, when encountered in the input data stream, should make the sum non-numeric. To work around this you can use the `is_not_null` function as follows: `mlr put 'is_not_null($x) { @sum += $x }'`
 
-* Absent stream-record values should not break accumulations, since Miller by design handles heterogenous data: the running `@sum` in `mlr put '@sum += $x'` should not be invalidated for records which have no `x`.
+* Absent stream-record values should not break accumulations, since Miller by design handles heterogeneous data: the running `@sum` in `mlr put '@sum += $x'` should not be invalidated for records which have no `x`.
 
 * Absent out-of-stream-variable values are precisely what allow you to write `mlr put '@sum += $x'`. Otherwise you would have to write `mlr put 'begin{@sum = 0}; @sum += $x'` -- which is tolerable -- but for `mlr put 'begin{...}; @sum[$a][$b] += $x'` you'd have to pre-initialize `@sum` for all values of `$a` and `$b` in your input data stream, which is intolerable.
 
@@ -154,7 +154,7 @@ The reasoning is as follows:
 
 ## Absent-test functions
 
-Since absent plus absent is absent (and likewise for other operators), accumulations such as `@sum += $x` work correctly on heterogenous data, as do within-record formulas if both operands are absent. If one operand is present, you may get behavior you don't desire.  To work around this -- namely, to set an output field only for records which have all the inputs present -- you can use a pattern-action block with `is_present`:
+Since absent plus absent is absent (and likewise for other operators), accumulations such as `@sum += $x` work correctly on heterogeneous data, as do within-record formulas if both operands are absent. If one operand is present, you may get behavior you don't desire.  To work around this -- namely, to set an output field only for records which have all the inputs present -- you can use a pattern-action block with `is_present`:
 
 
 mlr cat data/het.dkvp
diff --git a/docs/src/reference-main-null-data.md.in b/docs/src/reference-main-null-data.md.in
index 837780925..4a9b44616 100644
--- a/docs/src/reference-main-null-data.md.in
+++ b/docs/src/reference-main-null-data.md.in
@@ -10,9 +10,9 @@ Miller has three kinds of null data:
 
 * **Absent (key not present)**: a field name is not present, e.g. input record is `x=1,y=2` and a `put` or `filter` expression refers to `$z`. Or, reading an out-of-stream variable which hasn't been assigned a value yet, e.g.  `mlr put -q '@sum += $x; end{emit @sum}'` or `mlr put -q '@sum[$a][$b] += $x; end{emit @sum, "a", "b"}'`.
 
-* **JSON null**: The main purpose of this is to support reading the `null` type in JSON files. The [Miller programming language](miller-programming-language.md) has a `null` keyword as well, so you can also write the null type using `$x = null`. Addtionally, though, when you write past the end of an array, leaving gaps -- e.g. writing `a[12]` when the array `a` has length 10 -- JSON-null is used to fill the gaps. See also the [arrays page](reference-main-arrays.md#auto-extend-and-null-gaps).
+* **JSON null**: The main purpose of this is to support reading the `null` type in JSON files. The [Miller programming language](miller-programming-language.md) has a `null` keyword as well, so you can also write the null type using `$x = null`. Additionally, though, when you write past the end of an array, leaving gaps -- e.g. writing `a[12]` when the array `a` has length 10 -- JSON-null is used to fill the gaps. See also the [arrays page](reference-main-arrays.md#auto-extend-and-null-gaps).
 
-You can test these programatically using the functions `is_empty`/`is_not_empty`, `is_absent`/`is_present`, and `is_null`/`is_not_null`. For the last pair, note that null means either empty or absent. Here is a full list of such functions:
+You can test these programmatically using the functions `is_empty`/`is_not_empty`, `is_absent`/`is_present`, and `is_null`/`is_not_null`. For the last pair, note that null means either empty or absent. Here is a full list of such functions:
 
 GENMD-RUN-COMMAND
 mlr -f | grep is_
@@ -70,7 +70,7 @@ The reasoning is as follows:
 
 * Empty values are explicit in the data so they should explicitly affect accumulations: `mlr put '@sum += $x'` should accumulate numeric `x` values into the sum but an empty `x`, when encountered in the input data stream, should make the sum non-numeric. To work around this you can use the `is_not_null` function as follows: `mlr put 'is_not_null($x) { @sum += $x }'`
 
-* Absent stream-record values should not break accumulations, since Miller by design handles heterogenous data: the running `@sum` in `mlr put '@sum += $x'` should not be invalidated for records which have no `x`.
+* Absent stream-record values should not break accumulations, since Miller by design handles heterogeneous data: the running `@sum` in `mlr put '@sum += $x'` should not be invalidated for records which have no `x`.
 
 * Absent out-of-stream-variable values are precisely what allow you to write `mlr put '@sum += $x'`. Otherwise you would have to write `mlr put 'begin{@sum = 0}; @sum += $x'` -- which is tolerable -- but for `mlr put 'begin{...}; @sum[$a][$b] += $x'` you'd have to pre-initialize `@sum` for all values of `$a` and `$b` in your input data stream, which is intolerable.
 
@@ -78,7 +78,7 @@ The reasoning is as follows:
 
 ## Absent-test functions
 
-Since absent plus absent is absent (and likewise for other operators), accumulations such as `@sum += $x` work correctly on heterogenous data, as do within-record formulas if both operands are absent. If one operand is present, you may get behavior you don't desire.  To work around this -- namely, to set an output field only for records which have all the inputs present -- you can use a pattern-action block with `is_present`:
+Since absent plus absent is absent (and likewise for other operators), accumulations such as `@sum += $x` work correctly on heterogeneous data, as do within-record formulas if both operands are absent. If one operand is present, you may get behavior you don't desire.  To work around this -- namely, to set an output field only for records which have all the inputs present -- you can use a pattern-action block with `is_present`:
 
 GENMD-RUN-COMMAND
 mlr cat data/het.dkvp
diff --git a/docs/src/sorting.md b/docs/src/sorting.md
index 8819f56df..0675d18be 100644
--- a/docs/src/sorting.md
+++ b/docs/src/sorting.md
@@ -662,7 +662,7 @@ an array. Here the map keys will be `NR` values `"1"`, `"2"`, etc.
 Why would we do this? When we're operating across all records and keeping all
 of them -- densely -- accumulating them in an array is fine. If we're only
 taking a subset -- sparsely -- and we want to retain the original `NR` as keys,
-using a map is handy, since we don't need continguous keys.
+using a map is handy, since we don't need contiguous keys.
 
 
 mlr --icsv --opprint --from example.csv put -q '
diff --git a/docs/src/sorting.md.in b/docs/src/sorting.md.in
index d69d1b9e4..407433a62 100644
--- a/docs/src/sorting.md.in
+++ b/docs/src/sorting.md.in
@@ -393,7 +393,7 @@ an array. Here the map keys will be `NR` values `"1"`, `"2"`, etc.
 Why would we do this? When we're operating across all records and keeping all
 of them -- densely -- accumulating them in an array is fine. If we're only
 taking a subset -- sparsely -- and we want to retain the original `NR` as keys,
-using a map is handy, since we don't need continguous keys.
+using a map is handy, since we don't need contiguous keys.
 
 GENMD-RUN-COMMAND
 mlr --icsv --opprint --from example.csv put -q '
diff --git a/docs/src/streaming-and-memory.md b/docs/src/streaming-and-memory.md
index 8f5d67b20..36e7ae63b 100644
--- a/docs/src/streaming-and-memory.md
+++ b/docs/src/streaming-and-memory.md
@@ -166,7 +166,7 @@ input data -- and they wait for end of input to produce their output.
 Any `end` blocks you provide will not be executed until end of stream; otherwise these
 don't want for end of stream. Similarly, if you write logic to retain all records
 (see also the page on [operating on all records](operating-on-all-records.md.in))
-these will be memory-unfriendly; otherwhise they are memory-friendly.
+these will be memory-unfriendly; otherwise they are memory-friendly.
 
 Most simple operations such as `mlr put '$z = $x + $y'` are fully streaming.
 
diff --git a/docs/src/streaming-and-memory.md.in b/docs/src/streaming-and-memory.md.in
index de600a5e1..ba38b9c87 100644
--- a/docs/src/streaming-and-memory.md.in
+++ b/docs/src/streaming-and-memory.md.in
@@ -150,7 +150,7 @@ input data -- and they wait for end of input to produce their output.
 Any `end` blocks you provide will not be executed until end of stream; otherwise these
 don't want for end of stream. Similarly, if you write logic to retain all records
 (see also the page on [operating on all records](operating-on-all-records.md.in))
-these will be memory-unfriendly; otherwhise they are memory-friendly.
+these will be memory-unfriendly; otherwise they are memory-friendly.
 
 Most simple operations such as `mlr put '$z = $x + $y'` are fully streaming.
 
diff --git a/internal/pkg/cli/option_parse.go b/internal/pkg/cli/option_parse.go
index 7ed501f36..551a80666 100644
--- a/internal/pkg/cli/option_parse.go
+++ b/internal/pkg/cli/option_parse.go
@@ -2358,7 +2358,7 @@ var OutputColorizationFlagSection = FlagSection{
 // FLATTEN/UNFLATTEN FLAGS
 
 func FlattenUnflattenPrintInfo() {
-	fmt.Println("These flags control how Miller converts record values which are maps or arrays, when input is JSON and ouput is non-JSON (flattening) or input is non-JSON and output is JSON (unflattening).")
+	fmt.Println("These flags control how Miller converts record values which are maps or arrays, when input is JSON and output is non-JSON (flattening) or input is non-JSON and output is JSON (unflattening).")
 	fmt.Println()
 	fmt.Println("See the Flatten/unflatten doc page for more information.")
 }
@@ -2519,7 +2519,7 @@ var MiscFlagSection = FlagSection{
 		{
 			name: "--ofmt",
 			arg:  "{format}",
-			help: "E.g. `%.18f`, `%.0f`, `%9.6e`. Please use sprintf-style codes for floating-point nummbers. If not specified, default formatting is used.  See also the `fmtnum` function and the `format-values` verb.",
+			help: "E.g. `%.18f`, `%.0f`, `%9.6e`. Please use sprintf-style codes for floating-point numbers. If not specified, default formatting is used.  See also the `fmtnum` function and the `format-values` verb.",
 			parser: func(args []string, argc int, pargi *int, options *TOptions) {
 				CheckArgCount(args, *pargi, argc, 2)
 				options.WriterOptions.FPOFMT = args[*pargi+1]
diff --git a/internal/pkg/dsl/cst/emit_emitp.go b/internal/pkg/dsl/cst/emit_emitp.go
index 9af7a63f7..43e87243f 100644
--- a/internal/pkg/dsl/cst/emit_emitp.go
+++ b/internal/pkg/dsl/cst/emit_emitp.go
@@ -328,7 +328,7 @@ func (node *EmitXStatementNode) Execute(state *runtime.State) (*BlockExitPayload
 // Example:
 // DSL expression: @sum[$a][$b] += $n; end { dump; emit @sum }
 // Name: "sum"
-// Values: single array contaning the map
+// Values: single array containing the map
 //   {
 //     "sum": {
 //       "vee": {
diff --git a/internal/pkg/lib/regex.go b/internal/pkg/lib/regex.go
index 6f241f3ee..fe9810f5b 100644
--- a/internal/pkg/lib/regex.go
+++ b/internal/pkg/lib/regex.go
@@ -15,8 +15,8 @@
 //   where the '=~' sets the captures and the "\2:\1" uses them.  (Note that
 //   https://github.com/johnkerl/miller/issues/388 has a better suggestion
 //   which would make the captures explicit as variables, rather than implicit
-//   within CST state -- regardless, the current syntax will still be supprted
-//   for backward compatability and so is here to stay.) Here we make use of Go
+//   within CST state -- regardless, the current syntax will still be supported
+//   for backward compatibility and so is here to stay.) Here we make use of Go
 //   regexp-library functions to write to, and then later interpolate from, a
 //   captures array which is stored within CST state. (See the `runtime.State`
 //   object.)
diff --git a/internal/pkg/pbnjay-strptime/strptime.go b/internal/pkg/pbnjay-strptime/strptime.go
index d0a2f7fd7..fdbdfc857 100644
--- a/internal/pkg/pbnjay-strptime/strptime.go
+++ b/internal/pkg/pbnjay-strptime/strptime.go
@@ -43,7 +43,7 @@ THE SOFTWARE.
 // supported specifier (i.e. there must be intervening text to match first)
 
 // Local mods (johnkerl 2021-10-17): ParseTZ and strptime_tz supporting
-// Miller's idiosyncracies.
+// Miller's idiosyncrasies.
 
 package strptime
 
@@ -214,7 +214,7 @@ var (
 	// ErrFormatMismatch means that intervening text in the strptime format string did not
 	// match within the parsed string.
 	ErrFormatMismatch = errors.New("date format mismatch")
-	// ErrFormatUnsupported means that the format string includes unsupport percent-escapes.
+	// ErrFormatUnsupported means that the format string includes unsupported percent-escapes.
 	ErrFormatUnsupported = errors.New("date format contains unsupported percent-encodings")
 
 	formatMap = map[int]string{
diff --git a/internal/pkg/scan/type.go b/internal/pkg/scan/type.go
index 674969ee4..6a833d6a6 100644
--- a/internal/pkg/scan/type.go
+++ b/internal/pkg/scan/type.go
@@ -6,13 +6,13 @@ type ScanType int
 
 const (
 	scanTypeString                ScanType = 0
-	scanTypeDecimalInt                     = 1
-	scanTypeLeadingZeroDecimalInt          = 2
-	scanTypeOctalInt                       = 3
-	scanTypeLeadingZeroOctalInt            = 4
-	scanTypeHexInt                         = 5
-	scanTypeBinaryInt                      = 6
-	scanTypeMaybeFloat                     = 7
+	scanTypeDecimalInt            ScanType = 1
+	scanTypeLeadingZeroDecimalInt ScanType = 2
+	scanTypeOctalInt              ScanType = 3
+	scanTypeLeadingZeroOctalInt   ScanType = 4
+	scanTypeHexInt                ScanType = 5
+	scanTypeBinaryInt             ScanType = 6
+	scanTypeMaybeFloat            ScanType = 7
 )
 
 const typeNameString = "string"
diff --git a/internal/pkg/transformers/head.go b/internal/pkg/transformers/head.go
index 3b0526fb2..79869f841 100644
--- a/internal/pkg/transformers/head.go
+++ b/internal/pkg/transformers/head.go
@@ -71,6 +71,16 @@ func transformerHeadParseCLI(
 		} else if opt == "-n" {
 			headCount = cli.VerbGetIntArgOrDie(verb, opt, args, &argi, argc)
 
+			// This is a bit of a hack. In our Getoptify routine we preprocess
+			// the command line sending '-xyz' to '-x -y -z', but leaving
+			// '--xyz' as-is. Also, Unix-like tools often support 'head -n4'
+			// and 'tail -n4' in addition to 'head -n 4' and 'tail -n 4'.  Our
+			// getoptify paradigm, combined with syntax familiar to users,
+			// means we get '-n -4' here. So, take the absolute value to handle this.
+			if headCount < 0 {
+				headCount = -headCount
+			}
+
 		} else if opt == "-g" {
 			groupByFieldNames = cli.VerbGetStringArrayArgOrDie(verb, opt, args, &argi, argc)
 
diff --git a/internal/pkg/transformers/tail.go b/internal/pkg/transformers/tail.go
index f96b12190..bc575ae13 100644
--- a/internal/pkg/transformers/tail.go
+++ b/internal/pkg/transformers/tail.go
@@ -71,6 +71,16 @@ func transformerTailParseCLI(
 		} else if opt == "-n" {
 			tailCount = cli.VerbGetIntArgOrDie(verb, opt, args, &argi, argc)
 
+			// This is a bit of a hack. In our Getoptify routine we preprocess
+			// the command line sending '-xyz' to '-x -y -z', but leaving
+			// '--xyz' as-is. Also, Unix-like tools often support 'head -n4'
+			// and 'tail -n4' in addition to 'head -n 4' and 'tail -n 4'.  Our
+			// getoptify paradigm, combined with syntax familiar to users,
+			// means we get '-n -4' here. So, take the absolute value to handle this.
+			if tailCount < 0 {
+				tailCount = -tailCount
+			}
+
 		} else if opt == "-g" {
 			groupByFieldNames = cli.VerbGetStringArrayArgOrDie(verb, opt, args, &argi, argc)
 
diff --git a/internal/pkg/types/mlrval_typing.go b/internal/pkg/types/mlrval_typing.go
index efb4180c2..85ad30d48 100644
--- a/internal/pkg/types/mlrval_typing.go
+++ b/internal/pkg/types/mlrval_typing.go
@@ -1,6 +1,6 @@
 // ================================================================
 // Support for things like 'num x = $a + $b' in the DSL, wherein we check types
-// at assigment time.
+// at assignment time.
 // ================================================================
 
 package types
diff --git a/man/manpage.txt b/man/manpage.txt
index 1430d2d96..e0acde7ac 100644
--- a/man/manpage.txt
+++ b/man/manpage.txt
@@ -3019,4 +3019,4 @@ SEE ALSO
 
 
 
-                                  2021-12-30                         MILLER(1)
+                                  2022-01-04                         MILLER(1)
diff --git a/man/mlr.1 b/man/mlr.1
index 8c2d07613..c8af460bf 100644
--- a/man/mlr.1
+++ b/man/mlr.1
@@ -2,12 +2,12 @@
 .\"     Title: mlr
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: ./mkman.rb
-.\"      Date: 2021-12-30
+.\"      Date: 2022-01-04
 .\"    Manual: \ \&
 .\"    Source: \ \&
 .\"  Language: English
 .\"
-.TH "MILLER" "1" "2021-12-30" "\ \&" "\ \&"
+.TH "MILLER" "1" "2022-01-04" "\ \&" "\ \&"
 .\" -----------------------------------------------------------------
 .\" * Portability definitions
 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~