Stub import
Change-Id: I2f9ac417325c91b2c0318b3a94b9010a70c400aa
diff --git a/.Rbuildignore b/.Rbuildignore
new file mode 100644
index 0000000..91114bf
--- /dev/null
+++ b/.Rbuildignore
@@ -0,0 +1,2 @@
+^.*\.Rproj$
+^\.Rproj\.user$
diff --git a/DESCRIPTION b/DESCRIPTION
new file mode 100644
index 0000000..8c28566
--- /dev/null
+++ b/DESCRIPTION
@@ -0,0 +1,11 @@
+Package: rderekovecs
+Type: Package
+Title: What the Package Does (Title Case)
+Version: 0.1.0
+Author: Who wrote it
+Maintainer: The package maintainer <yourself@somewhere.net>
+Description: More about what it does (maybe more than one line)
+ Use four spaces when indenting paragraphs within the Description.
+License: What license is it under?
+Encoding: UTF-8
+LazyData: true
diff --git a/NAMESPACE b/NAMESPACE
new file mode 100644
index 0000000..d75f824
--- /dev/null
+++ b/NAMESPACE
@@ -0,0 +1 @@
+exportPattern("^[[:alpha:]]+")
diff --git a/R/derekovecs.R b/R/derekovecs.R
new file mode 100644
index 0000000..24b6d89
--- /dev/null
+++ b/R/derekovecs.R
@@ -0,0 +1,32 @@
+library(httr2)
+library(tidyverse)
+
+derekovecs_server = 'https://corpora.ids-mannheim.de/openlab/derekovecs/'
+
+DeReKoVecsCall <- function(method="", ...) {
+ request(derekovecs_server) %>%
+ req_url_path_append(method) %>%
+ req_url_query(...) %>%
+ req_perform() %>%
+ resp_body_json(simplifyVector = TRUE)
+}
+
+syntagmaticNeighbours <- function(word = "Test", ...) {
+ DeReKoVecsCall("", word=word, json=1, ...)$collocators
+}
+
+countbasedCollocates <- function(w = "Test", ...) {
+ DeReKoVecsCall(method = "/getClassicCollocators", w = w, ...)$collocates
+}
+
+paradigmaticNeighbours <- function(word = "Test", ...) {
+ DeReKoVecsCall("", word=word, json=1, ...)$list[[1]]
+}
+
+collocationScores <- function(w, c, ...) {
+ DeReKoVecsCall("/getCollocationAssociation", w=w, c=c, ...)$collocates
+}
+
+cosineSimilarity <- function(w1, w2, ...) {
+ DeReKoVecsCall("/getSimilarity", w1=w1, w2=w2, ...)
+}
diff --git a/rderekovecs.Rproj b/rderekovecs.Rproj
new file mode 100644
index 0000000..497f8bf
--- /dev/null
+++ b/rderekovecs.Rproj
@@ -0,0 +1,20 @@
+Version: 1.0
+
+RestoreWorkspace: Default
+SaveWorkspace: Default
+AlwaysSaveHistory: Default
+
+EnableCodeIndexing: Yes
+UseSpacesForTab: Yes
+NumSpacesForTab: 2
+Encoding: UTF-8
+
+RnwWeave: Sweave
+LaTeX: pdfLaTeX
+
+AutoAppendNewline: Yes
+StripTrailingWhitespace: Yes
+
+BuildType: Package
+PackageUseDevtools: Yes
+PackageInstallArgs: --no-multiarch --with-keep.source