Add corpusSize function
Resolves #2
This is a bit of a hack, but it does work with old derekovecs servers.
Change-Id: I1c8f81c7341f0df71012f5991bde5edfc83dc2b0
diff --git a/R/derekovecs.R b/R/derekovecs.R
index 9120991..a55c365 100644
--- a/R/derekovecs.R
+++ b/R/derekovecs.R
@@ -48,6 +48,18 @@
derekovecsApiCall(method = "/getClassicCollocators", w = w, ...)$f1
}
+#' Get corpus size
+#'
+#' Gets the token size of the corpus used to train the model.
+#'
+#' @param w Probe word (defaults to `Test`) required for old derekovecs servers.
+#' @param ... Additional parameters to pass to the API.
+#'
+#' @return The number of tokens in the corpus.
+#' @export
+corpusSize <- function(w = "Test", ...) {
+ derekovecsApiCall(method = "/getClassicCollocators", w = w, ...)$N
+}
#' Get paradigmatic neighbours
#'