-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCQP_Template_complete.html
434 lines (381 loc) · 9.86 KB
/
CQP_Template_complete.html
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
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
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html" ; charset="utf-8" />
<style>
.code-container {
background-color: black;
border-radius: 5px;
margin-left: 5px;
margin-bottom: 10px; /* Added space between blocks */
margin-top: 10px;
overflow-x: auto; /* Add horizontal scrollbar */
}
code {
/* Add padding to code block for consistent spacing */
display: inline-block;
padding-top: 14px;
font-size: 11pt;
}
pre {
background-color: black;
color: white;
font-family: "DejaVu Sans Mono", monospace;
white-space: pre; /* Maintain preformatted text */
margin: 0; /* Remove margin to avoid extra space */
display: inline-block; /* Ensure inline-block for horizontal scrolling */
}
body {
margin: 25pt 55pt 65pt 55pt;
word-wrap: break-word;
font-family: Helvetica;
font-size: 12pt;
line-height: 1.5;
background-color: #f4f4f4; /* Set the background color to a nice, pleasant color */
}
.center-text {
text-align: center !important;
}
.reduspace {
margin-bottom: 0.1em;
}
.emf {
font-weight: bold;
font-size: 12.5pt;
}
a:link {
color: #193f7d;
}
a:visited {
color: #193f7d;
}
/* The following are used in or <div> tags for different kinds of titles:
in the original 'descripcio_i_analisi_corpora.html .This is a CSS comment */
.Title1 {
font-size: 14pt;
font-weight: bold;
line-height: 2;
font-family: Helvetica;
}
.Title2 {
font-size: 14pt;
font-weight: bold;
line-height: 2;
font-family: Helvetica;
}
.TitleBurgundyBig {
font-size: 14pt;
font-weight: bold;
/* line-height: 110%; */
font-family: Helvetica;
color: #971930;
}
.TitleBluishSmall {
font-size: 12pt;
font-weight: bold;
line-height: 110%;
font-family: Helvetica;
color: #262192;
}
.TitleGreenSmall {
font-size: 14pt;
font-weight: bold;
line-height: 110%;
font-family: Helvetica;
color: #0a4803;
}
.GreenSmall {
font-size: 12pt;
font-weight: bold;
line-height: 110%;
font-family: Helvetica;
color: #0a4803;
}
ul.spaced-list {
line-height: 1.5; /* Adjust the value as needed */
}
a:hover {
color: blue;
}
a {
text-decoration: none;
color: inherit;
}
span {
font-size: 12pt;
font-family: "DejaVu Sans Mono", monospace;
}
.animated-text {
animation: emphasis 1s infinite;
transition: color 0.5s ease-in-out;
}
@keyframes emphasis {
0%,
100% {
color: black; /* Starting color */
font-weight: bold; /* Keep text in bold */
}
50% {
color: #801e31; /* Midpoint color */
font-weight: bold; /* Keep text in bold */
}
}
.animated-text:hover {
color: blue; /* Hover color */
font-weight: bold; /* Keep text in bold */
font-size: 14px; /* Hover font size */
}
@keyframes blink-animation {
0% {
opacity: 1;
}
50% {
opacity: 0;
}
100% {
opacity: 1;
}
}
.blink {
animation: blink-animation 2s linear infinite;
}
/*
hr {
color: #000000; Set the color of the line height: 1px; Set the height of the line border-style: solid; Set the border style (solid, dashed, dotted, etc.) border-width: 1px; Set the width of the border }
*/
hr {
height: 2px;
/* border-style: dashed; */
border-color: #3a2b69;
}
.bracket {
color: #fc44a5;
font-weight: bolder;
}
.brace {
color: white;
}
.parenthesis {
color: #53ea30;
font-weight: bolder;
}
.pipe {
color: blue;
font-weight: bolder;
}
.tag {
color: orange; /* Example color for tags */
}
.copy-button {
margin-top: 10px;
padding: 5px 10px;
border: inherit;
border-radius: 15px;
background-color: #09519f;
font-size: 8pt;
color: white;
cursor: pointer;
display: block;
}
</style>
<script>
function highlightSyntax(codeBlock) {
let html = "";
const code = codeBlock.textContent;
for (let i = 0; i < code.length; i++) {
let char = code[i];
let className = "";
switch (char) {
case '[':
case ']':
className = "bracket";
break;
case '(':
case ')':
className = "parenthesis";
break;
case '{':
case '}':
className = "brace";
break;
case '|':
className = "pipe";
break;
default:
if (code.substring(i).startsWith('tag="')) {
className = "tag";
let endIndex = code.indexOf('"', i + 5); // Find closing quote
char = code.substring(i, endIndex + 1); // Include the entire tag
i = endIndex; // Move i to the end of the tag
}
}
html += `<span class="${className}">${char}</span>`;
}
codeBlock.innerHTML = html;
}
function copyCode(event) {
var button = event.target;
var codeBlock = button.previousElementSibling.querySelector('code');
var plainText = codeBlock.textContent; // Get plain text content
// Create a temporary textarea element to hold the text
var tempTextarea = document.createElement('textarea');
tempTextarea.value = plainText;
document.body.appendChild(tempTextarea);
tempTextarea.select();
document.execCommand('copy');
document.body.removeChild(tempTextarea);
alert("Code copied to clipboard!");
}
// Call the highlightSyntax function after the page loads
window.onload = function() {
var codeBlocks = document.querySelectorAll('.code-block');
codeBlocks.forEach(highlightSyntax);
var copyButtons = document.querySelectorAll('.copy-button');
copyButtons.forEach(function(button) {
button.addEventListener('click', copyCode);
});
};
</script>
<title>CQP search templates</title>
</head>
<body>
<div class="Title1 center-text">Premade searches with CQP syntax</div>
<div class="Title2 center-text">Tagset: BNC (Sketchengine)</div>
<br>
<div class="TitleBluishSmall"> <span class="TitleBurgundyBig">1. Verb</span> ➝ V</div>
<div class="code-container">
<pre>
<code class="code-block">[tag="VV.*"]</code>
</pre>
</div>
<button class="copy-button">Click this button to copy query to clipboard</button>
<br>
<hr />
<br>
<div class="TitleBluishSmall"> <span class="TitleBurgundyBig">2. NP</span> ➝ (Det) (Adj) N</div>
<div class="code-container">
<pre>
<code class="code-block">[tag="DT"]{0,1}[tag="J.*"]{0,1}[tag="N.*"]</code>
</pre>
</div>
<button class="copy-button">Copy query</button>
<br>
<hr />
<br>
<div class="TitleBluishSmall"> <span class="TitleBurgundyBig">3. NP</span> ➝ Pronoun</div>
<div class="code-container">
<pre>
<code class="code-block">[tag="PP"]</code>
</pre>
</div>
<button class="copy-button">Copy query</button>
<br>
<hr />
<br>
<div class="TitleBluishSmall"> <span class="TitleBurgundyBig">4. NP</span> ➝ Full NP or Pronoun</div>
<div class="code-container">
<pre>
<code class="code-block">(([tag="DT"]{0,1}[tag="J.*"]{0,1}[tag="N.*"])|([tag="PP"]))</code>
</pre>
</div>
<button class="copy-button">Copy query</button>
<br>
<hr />
<br>
<div class="TitleBluishSmall"> <span class="TitleBurgundyBig">5. Prepositional Phrase</span> ➝ Preposition + NP</div>
<div class="code-container">
<pre>
<code class="code-block">[tag="IN"](([tag="DT"]{0,1}[tag="J.*"]{0,1}[tag="N.*"])|([tag="PP"]))</code>
</pre>
</div>
<button class="copy-button">Copy query</button>
<br>
<hr />
<br>
<div class="TitleBluishSmall"> <span class="TitleBurgundyBig">6. Particle</span> ➝ Looks like a preposition but ain't a preposition</div>
<div class="code-container">
<pre>
<code class="code-block">[tag="RP"]</code>
</pre>
</div>
<button class="copy-button">Copy query</button>
<br>
<hr />
<br>
<span class="TitleBurgundyBig">Verb + Particle</span>
<div class="code-container">
<pre>
<code class="code-block">[tag="VV.*"][tag="RP.*"]</code>
</pre>
</div>
<button class="copy-button">Copy query</button>
<br>
<hr />
<br>
<span class="TitleBurgundyBig">Verb + Prepositional Phrase</span>
<div class="code-container">
<pre>
<code class="code-block">[tag="VV.*"][tag="IN"](([tag="DT"]{0,1}[tag="J.*"]{0,1}[tag="N.*"])|([tag="PP"]))</code>
</pre>
</div>
<button class="copy-button">Copy query</button>
<br>
<hr />
<br>
<span class="TitleBurgundyBig">Verb + Particle + Prepositional Phrase</span>
<div class="code-container">
<pre>
<code class="code-block">[tag="VV.*"][tag="RP"][tag="IN"](([tag="DT"]{0,1}[tag="J.*"]{0,1}[tag="N.*"])|([tag="PP"]))</code>
</pre>
</div>
<button class="copy-button">Copy query</button>
<br>
<hr />
<br>
<span class="TitleBurgundyBig">Verb + NP + Particle + Prepositional Phrase</span>
<div class="code-container">
<pre>
<code class="code-block">[tag="VV.*"](([tag="DT"]{0,1}[tag="J.*"]{0,1}[tag="N.*"])|([tag="PP"]))[tag="RP"][tag="IN"](([tag="DT"]{0,1}[tag="J.*"]{0,1}[tag="N.*"])|([tag="PP"]))</code>
</pre>
</div>
<button class="copy-button">Copy query</button>
<br>
<hr />
<br>
<span class="TitleBurgundyBig">Verb + NP + Prepositional Phrase</span>
<div class="code-container">
<pre>
<code class="code-block">[tag="VV.*"](([tag="DT"]{0,1}[tag="J.*"]{0,1}[tag="N.*"])|([tag="PP"]))[tag="IN"](([tag="DT"]{0,1}[tag="J.*"]{0,1}[tag="N.*"])|([tag="PP"]))</code>
</pre>
</div>
<button class="copy-button">Copy query</button>
<br>
<hr />
<br>
<span class="TitleBurgundyBig">Verb + NP (pronoun) + Prepositional Phrase</span>
<div class="code-container">
<pre>
<code class="code-block">[tag="VV.*"][tag="PP.*"][tag="IN"](([tag="DT"]{0,1}[tag="J.*"]{0,1}[tag="N.*"])|([tag="PP"]))</code>
</pre>
</div>
<button class="copy-button">Copy query</button>
<br>
<hr />
<br>
<span class="TitleBurgundyBig">Verb + NP (pronoun) + Particle + Prepositional Phrase</span>
<div class="code-container">
<pre>
<code class="code-block">[tag="VV.*"][tag="PP.*"][tag="RP.*"][tag="IN"](([tag="DT"]{0,1}[tag="J.*"]{0,1}[tag="N.*"])|([tag="PP"]))</code>
</pre>
</div>
<button class="copy-button">Copy query</button>
<br>
<hr />
<br>
<div class= GreenSmall>For more examples of premade complex searches, check here</div>
<br>
<a href="https://jmfontana.github.io/dia-corpora/searches_grammatical_functions.html" target="_blank">https://jmfontana.github.io/dia-corpora/searches_grammatical_functions.html</a>
<br>
<br>
</body>
</html>