|
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
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
|
List results on multiple spans can be produced within the same request. To distinguish them, a unique identifier has to be provided for each of the required lists.
| Parameter | Value | Info | Obligatory |
|-------------------------------------------------|--------------|--------------------------------|-------------|
| mtas.list.\<identifier\>.key | \<string\> | key used in response | no |
| mtas.list.\<identifier\>.field | \<string\> | Mtas field | yes |
| mtas.list.\<identifier\>.query.type | \<string\> | query language: [cql](search_cql.html) | yes |
| mtas.list.\<identifier\>.query.value | \<string\> | query: [cql](search_cql.html) | yes |
| mtas.list.\<identifier\>.query.prefix | \<string\> | default prefix | no |
| mtas.list.\<identifier\>.query.ignore | \<string\> | ignore query: [cql](search_cql.html) | no |
| mtas.list.\<identifier\>.query.maximumIgnoreLength | \<integer\> | maximum number of succeeding occurrences to ignore | no |
| mtas.list.\<identifier\>.prefix | \<string\> | comma separated list of prefixes | no |
| mtas.list.\<identifier\>.number | \<double\> | maximum number of items in list | no |
| mtas.list.\<identifier\>.start | \<double\> | offset for selection of items in list | no |
| mtas.list.\<identifier\>.left | \<double\> | number of positions left of hit | no |
| mtas.list.\<identifier\>.right | \<double\> | number of positions right of hit | no |
| mtas.list.\<identifier\>.output | \<string\> | "token" or "hit" | no |
## Variables
The query may contain one or more variables, and the value(s) of these variables have to be defined
| Parameter | Value | Info | Obligatory |
|-------------------------------------------------|--------------|--------------------------------|-------------|
| mtas.list.\<identifier\>.query.variable\<identifier variable\>.name | \<string\> | name of variable | yes |
| mtas.list.\<identifier\>.query.variable\<identifier variable\>.value | \<string\> | comma separated list of values | yes |
---
## Examples
1. [Token](#token) : List of tokens with prefix *t*, *pos* and *s* for adjectives followed by a noun
2. [Hit](#hit) : List of hits with prefix *t*, *pos* and *s* for articles followed by an adjective and a noun
3. [Left and Right](#left-and-right) : List of tokens with prefix *t* and *s* for sentences starting with an article, expanded to the left and the right
---
<a name="token"></a>
### Token
**Example**
List with output type *token* and prefixes *t*, *pos* and *s* for adjectives followed by a noun
**CQL**
`[pos="ADJ"][pos="N"]`
**Request and response**
`fq=%7B%21mtas_cql+field%3D%22text%22+query%3D%22%5Bpos%3D%5C%22ADJ%5C%22%5D%5Bpos%3D%5C%22N%5C%22%5D%22+++%7D&q=%2A%3A%2A&mtas=true&mtas.list=true&mtas.list.0.field=text&mtas.list.0.query.type=cql&mtas.list.0.query.value=%5Bpos%3D%22ADJ%22%5D%5Bpos%3D%22N%22%5D&mtas.list.0.key=adjective%2Bnoun&mtas.list.0.prefix=t%2Cpos%2Cs&mtas.list.0.output=token&mtas.list.0.number=2&mtas.list.0.start=0&mtas.list.0.left=0&mtas.list.0.right=0&fl=%2A&rows=0&wt=json&indent=true`
```json
"mtas":{
"list":[{
"key":"adjective+noun",
"number":2,
"list":[{
"documentKey":"44e5620c-011c-11e4-b0ff-51bcbd7c379f",
"documentHitPosition":0,
"documentHitTotal":239,
"documentMinPosition":0,
"documentMaxPosition":6385,
"startPosition":29,
"endPosition":30,
"tokens":[{
"mtasId":191,
"prefix":"t",
"value":"beknopte",
"positionStart":29,
"positionEnd":29,
"parentMtasId":337},
{
"mtasId":197,
"prefix":"pos",
"value":"ADJ",
"positionStart":29,
"positionEnd":29},
{
"mtasId":199,
"prefix":"t",
"value":"levensschets",
"positionStart":30,
"positionEnd":30,
"parentMtasId":337},
{
"mtasId":204,
"prefix":"pos",
"value":"N",
"positionStart":30,
"positionEnd":30},
{
"mtasId":337,
"prefix":"s",
"value":"",
"positionStart":7,
"positionEnd":49,
"parentMtasId":1152}]},
{
"documentKey":"44e5620c-011c-11e4-b0ff-51bcbd7c379f",
"documentHitPosition":1,
"documentHitTotal":239,
"documentMinPosition":0,
"documentMaxPosition":6385,
"startPosition":56,
"endPosition":57,
"tokens":[{
"mtasId":380,
"prefix":"t",
"value":"gebied",
"positionStart":57,
"positionEnd":57,
"parentMtasId":610},
{
"mtasId":387,
"prefix":"pos",
"value":"N",
"positionStart":57,
"positionEnd":57},
{
"mtasId":373,
"prefix":"t",
"value":"velerlei",
"positionStart":56,
"positionEnd":56,
"parentMtasId":610},
{
"mtasId":378,
"prefix":"pos",
"value":"ADJ",
"positionStart":56,
"positionEnd":56},
{
"mtasId":610,
"prefix":"s",
"value":"",
"positionStart":50,
"positionEnd":90,
"parentMtasId":1152}]}]}]}
```
<a name="hit"></a>
### Hit
**Example**
List with output type *hit* and prefixes *t*, *pos* and *s* for articles followed by an adjective and a noun
**CQL**
`[pos="LID"][pos="ADJ"][pos="N"]`
**Request and response**
`fq=%7B%21mtas_cql+field%3D%22text%22+query%3D%22%5Bpos%3D%5C%22LID%5C%22%5D%5Bpos%3D%5C%22ADJ%5C%22%5D%5Bpos%3D%5C%22N%5C%22%5D%22+++%7D&q=%2A%3A%2A&mtas=true&mtas.list=true&mtas.list.0.field=text&mtas.list.0.query.type=cql&mtas.list.0.query.value=%5Bpos%3D%22LID%22%5D%5Bpos%3D%22ADJ%22%5D%5Bpos%3D%22N%22%5D&mtas.list.0.key=article%2Badjective%2Bnoun&mtas.list.0.prefix=t%2Cpos%2Cs&mtas.list.0.output=hit&mtas.list.0.number=2&mtas.list.0.start=0&mtas.list.0.left=0&mtas.list.0.right=0&fl=%2A&rows=0&wt=json&indent=true`
```json
"mtas":{
"list":[{
"key":"article+adjective+noun",
"number":2,
"list":[{
"documentKey":"44e5620c-011c-11e4-b0ff-51bcbd7c379f",
"documentHitPosition":0,
"documentHitTotal":80,
"documentMinPosition":0,
"documentMaxPosition":6385,
"startPosition":210,
"endPosition":212,
"hit":{
"210":[["t",
"het"],
["pos",
"LID"],
["s",
null]],
"211":[["t",
"Middelbaar"],
["pos",
"ADJ"],
["s",
null]],
"212":[["t",
"Onderwijs"],
["pos",
"N"],
["s",
null]]}},
{
"documentKey":"44e5620c-011c-11e4-b0ff-51bcbd7c379f",
"documentHitPosition":1,
"documentHitTotal":80,
"documentMinPosition":0,
"documentMaxPosition":6385,
"startPosition":237,
"endPosition":239,
"hit":{
"237":[["t",
"het"],
["pos",
"LID"],
["s",
null]],
"238":[["t",
"Middelbaar"],
["pos",
"ADJ"],
["s",
null]],
"239":[["t",
"Onderwijs"],
["pos",
"N"],
["s",
null]]}}]}]}
```
---
<a name="left-and-right"></a>
### Left and Right
**Example**
List with output type *token* and prefixes *t* and *s* for sentences starting with an article, expanded two positions to the left and one position to the right
**CQL**
`<s>[pos="LID"]`
**Request and response**
`fq=%7B%21mtas_cql+field%3D%22text%22+query%3D%22%3Cs%3E%5Bpos%3D%5C%22LID%5C%22%5D%22+++%7D&q=%2A%3A%2A&mtas=true&mtas.list=true&mtas.list.0.field=text&mtas.list.0.query.type=cql&mtas.list.0.query.value=%3Cs%3E%5Bpos%3D%22LID%22%5D&mtas.list.0.key=sentence+starting+with+article&mtas.list.0.prefix=t%2Cs&mtas.list.0.output=token&mtas.list.0.number=2&mtas.list.0.start=0&mtas.list.0.left=2&mtas.list.0.right=1&fl=%2A&rows=0&wt=json&indent=true`
```json
"mtas":{
"list":[{
"key":"sentence starting with article",
"number":2,
"list":[{
"documentKey":"44e5620c-011c-11e4-b0ff-51bcbd7c379f",
"documentHitPosition":0,
"documentHitTotal":18,
"documentMinPosition":0,
"documentMaxPosition":6385,
"startPosition":378,
"endPosition":378,
"tokens":[{
"mtasId":2534,
"prefix":"t",
"value":"leven",
"positionStart":379,
"positionEnd":379,
"parentMtasId":2914},
{
"mtasId":2517,
"prefix":"t",
"value":".",
"positionStart":377,
"positionEnd":377,
"parentMtasId":2526},
{
"mtasId":2527,
"prefix":"t",
"value":"Het",
"positionStart":378,
"positionEnd":378,
"parentMtasId":2914},
{
"mtasId":2914,
"prefix":"s",
"value":"",
"positionStart":378,
"positionEnd":433,
"parentMtasId":2915},
{
"mtasId":2512,
"prefix":"t",
"value":"Landbouwkundige",
"positionStart":376,
"positionEnd":376,
"parentMtasId":2526},
{
"mtasId":2526,
"prefix":"s",
"value":"",
"positionStart":307,
"positionEnd":377,
"parentMtasId":2915}]},
{
"documentKey":"44e5620c-011c-11e4-b0ff-51bcbd7c379f",
"documentHitPosition":1,
"documentHitTotal":18,
"documentMinPosition":0,
"documentMaxPosition":6385,
"startPosition":878,
"endPosition":878,
"tokens":[{
"mtasId":5794,
"prefix":"t",
"value":"De",
"positionStart":878,
"positionEnd":878,
"parentMtasId":5999},
{
"mtasId":5801,
"prefix":"t",
"value":"eerzucht",
"positionStart":879,
"positionEnd":879,
"parentMtasId":5999},
{
"mtasId":5999,
"prefix":"s",
"value":"",
"positionStart":878,
"positionEnd":908,
"parentMtasId":6305},
{
"mtasId":5779,
"prefix":"t",
"value":"bewaarheid",
"positionStart":876,
"positionEnd":876,
"parentMtasId":5792},
{
"mtasId":5786,
"prefix":"t",
"value":".",
"positionStart":877,
"positionEnd":877,
"parentMtasId":5792},
{
"mtasId":5792,
"prefix":"s",
"value":"",
"positionStart":857,
"positionEnd":877,
"parentMtasId":5793}]}]}]}
```
---
|