Merge "Revert "Use instance/test until negative fields bug in virtual corpora is fixed in main instance""
diff --git a/R/KorAPQuery.R b/R/KorAPQuery.R
index 8081f01..1ca8123 100644
--- a/R/KorAPQuery.R
+++ b/R/KorAPQuery.R
@@ -11,6 +11,7 @@
#' @export
KorAPQuery <- setClass("KorAPQuery", slots = c(
+ "korapConnection",
"request",
"vc",
"totalResults",
@@ -27,6 +28,7 @@
#'
#' @rdname KorAPQuery-class
#' @param .Object …
+#' @param korapConnection KorAPConnection object
#' @param request query part of the request URL
#' @param vc definition of a virtual corpus
#' @param totalResults number of hits the query has yielded
@@ -39,10 +41,11 @@
#' @param collectedMatches matches already fetched from the KorAP-API-server
#' @export
setMethod("initialize", "KorAPQuery",
- function(.Object, request = NULL, vc="", totalResults=0, nextStartIndex=0, fields=c("corpusSigle", "textSigle", "pubDate", "pubPlace",
+ function(.Object, korapConnection = NULL, request = NULL, vc="", totalResults=0, nextStartIndex=0, fields=c("corpusSigle", "textSigle", "pubDate", "pubPlace",
"availability", "textClass", "snippet"),
requestUrl="", webUIRequestUrl = "", apiResponse = NULL, hasMoreMatches= FALSE, collectedMatches = NULL) {
.Object <- callNextMethod()
+ .Object@korapConnection = korapConnection
.Object@request = request
.Object@vc = vc
.Object@totalResults = totalResults
@@ -153,6 +156,7 @@
cat(" took ", res$meta$benchmark, "\n", sep="")
}
KorAPQuery(
+ korapConnection = kco,
nextStartIndex = 0,
fields = fields[!fields %in% contentFields],
requestUrl = requestUrl,
@@ -217,6 +221,7 @@
}
nextStartIndex <- min(res$meta$startIndex + res$meta$itemsPerPage, res$meta$totalResults)
KorAPQuery(nextStartIndex = nextStartIndex,
+ korapConnection = kco,
fields = kqo@fields,
requestUrl = kqo@requestUrl,
request = kqo@request,
diff --git a/Readme.md b/Readme.md
index 1e8e9be..e6e2c16 100644
--- a/Readme.md
+++ b/Readme.md
@@ -17,6 +17,21 @@
?corpusQuery
```
+## Hello world
+
+```R
+library(RKorAPClient)
+fetchAll(corpusQuery(new("KorAPConnection"), "Hello world"))
+```
+## Installation
+
+At this point there is no binary package on CRAN yet, so you have to install the development version from our [Gerrit server](https://korap.ids-mannheim.de/gerrit/) using the devtool package:
+
+```R
+#install.packages("devtools")
+library(devtools)
+devtools::install_git("https://korap.ids-mannheim.de/gerrit/KorAP/RKorAPClient")
+```
## Development and License
**Authors**: [Marc Kupietz](http://www1.ids-mannheim.de/zfo/personal/kupietz/)
diff --git a/man/KorAPQuery-class.Rd b/man/KorAPQuery-class.Rd
index 68d8907..c1fc185 100644
--- a/man/KorAPQuery-class.Rd
+++ b/man/KorAPQuery-class.Rd
@@ -15,11 +15,11 @@
\alias{show,KorAPQuery-method}
\title{Class KorAPQuery}
\usage{
-\S4method{initialize}{KorAPQuery}(.Object, request = NULL, vc = "",
- totalResults = 0, nextStartIndex = 0, fields = c("corpusSigle",
- "textSigle", "pubDate", "pubPlace", "availability", "textClass",
- "snippet"), requestUrl = "", webUIRequestUrl = "",
- apiResponse = NULL, hasMoreMatches = FALSE,
+\S4method{initialize}{KorAPQuery}(.Object, korapConnection = NULL,
+ request = NULL, vc = "", totalResults = 0, nextStartIndex = 0,
+ fields = c("corpusSigle", "textSigle", "pubDate", "pubPlace",
+ "availability", "textClass", "snippet"), requestUrl = "",
+ webUIRequestUrl = "", apiResponse = NULL, hasMoreMatches = FALSE,
collectedMatches = NULL)
\S4method{fetchNext}{KorAPQuery}(kqo, offset = kqo@nextStartIndex,
@@ -36,6 +36,8 @@
\arguments{
\item{.Object}{…}
+\item{korapConnection}{KorAPConnection object}
+
\item{request}{query part of the request URL}
\item{vc}{definition of a virtual corpus}