Skip to contents

Delegates to the compiled parser in the ecosystem's C/C++ foundation package, rmoriebricklayer (>= 0.3.5): the sixteen panel-reviewed schema fields (dates, investigator counts, witness/subject-official counts, injuries, legislation, ...) plus _language, extracted deterministically and offline. This supersedes the conservative six-field regex parse used by morie_siu_fetch_cases(), which itself now routes through the same compiled parser when available.

Usage

morie_siu_parse_report(html, engine = "auto")

morie_siu_parse_reports(htmls, engine = "auto")

Arguments

html

A length-1 character vector of raw report HTML, or the path to a saved report file.

engine

"auto", "bricklayer" or "native".

htmls

Character vector (or list) of report HTML or file paths.

Value

A named character vector: the 16 schema fields plus _language (a data frame for morie_siu_parse_reports()).

Details

The parser runs in rmoriebricklayer when available (engine = "auto"), else in rmorie's native copy of the same C++ core; morie_siu_parse_reports() parses many reports into a data frame (one row per report).

Examples

f <- morie_siu_parse_report(system.file("extdata",
  "siu_synthetic_report.html", package = environmentName(environment(morie_siu_parse_report))))
f[["number_of_subject_officials"]]
#> [1] "2"