Add some parameters' documentation and examples
Change-Id: Ib1eb1d9a98e8eae12f4c42fc4cea38c1c118a731
diff --git a/man/KorAPConnection.Rd b/man/KorAPConnection.Rd
index a3ba70f..1fb436f 100644
--- a/man/KorAPConnection.Rd
+++ b/man/KorAPConnection.Rd
@@ -9,6 +9,10 @@
}
\arguments{
\item{KorAPUrl}{instead of providing the query and vc string parameters, you can also simply copy a KorAP query URL from your browser and use it here (and in \code{KorAPConnection}) to provide all necessary information for the query.}
+
+\item{apiVersion}{which version of KorAP's API you want to connect to}
+
+\item{apiUrl}{url of the KorAP web service}
}
\value{
object that contains all connection information and can be used with \code{\link{KorAPQuery}}
diff --git a/man/KorAPFetchAll.Rd b/man/KorAPFetchAll.Rd
index 660d9fd..21b7036 100644
--- a/man/KorAPFetchAll.Rd
+++ b/man/KorAPFetchAll.Rd
@@ -8,6 +8,8 @@
}
\arguments{
\item{queryObject}{object obtained from \code{\link{KorAPQuery}}}
+
+\item{verbose}{print progress information if true}
}
\value{
The \code{queryObject} input parameter with updated fields \code{$collectedMatches}, \code{$matches} (latest bunch only), \code{$nextStartIndex}, \code{$hasMoreMatches}
diff --git a/man/KorAPFetchNext.Rd b/man/KorAPFetchNext.Rd
index 92f7754..66f8aa9 100644
--- a/man/KorAPFetchNext.Rd
+++ b/man/KorAPFetchNext.Rd
@@ -13,6 +13,8 @@
\item{offset}{start offset for query results to fetch}
\item{maxFetch}{maximum number of query results to fetch}
+
+\item{verbose}{print progress information if true}
}
\value{
The \code{queryObject} input parameter with updated fields \code{$collectedMatches}, \code{$matches} (latest bunch only), \code{$nextStartIndex}, , \code{$hasMoreMatches}
@@ -21,7 +23,7 @@
Fetch the next bunch of results of a KorAP query.
}
\examples{
-q <- KorapFetchNext(KorAPQuery(KorAPConnection(), "Ameisenplage"))
+q <- KorAPFetchNext(KorAPQuery(KorAPConnection(), "Ameisenplage"))
}
\references{
diff --git a/man/KorAPFetchRest.Rd b/man/KorAPFetchRest.Rd
index acefd2b..a9d4f03 100644
--- a/man/KorAPFetchRest.Rd
+++ b/man/KorAPFetchRest.Rd
@@ -8,6 +8,8 @@
}
\arguments{
\item{queryObject}{object obtained from \code{\link{KorAPQuery}}}
+
+\item{verbose}{print progress information if true}
}
\value{
The \code{queryObject} input parameter with updated fields \code{$collectedMatches}, \code{$matches} (latest bunch only), \code{$nextStartIndex}, \code{$hasMoreMatches}
@@ -16,7 +18,7 @@
Fetches all remaining results of a KorAP query.
}
\examples{
-q <- KorAPFetchRest(KorAPQueryNext(KorAPQuery(KorAPConnection(), "Ameisenplage")))
+q <- KorAPFetchRest(KorAPFetchNext(KorAPQuery(KorAPConnection(), "Ameisenplage")))
q$collectedMatches
}
diff --git a/man/KorAPQuery.Rd b/man/KorAPQuery.Rd
index cfe7e4f..1f50a83 100644
--- a/man/KorAPQuery.Rd
+++ b/man/KorAPQuery.Rd
@@ -5,7 +5,8 @@
\title{Send a query to a KorAP connection.}
\usage{
KorAPQuery(con, query, vc = "", KorAPUrl, metadataOnly = TRUE,
- ql = "poliqarp", fields = defaultFields, accessRewriteFatal = TRUE)
+ ql = "poliqarp", fields = defaultFields, accessRewriteFatal = TRUE,
+ verbose = FALSE)
}
\arguments{
\item{con}{object obtained from \code{\link{KorAPConnection}}, that contains all necessary connection information}
@@ -21,6 +22,10 @@
\item{ql}{string to choose the query language (see \href{https://github.com/KorAP/Kustvakt/wiki/Service:-Search-GET#user-content-parameters}{section on Query Parameters} in the Kustvakt-Wiki for possible values.}
\item{fields}{(meta)data fields that will be fetched for every match}
+
+\item{accessRewriteFatal}{abort if query or given vc had to be rewritten due to insufficent rights (not yet implemented)}
+
+\item{verbose}{print some info}
}
\value{
A KorAP query object that, among other information, contains the total number of results in \code{$meta$totalResults}. The resulting object can be used to fetch all query results (with \code{\link{KorAPFetchAll}}) or the next page of results (with \code{\link{KorAPFetchNext}}).
@@ -40,6 +45,14 @@
KorAPUrl = "https://korap.ids-mannheim.de/?q=Ameise&cq=pubDate+since+2017&ql=poliqarp")
q$meta$totalResults
+q <- KorAPQuery(con, "Ameisenplage")
+q <- KorAPFetchAll(q, verbose=TRUE)
+tokensPerYear <- function(year) { return(KorAPCorpusStats(con, paste("pubDate in", year))$tokens) }
+df <- as.data.frame(table(as.numeric(format(q$collectedMatches$pubDate,"\%Y")), dnn="year"),
+ stringsAsFactors = FALSE)
+df$ipm <- 1000000 * df$Freq / tokensPerYear(df$year)
+plot(df$year, df$ipm, type="l")
+
}
\references{
\url{https://ids-pub.bsz-bw.de/frontdoor/index/index/docId/9026}