forked from PolMine/RcppCWB
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
286 lines (258 loc) · 28.4 KB
/
index.html
File metadata and controls
286 lines (258 loc) · 28.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
<!DOCTYPE html>
<!-- Generated by pkgdown: do not edit by hand --><html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Rcpp Bindings for the Corpus Workbench (CWB) • RcppCWB</title>
<!-- jquery --><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script><!-- Bootstrap --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha256-bZLfwXAP04zRMK2BjiO8iu9pf4FbLqX6zitd+tIvLhE=" crossorigin="anonymous">
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=" crossorigin="anonymous"></script><!-- bootstrap-toc --><link rel="stylesheet" href="bootstrap-toc.css">
<script src="bootstrap-toc.js"></script><!-- Font Awesome icons --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity="sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin="anonymous">
<!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script><!-- headroom.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity="sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script><!-- pkgdown --><link href="pkgdown.css" rel="stylesheet">
<script src="pkgdown.js"></script><meta property="og:title" content="Rcpp Bindings for the Corpus Workbench (CWB)">
<meta property="og:description" content="Rcpp Bindings for the C code of the Corpus Workbench (CWB), an indexing and query
engine to efficiently analyze large corpora (<https://cwb.sourceforge.io>). RcppCWB is licensed
under the GNU GPL-3, in line with the GPL-3 license of the CWB (<https://www.r-project.org/Licenses/GPL-3>).
The CWB relies on pcre2 (BSD license, see <http://www.pcre.org/licence.txt>)
and GLib (LGPL license, see <https://www.gnu.org/licenses/lgpl-3.0.en.html>).
See the file LICENSE.note for further information. The package includes modified code of the
rcqp package (GPL-2, see <https://cran.r-project.org/package=rcqp>). The original work of the authors
of the rcqp package is acknowledged with great respect, and they are listed as authors of this
package. To achieve cross-platform portability (including Windows), using Rcpp for wrapper code
is the approach used by RcppCWB.">
<!-- mathjax --><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script><!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body data-spy="scroll" data-target="#toc">
<div class="container template-home">
<header><div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span class="navbar-brand">
<a class="navbar-link" href="index.html">RcppCWB</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="">0.6.0</span>
</span>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>
<a href="reference/index.html">Reference</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
Articles
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="articles/vignette.html">Writing performance code with RcppCWB</a>
</li>
</ul>
</li>
<li>
<a href="news/index.html">Changelog</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="https://github.com/PolMine/RcppCWB/" class="external-link">
<span class="fab fa-github fa-lg"></span>
</a>
</li>
</ul>
</div>
<!--/.nav-collapse -->
</div>
<!--/.container -->
</div>
<!--/.navbar -->
</header><div class="row">
<div class="contents col-md-9">
<div class="section level1">
<div class="page-header"><h1 id="rcpp-bindings-for-the-corpus-workbench-cwb">Rcpp bindings for the Corpus Workbench (CWB)<a class="anchor" aria-label="anchor" href="#rcpp-bindings-for-the-corpus-workbench-cwb"></a>
</h1></div>
<p>The package exposes functions of the Corpus Worbench (CWB) by way of Rcpp wrappers. Furthermore, the packages includes Rcpp code for performance critical operations. The main purpose of the package is to serve as an interface to the CWB for the package <a href="https://CRAN.R-project.org/package=RcppCWB" class="external-link">polmineR</a>.</p>
<p>There is a huge intellectual debt to the developers of the R-package ‘rcqp’, Bernard Desgraupes and Sylvain Loiseau. The main impetus for developing RcppCWB is that using Rcpp decreases the pains to maintain the package, to expand the CWB functionality exposed, and – most importantly – to make it portable to Windows systems.</p>
<div class="section level3">
<h3 id="installation-on-windows">Installation on Windows<a class="anchor" aria-label="anchor" href="#installation-on-windows"></a>
</h3>
<p>Pre-compiled ‘RcppCWB’ binaries can be installed from CRAN.</p>
<div class="sourceCode" id="cb1"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="fu"><a href="https://rdrr.io/r/utils/install.packages.html" class="external-link">install.packages</a></span><span class="op">(</span><span class="st">"RcppCWB"</span><span class="op">)</span></span></code></pre></div>
<p>If you want to get the development version, you need to compile RcppCWB yourself. Having <a href="https://cran.r-project.org/bin/windows/Rtools/" class="external-link">Rtools</a> installed on your system is necessary. Using the mechanism offered by the devtools package, you can install RcppCWB from GitHub.</p>
<div class="sourceCode" id="cb2"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="kw">if</span> <span class="op">(</span><span class="op">!</span><span class="st">"devtools"</span> <span class="op"><a href="https://rdrr.io/r/base/match.html" class="external-link">%in%</a></span> <span class="fu"><a href="https://rdrr.io/r/utils/installed.packages.html" class="external-link">installed.packages</a></span><span class="op">(</span><span class="op">)</span><span class="op">[</span>,<span class="st">"Package"</span><span class="op">]</span><span class="op">)</span> <span class="fu"><a href="https://rdrr.io/r/utils/install.packages.html" class="external-link">install.packages</a></span><span class="op">(</span><span class="st">"devtools"</span><span class="op">)</span></span>
<span><span class="fu">devtools</span><span class="fu">::</span><span class="fu"><a href="https://remotes.r-lib.org/reference/install_github.html" class="external-link">install_github</a></span><span class="op">(</span><span class="st">"PolMine/RcppCWB"</span><span class="op">)</span></span></code></pre></div>
<p>During the installation, cross-compiled versions of the corpus library (CL) are downloaded from the GitHub repository <a href="https://github.com/PolMine/libcl" class="external-link">PolMine/libcl</a>. The libcl repository also includes a reproducible workflow using Docker to build static libraries from the CWB source code.</p>
</div>
<div class="section level2">
<h2 id="installation-on-ubuntu">Installation on Ubuntu<a class="anchor" aria-label="anchor" href="#installation-on-ubuntu"></a>
</h2>
<p>The package includes the source code of the Corpus Workbench (CWB), slightly modified to make it compatible with R requirements. Compiling the CWB requires the pcre2 and glib libraries to be present. Using the Aptitude package manager (Ubuntu/Debian), running the following command from the shell will fulfill these dependencies.</p>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="fu">sudo</span> apt-get install libpcre2-dev libglib2.0-dev</span></code></pre></div>
<p>Then, use the conventional R installation mechanism to install R dependencies, and the release of RcppCWB at CRAN.</p>
<div class="sourceCode" id="cb4"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="fu"><a href="https://rdrr.io/r/utils/install.packages.html" class="external-link">install.packages</a></span><span class="op">(</span>pkgs <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"Rcpp"</span>, <span class="st">"knitr"</span>, <span class="st">"testthat"</span><span class="op">)</span><span class="op">)</span></span>
<span><span class="fu"><a href="https://rdrr.io/r/utils/install.packages.html" class="external-link">install.packages</a></span><span class="op">(</span><span class="st">"RcppCWB"</span><span class="op">)</span></span></code></pre></div>
<p>To install the development version, using the mechanism offered by the devtools package is recommended.</p>
<div class="sourceCode" id="cb5"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="kw">if</span> <span class="op">(</span><span class="op">!</span><span class="st">"devtools"</span> <span class="op"><a href="https://rdrr.io/r/base/match.html" class="external-link">%in%</a></span> <span class="fu"><a href="https://rdrr.io/r/utils/installed.packages.html" class="external-link">installed.packages</a></span><span class="op">(</span><span class="op">)</span><span class="op">[</span>,<span class="st">"Package"</span><span class="op">]</span><span class="op">)</span> <span class="fu"><a href="https://rdrr.io/r/utils/install.packages.html" class="external-link">install.packages</a></span><span class="op">(</span><span class="st">"devtools"</span><span class="op">)</span></span>
<span><span class="fu">devtools</span><span class="fu">::</span><span class="fu"><a href="https://remotes.r-lib.org/reference/install_github.html" class="external-link">install_github</a></span><span class="op">(</span><span class="st">"PolMine/RcppCWB"</span>, ref <span class="op">=</span> <span class="st">"dev"</span><span class="op">)</span></span></code></pre></div>
</div>
<div class="section level2">
<h2 id="installation-on-macos">Installation on macOS<a class="anchor" aria-label="anchor" href="#installation-on-macos"></a>
</h2>
<p>On macOS, the <a href="http://www.pcre.org/" class="external-link">pcre2</a> and <a href="https://docs.gtk.org/glib" class="external-link">Glib</a> libraries need to be present. We recommend to use ‘Homebrew’ as a package manager for macOS. To install Homebrew, follow the instructions on the <a href="https://brew.sh/index_de.html" class="external-link">Homebrew Website</a>. It may also be necessary to also install <a href="https://developer.apple.com/xcode/" class="external-link">Xcode</a> and <a href="https://www.xquartz.org" class="external-link">XQuartz</a>.</p>
<p>The following commands then need to be executed from a terminal window. They will install the C libraries the CWB relies on:</p>
<div class="sourceCode" id="cb6"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a><span class="ex">brew</span> <span class="at">-v</span> install pkg-config</span>
<span id="cb6-2"><a href="#cb6-2" aria-hidden="true" tabindex="-1"></a><span class="ex">brew</span> <span class="at">-v</span> install glib <span class="at">--universal</span></span>
<span id="cb6-3"><a href="#cb6-3" aria-hidden="true" tabindex="-1"></a><span class="ex">brew</span> <span class="at">-v</span> install pcre2 <span class="at">--universal</span></span>
<span id="cb6-4"><a href="#cb6-4" aria-hidden="true" tabindex="-1"></a><span class="ex">brew</span> <span class="at">-v</span> install readline</span></code></pre></div>
<p>Then open R and use the conventional R installation mechanism to install dependencies, and the release of RcppCWB at CRAN.</p>
<div class="sourceCode" id="cb7"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="fu"><a href="https://rdrr.io/r/utils/install.packages.html" class="external-link">install.packages</a></span><span class="op">(</span>pkgs <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"Rcpp"</span>, <span class="st">"knitr"</span>, <span class="st">"testthat"</span><span class="op">)</span><span class="op">)</span></span>
<span><span class="fu"><a href="https://rdrr.io/r/utils/install.packages.html" class="external-link">install.packages</a></span><span class="op">(</span><span class="st">"RcppCWB"</span><span class="op">)</span></span></code></pre></div>
<p>To install the development version, using the mechanism offered by the devtools package is recommended.</p>
<div class="sourceCode" id="cb8"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="kw">if</span> <span class="op">(</span><span class="op">!</span><span class="st">"devtools"</span> <span class="op"><a href="https://rdrr.io/r/base/match.html" class="external-link">%in%</a></span> <span class="fu"><a href="https://rdrr.io/r/utils/installed.packages.html" class="external-link">installed.packages</a></span><span class="op">(</span><span class="op">)</span><span class="op">[</span>,<span class="st">"Package"</span><span class="op">]</span><span class="op">)</span> <span class="fu"><a href="https://rdrr.io/r/utils/install.packages.html" class="external-link">install.packages</a></span><span class="op">(</span><span class="st">"devtools"</span><span class="op">)</span></span>
<span><span class="fu">devtools</span><span class="fu">::</span><span class="fu"><a href="https://remotes.r-lib.org/reference/install_github.html" class="external-link">install_github</a></span><span class="op">(</span><span class="st">"PolMine/RcppCWB"</span><span class="op">)</span></span></code></pre></div>
</div>
<div class="section level2">
<h2 id="usage">Usage<a class="anchor" aria-label="anchor" href="#usage"></a>
</h2>
<p>The package offers low-level access to CWB-indexed corpora. Using RcppCWB may not intuitive at the outset: It is designed to serve as a an efficient backend for packages offering higher-level functionality, such as polmineR. the</p>
<p>RcppCWB includes a small sample corpus called (‘REUTERS’). After loading the package, we need to determine whether we can use the registry describing the corpus within the package, or whether we need to work with a temporary registry.</p>
<div class="sourceCode" id="cb9"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">library</a></span><span class="op">(</span><span class="va"><a href="https://github.com/PolMine/RcppCWB" class="external-link">RcppCWB</a></span><span class="op">)</span></span>
<span><span class="va">registry</span> <span class="op"><-</span> <span class="fu"><a href="reference/tmp_registry.html">use_tmp_registry</a></span><span class="op">(</span><span class="op">)</span></span></code></pre></div>
<p>To start with, we get the number of tokens of the corpus.</p>
<div class="sourceCode" id="cb10"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="va">cpos_total</span> <span class="op"><-</span> <span class="fu"><a href="reference/cl_attribute_size.html">cl_attribute_size</a></span><span class="op">(</span></span>
<span> corpus <span class="op">=</span> <span class="st">"REUTERS"</span>, attribute <span class="op">=</span> <span class="st">"word"</span>,</span>
<span> attribute_type <span class="op">=</span> <span class="st">"p"</span>, registry <span class="op">=</span> <span class="va">registry</span></span>
<span><span class="op">)</span></span>
<span><span class="va">cpos_total</span></span></code></pre></div>
<div class="sourceCode" id="cb11"><pre class="sourceCode R"><code class="sourceCode r"><span id="cb11-1"><a href="#cb11-1" aria-hidden="true" tabindex="-1"></a><span class="do">## [1] 4050</span></span></code></pre></div>
<p>To decode the token stream of the corpus.</p>
<div class="sourceCode" id="cb12"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="va">token_stream_str</span> <span class="op"><-</span> <span class="fu"><a href="reference/p_attributes.html">cl_cpos2str</a></span><span class="op">(</span></span>
<span> corpus <span class="op">=</span> <span class="st">"REUTERS"</span>, p_attribute <span class="op">=</span> <span class="st">"word"</span>,</span>
<span> cpos <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/seq.html" class="external-link">seq.int</a></span><span class="op">(</span>from <span class="op">=</span> <span class="fl">0</span>, to <span class="op">=</span> <span class="va">cpos_total</span> <span class="op">-</span> <span class="fl">1</span><span class="op">)</span>,</span>
<span> registry <span class="op">=</span> <span class="va">registry</span></span>
<span> <span class="op">)</span></span></code></pre></div>
<p>To get the corpus positions of a token.</p>
<div class="sourceCode" id="cb13"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="va">token_to_get</span> <span class="op"><-</span> <span class="st">"oil"</span></span>
<span><span class="va">id_oil</span> <span class="op"><-</span> <span class="fu"><a href="reference/p_attributes.html">cl_str2id</a></span><span class="op">(</span>corpus <span class="op">=</span> <span class="st">"REUTERS"</span>, p_attribute <span class="op">=</span> <span class="st">"word"</span>, str <span class="op">=</span> <span class="va">token_to_get</span>, registry <span class="op">=</span> <span class="va">registry</span><span class="op">)</span></span>
<span><span class="va">cpos_oil</span> <span class="op"><-</span> <span class="va">cl_id2cpos</span> <span class="op"><-</span> <span class="fu"><a href="reference/p_attributes.html">cl_id2cpos</a></span><span class="op">(</span>corpus <span class="op">=</span> <span class="st">"REUTERS"</span>, p_attribute <span class="op">=</span> <span class="st">"word"</span>, id <span class="op">=</span> <span class="va">id_oil</span>, registry <span class="op">=</span> <span class="va">registry</span><span class="op">)</span></span></code></pre></div>
<p>Get the frequency of token.</p>
<div class="sourceCode" id="cb14"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="va">oil_freq</span> <span class="op"><-</span> <span class="fu"><a href="reference/p_attributes.html">cl_id2freq</a></span><span class="op">(</span>corpus <span class="op">=</span> <span class="st">"REUTERS"</span>, p_attribute <span class="op">=</span> <span class="st">"word"</span>, id <span class="op">=</span> <span class="va">id_oil</span>, registry <span class="op">=</span> <span class="va">registry</span><span class="op">)</span></span></code></pre></div>
<p>Using regular expressions.</p>
<div class="sourceCode" id="cb15"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="va">ids</span> <span class="op"><-</span> <span class="fu"><a href="reference/p_attributes.html">cl_regex2id</a></span><span class="op">(</span>corpus <span class="op">=</span> <span class="st">"REUTERS"</span>, p_attribute <span class="op">=</span> <span class="st">"word"</span>, regex <span class="op">=</span> <span class="st">"M.*"</span>, registry <span class="op">=</span> <span class="va">registry</span><span class="op">)</span></span>
<span><span class="va">m_words</span> <span class="op"><-</span> <span class="fu"><a href="reference/p_attributes.html">cl_id2str</a></span><span class="op">(</span>corpus <span class="op">=</span> <span class="st">"REUTERS"</span>, p_attribute <span class="op">=</span> <span class="st">"word"</span>, id <span class="op">=</span> <span class="va">ids</span>, registry <span class="op">=</span> <span class="va">registry</span><span class="op">)</span></span></code></pre></div>
<p>To use the CQP syntax, we need to initialize CQP first.</p>
<div class="sourceCode" id="cb16"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="fu"><a href="reference/cqp_initialize.html">cqp_initialize</a></span><span class="op">(</span>registry <span class="op">=</span> <span class="va">registry</span><span class="op">)</span></span></code></pre></div>
<div class="sourceCode" id="cb17"><pre class="sourceCode R"><code class="sourceCode r"><span id="cb17-1"><a href="#cb17-1" aria-hidden="true" tabindex="-1"></a><span class="do">## Warning in cqp_initialize(registry = registry): CQP has already been</span></span>
<span id="cb17-2"><a href="#cb17-2" aria-hidden="true" tabindex="-1"></a><span class="do">## initialized. Re-initialization is not possible. Only resetting registry.</span></span>
<span id="cb17-3"><a href="#cb17-3" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb17-4"><a href="#cb17-4" aria-hidden="true" tabindex="-1"></a><span class="do">## [1] TRUE</span></span></code></pre></div>
<div class="sourceCode" id="cb18"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="fu"><a href="reference/cqp_query.html">cqp_query</a></span><span class="op">(</span>corpus <span class="op">=</span> <span class="st">"REUTERS"</span>, query <span class="op">=</span> <span class="st">'"crude" "oil"'</span><span class="op">)</span></span></code></pre></div>
<div class="sourceCode" id="cb19"><pre class="sourceCode R"><code class="sourceCode r"><span id="cb19-1"><a href="#cb19-1" aria-hidden="true" tabindex="-1"></a><span class="do">## <pointer: 0x143f39de0></span></span></code></pre></div>
<div class="sourceCode" id="cb20"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="va">cpos</span> <span class="op"><-</span> <span class="fu"><a href="reference/cqp_query.html">cqp_dump_subcorpus</a></span><span class="op">(</span>corpus <span class="op">=</span> <span class="st">"REUTERS"</span><span class="op">)</span></span>
<span><span class="va">cpos</span></span></code></pre></div>
<div class="sourceCode" id="cb21"><pre class="sourceCode R"><code class="sourceCode r"><span id="cb21-1"><a href="#cb21-1" aria-hidden="true" tabindex="-1"></a><span class="do">## [,1] [,2]</span></span>
<span id="cb21-2"><a href="#cb21-2" aria-hidden="true" tabindex="-1"></a><span class="do">## [1,] 14 15</span></span>
<span id="cb21-3"><a href="#cb21-3" aria-hidden="true" tabindex="-1"></a><span class="do">## [2,] 56 57</span></span>
<span id="cb21-4"><a href="#cb21-4" aria-hidden="true" tabindex="-1"></a><span class="do">## [3,] 548 549</span></span>
<span id="cb21-5"><a href="#cb21-5" aria-hidden="true" tabindex="-1"></a><span class="do">## [4,] 584 585</span></span>
<span id="cb21-6"><a href="#cb21-6" aria-hidden="true" tabindex="-1"></a><span class="do">## [5,] 607 608</span></span>
<span id="cb21-7"><a href="#cb21-7" aria-hidden="true" tabindex="-1"></a><span class="do">## [6,] 2497 2498</span></span>
<span id="cb21-8"><a href="#cb21-8" aria-hidden="true" tabindex="-1"></a><span class="do">## [7,] 2842 2843</span></span>
<span id="cb21-9"><a href="#cb21-9" aria-hidden="true" tabindex="-1"></a><span class="do">## [8,] 2891 2892</span></span>
<span id="cb21-10"><a href="#cb21-10" aria-hidden="true" tabindex="-1"></a><span class="do">## [9,] 2928 2929</span></span>
<span id="cb21-11"><a href="#cb21-11" aria-hidden="true" tabindex="-1"></a><span class="do">## [10,] 3644 3645</span></span>
<span id="cb21-12"><a href="#cb21-12" aria-hidden="true" tabindex="-1"></a><span class="do">## [11,] 3709 3710</span></span>
<span id="cb21-13"><a href="#cb21-13" aria-hidden="true" tabindex="-1"></a><span class="do">## [12,] 3998 3999</span></span></code></pre></div>
</div>
<div class="section level2">
<h2 id="license">License<a class="anchor" aria-label="anchor" href="#license"></a>
</h2>
<p>The packge is licensed under the <a href="https://www.gnu.org/licenses/gpl-3.0.de.html" class="external-link">GNU General Public License 3</a>. For the copyrights for the ‘Corpus Workbench’ (CWB) and acknowledgement of authorship, see the file COPYRIGHTS.</p>
</div>
<div class="section level2">
<h2 id="acknowledgements">Acknowledgements<a class="anchor" aria-label="anchor" href="#acknowledgements"></a>
</h2>
<p>There is a huge intellectual debt to the developers of the R-package ‘rcqp’, Bernard Desgraupes and Sylvain Loiseau. Developing RcppCWB would have been unthinkable without their original work to wrap the CWB into an R package.</p>
<p>The CWB is a classic and mature tool: The work of the CWB developers, Oliver Christ, Bruno Maximilian Schulze, Arne Fitschen and Stefan Evert is gratefully acknowledged.</p>
</div>
</div>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar">
<div class="links">
<h2 data-toc-skip>Links</h2>
<ul class="list-unstyled">
<li><a href="https://cloud.r-project.org/package=RcppCWB" class="external-link">View on CRAN</a></li>
<li><a href="https://github.com/PolMine/RcppCWB/" class="external-link">Browse source code</a></li>
<li><a href="https://github.com/PolMine/RcppCWB/issues" class="external-link">Report a bug</a></li>
</ul>
</div>
<div class="license">
<h2 data-toc-skip>License</h2>
<ul class="list-unstyled">
<li><a href="https://www.r-project.org/Licenses/GPL-3" class="external-link">GPL-3</a></li>
</ul>
</div>
<div class="citation">
<h2 data-toc-skip>Citation</h2>
<ul class="list-unstyled">
<li><a href="authors.html#citation">Citing RcppCWB</a></li>
</ul>
</div>
<div class="developers">
<h2 data-toc-skip>Developers</h2>
<ul class="list-unstyled">
<li>Andreas Blaette <br><small class="roles"> Author, maintainer </small> </li>
<li>Bernard Desgraupes <br><small class="roles"> Author </small> </li>
<li>Sylvain Loiseau <br><small class="roles"> Author </small> </li>
<li><a href="authors.html">More about authors...</a></li>
</ul>
</div>
<div class="dev-status">
<h2 data-toc-skip>Dev status</h2>
<ul class="list-unstyled">
<li><a href="https://doi.org/10.5281/zenodo.7040475" class="external-link"><img src="https://zenodo.org/badge/DOI/10.5281/zenodo.7040475.svg" alt="DOI"></a></li>
<li><a href="https://www.gnu.org/licenses/gpl-3.0" class="external-link"><img src="http://img.shields.io/badge/License-GPLv3-blue.svg" alt="License: GPL v3"></a></li>
<li><a href="https://cran.r-project.org/package=RcppCWB" class="external-link"><img src="http://www.r-pkg.org/badges/version/RcppCWB" alt="CRAN_Status_Badge"></a></li>
<li><a href="https://github.com/PolMine/RcppCWB/actions" class="external-link"><img src="https://github.com/PolMine/RcppCWB/workflows/R-CMD-check/badge.svg" alt="R build status"></a></li>
<li><a href="https://app.codecov.io/gh/PolMine/RcppCWB" class="external-link"><img src="https://codecov.io/gh/PolMine/RcppCWB/branch/master/graph/badge.svg" alt="codecov"></a></li>
</ul>
</div>
</div>
</div>
<footer><div class="copyright">
<p></p>
<p>Developed by Andreas Blaette, Bernard Desgraupes, Sylvain Loiseau.</p>
</div>
<div class="pkgdown">
<p></p>
<p>Site built with <a href="https://pkgdown.r-lib.org/" class="external-link">pkgdown</a> 2.0.6.</p>
</div>
</footer>
</div>
</body>
</html>