Offer cacheAs on the other query functions as well
frequencyQuery(), corpusStats(), collocationScoreQuery() and
textMetadata() take a cacheAs file too now, not because they are slow -
they are not, next to a collocation analysis running for hours - but
because a file of one's own is what keeps an analysis reproducible. KorAP
corpora grow, so the same query returns different numbers next year, and
the scores computed from them may change with the package; a result kept
next to the script stays what it was, and the script runs without a
server at all.
The parameter is documented as what it is, next to the connection's
cache, which is a transparent speed-up one can throw away.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Change-Id: I9bac8931e7a38a91adcbfe58ef4cb5bcdaaf3c47
diff --git a/man/frequencyQuery-KorAPConnection-method.Rd b/man/frequencyQuery-KorAPConnection-method.Rd
index cc9c361..5ae060a 100644
--- a/man/frequencyQuery-KorAPConnection-method.Rd
+++ b/man/frequencyQuery-KorAPConnection-method.Rd
@@ -11,6 +11,7 @@
vc = "",
conf.level = 0.95,
as.alternatives = FALSE,
+ cacheAs = NULL,
...
)
}
@@ -25,6 +26,8 @@
\item{as.alternatives}{LOGICAL that specifies if the query terms should be treated as alternatives. If \code{as.alternatives} is TRUE, the sum over all query hits, instead of the respective vc token sizes is used as total for the calculation of relative frequencies.}
+\item{cacheAs}{path to an RDS file to keep the result in. If the file exists and records the same call, it is read back instead of contacting the server; otherwise the query is run and its result stored there. Unlike the connection's \code{cache}, this file belongs to the caller, which is what keeps an analysis reproducible once the corpus has grown or the scores have changed. Defaults to \code{NULL} (no file).}
+
\item{...}{further arguments passed to or from other methods (see \code{\link[=corpusQuery]{corpusQuery()}}), most notably \code{expand}, a logical that decides if \code{query} and \code{vc} parameters are expanded to all of their combinations. It defaults to \code{TRUE}, if \code{query} and \code{vc} have different lengths, and to \code{FALSE} otherwise.}
}
\value{