Skip to contents

Saves a (case_number, field, verified_value) tuple to a local overrides CSV at <cache_dir>/canonical_overrides.csv. Every subsequent morie_fetch_siu() on that cache_dir will overlay these corrections onto the regex-parsed output. The shipped inst/extdata/siu_canonical_overrides.csv.gz carries maintainer-confirmed corrections; this function lets users add their own without touching the package source.

Usage

morie_siu_record_correction(
  case_number,
  field,
  verified_value,
  note = "",
  cache_dir = file.path(tempdir(), "morie", "siu")
)

Arguments

case_number

SIU case number, e.g. "17-OVI-201".

field

Name of the column in the SIU schema (e.g. "location_of_call").

verified_value

The correct value, verified against the cached HTML (see morie_siu_audit_case()).

note

Optional one-line note describing the basis for the correction (HTML excerpt, LLM verdict, etc.).

cache_dir

Directory holding the harvester's SIU.csv.

Value

Invisibly, the path to the updated overrides CSV.

Details

This is the "memory" of the parser: every wrong cell you find and fix becomes permanent for that cache_dir. Maintainers can submit corrections upstream by sharing the resulting CSV file.

Examples

# \donttest{
# Writes the correction to a temp cache so the example never
# touches the per-user cache directory.
tmp <- tempfile("morie_siu_"); dir.create(tmp, recursive = TRUE)
morie_siu_record_correction(
  case_number = "17-OVI-201",
  field = "location_of_call",
  verified_value = "Clair Road East, City of Guelph",
  note = "HTML excerpt: 'on Clair Road East in the City of Guelph'",
  cache_dir = tmp
)
unlink(tmp, recursive = TRUE)
# }