Revert "warn on rewrites"
This reverts commit 336c85d5c1d3986e1846c2b7e5dee6a4c40192e9.
Change-Id: I1948894db742a6dfbb81a2c6cc82dd012330081f
diff --git a/NEWS.md b/NEWS.md
index 2fcfb25..0f1e00a 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,6 +1,5 @@
# RKorAPClient 1.2.0.9000
-- warnings are now issued, when queries had to be rewritten (for licensing reasons)
- fixed `fetchAnnotations()` morphology so MarMoT and other foundries keep all features from nested spans ([#30](https://github.com/KorAP/RKorAPClient/issues/30))
- reimplemented annotation parsing with `xml2`, retaining multiple lemma/POS values and improving robustness of token alignment
diff --git a/R/KorAPQuery.R b/R/KorAPQuery.R
index fa78884..a8372e3 100644
--- a/R/KorAPQuery.R
+++ b/R/KorAPQuery.R
@@ -260,9 +260,6 @@
log_info(verbose, ": API call failed\n")
totalResults <- 0
} else {
- # Check for query rewrites and warn the user
- warnOnRewrites(res)
-
totalResults <- as.integer(res$meta$totalResults)
log_info(verbose, ": ", totalResults, " hits")
if (!is.null(res$meta$cached)) {
@@ -340,9 +337,6 @@
message("API call failed.")
totalResults <- 0
} else {
- # Check for query rewrites and warn the user
- warnOnRewrites(res)
-
totalResults <- as.integer(res$meta$totalResults)
log_info(verbose, ": ", totalResults, " hits")
if (!is.null(res$meta$cached)) {
@@ -393,17 +387,6 @@
}
)
-# Helper function to check if a query rewrite warning should be shown
-warnOnRewrites <- function(res) {
- if (!is.null(res$collection$rewrites)) {
- comment <- res$collection$rewrites$`_comment`
- # Only show warning if it's not just the standard policy message
- if (!is.null(comment) && comment != "All corpus access policy has been added.") {
- warning(res$collection$rewrites$editor, " had to rewrite your query: ", comment)
- }
- }
-}
-
#' @importFrom purrr map
repair_data_strcuture <- function(x) {
if (is.list(x)) {
@@ -529,15 +512,11 @@
# Rebuild the URL with all parameters
query <- httr2::url_modify(kqo@requestUrl, query = existing_query)
-
res <- apiCall(kqo@korapConnection, query)
if (length(res$matches) == 0) {
break
}
- # Check for query rewrites and warn the user
- warnOnRewrites(res)
-
if ("fields" %in% colnames(res$matches) && (is.na(use_korap_api) || as.numeric(use_korap_api) >= 1.0)) {
log_info(verbose, "Using fields API: ")
currentMatches <- res$matches$fields %>%
@@ -577,7 +556,6 @@
collectedMatches <- bind_rows(collectedMatches, currentMatches)
}
-
# Get the actual items per page from the API response
# We now consistently use maxResultsPerPage instead
@@ -1032,7 +1010,6 @@
#' foundry while adding morph from another).
#' @param verbose print progress information if true
#' @return The updated `kqo` object with annotation columns
-#' @return The updated `kqo` object with annotation columns
#' like `pos`, `lemma`, `morph` (and `atokens` and `annotation_snippet`)
#' in the `@collectedMatches` slot. Each column is a data frame
#' with `left`, `match`, and `right` columns containing list vectors of annotations