Add cacheAsInfo() to read back what produced a cache file
A cacheAs file records the parameters of the call, the KorAP instance,
the index revision that instance's corpus had at the time and the version
of RKorAPClient that wrote it - which is what makes such a file worth
keeping next to a document, and until now there was no documented way of
getting at it. cacheAsInfo() returns the record, or NULL for a file
written before 1.4.0, which holds none.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Change-Id: If39a8e331a008529fda06d91862e1c498534d78a
diff --git a/man/cacheAsInfo.Rd b/man/cacheAsInfo.Rd
new file mode 100644
index 0000000..13bd1a6
--- /dev/null
+++ b/man/cacheAsInfo.Rd
@@ -0,0 +1,32 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/cacheAs.R
+\name{cacheAsInfo}
+\alias{cacheAsInfo}
+\title{What produced a cacheAs file}
+\usage{
+cacheAsInfo(cacheAs)
+}
+\arguments{
+\item{cacheAs}{path to the file, with or without its \code{.rds} extension}
+}
+\value{
+a list with the elements \code{scoreVersion}, \code{packageVersion},
+\code{parameters}, \code{dots},
+\code{apiUrl} and \code{indexRevision}, or \code{NULL} for a file written by a version
+before 1.4.0, which recorded none of this
+}
+\description{
+Reads back what a query function recorded in a \link{cacheAs} file: the parameters
+it was called with, the KorAP instance it asked, the index revision that
+instance's corpus had at the time, and the version of RKorAPClient that wrote
+the file. Useful for saying, of a result kept next to a document, what the
+numbers in it rest on.
+}
+\examples{
+\dontrun{
+KorAPConnection() |> frequencyQuery("Ameisenplage", cacheAs = "ameisenplage.rds")
+cacheAsInfo("ameisenplage.rds")
+}
+
+}
+\concept{cacheAs}