View source: R/correct_changes.R
| prepare_automated_for_review | R Documentation |
Reconstructs the automated spell-check corrections matrix
correct_changes() itself hands to its edit_fn – restoring
matrix-ness and the correspondence-matrix row name for a single-row
selection (see this file's own header comment for the real bug this
fixes), and padding with enough "to_#" columns for the widest
multi-word "from" entry. Exposed as its own function
so textcleaner_shiny's corrections-review module can render
the exact same shape correct_changes() itself will later expect
back from edit_fn – computing this independently (e.g. from the
raw, un-padded res$spellcheck$automated) produces a
narrower matrix than correct_changes()'s own internal copy,
which errors with "non-conformable arrays" the moment they're compared.
Exported (not just internal) because inst/Shiny/'s own module
files are sourced into the global environment by Shiny's own app-loading
mechanism, not into the package namespace – an unexported function is
not reachable from there by its bare name.
prepare_automated_for_review(res)
res |
List.
The in-progress |
The padded automated-corrections matrix, ready to hand to
automated_edit()/automated_edit_server (or any
other edit_fn)
Alexander Christensen <alexpaulchristensen@gmail.com>
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.