corpusStats: Show number of tokens in verbose mode
Also a measure to avoid the unnoticed dealing with empty VCs.
e.g.: "Getting size of virtual corpus "pubDate in 2025": 0 tokens"
Change-Id: If5b445187ebc50388497c9bc84abceab3b7fa60f
diff --git a/R/KorAPCorpusStats.R b/R/KorAPCorpusStats.R
index 589d51e..55dbd15 100644
--- a/R/KorAPCorpusStats.R
+++ b/R/KorAPCorpusStats.R
@@ -45,9 +45,9 @@
paste0(kco@apiUrl,
'statistics?cq=',
URLencode(vc, reserved = TRUE))
- log.info(verbose, "Calculating size of corpus \"", vc, "\"", sep = "")
+ log.info(verbose, "Getting size of virtual corpus \"", vc, "\"", sep = "")
res <- apiCall(kco, url)
- log.info(verbose, "\n")
+ log.info(verbose, ": ", res$tokens, " tokens\n")
if (as.df)
data.frame(vc = vc, res, stringsAsFactors = FALSE)
else