Skip to contents

Verifies the integrity of a locally installed dictionary by comparing its MD5 checksum against the bundled reference checksums. Works for both core and on-demand dictionaries.

Usage

verify_dictionary(name, format = c("qs2", "rda"), path = NULL)

Arguments

name

Character. Dictionary name (e.g., "sensorimotor", "global_surnames").

format

Character. File format to verify: "qs2" (default) or "rda".

path

Character. Custom path to search for the dictionary file. If NULL (the default), searches the standard locations (extdata, data, ondemand, cache).

Value

A list with components:

  • name: Dictionary name

  • format: File format verified

  • ok: TRUE if checksum matches, FALSE if mismatch, NA if checksum unavailable

  • expected: Expected MD5 hash from reference file

  • actual: Computed MD5 hash of the local file

  • path: Path to the local file (NA if not found)

See also

download_dictionary to download dictionaries, list_dictionaries for available dictionaries.

Examples

if (FALSE) { # \dontrun{
# Verify a core dictionary
verify_dictionary("sensorimotor")

# Verify an on-demand dictionary
verify_dictionary("global_surnames")

# Verify RDA format
verify_dictionary("english_freqs", format = "rda")

# Verify a dictionary in a custom location
verify_dictionary("english_freqs", path = "/my/data")
} # }