blob: f93ce8bcb0edcc57f3cf118372275b2216dafd28 [file] [log] [blame]
Nils Diewalda31a5152015-04-17 21:05:23 +00001% layout 'main', title => 'KorAP: Query Languages';
2
3%# https://letsencrypt.org/howitworks/
4
5%# Store the id of an active section in the session, so the system is able to directly scroll to the relevant section
6%# This should be stored when clicking on a specific query
7%# but the remembered section contains the id - not the query
8
Akron1120a582017-10-17 12:29:16 +02009<h2 id="tutorial-top">Query Languages</h2>
Nils Diewalda31a5152015-04-17 21:05:23 +000010
Nils Diewaldc46003b2015-05-07 15:55:35 +000011<section id="intro">
Nils Diewalda31a5152015-04-17 21:05:23 +000012 <h3>Frontend Features</h3>
Akronb2d6b762016-08-29 18:30:23 +020013 <p>This frontend differs to the <%= doc_ext_link_to 'official frontend', 'http://korap.ids-mannheim.de/app/', target => '_blank', rel => 'noopener noreferrer' %> by providing a serialization view, an integrated tutorial, a comparison view for morphological annotations, and an autocompletion for closed annotations (type in <%= doc_link_to 'foundry prefixes', 'data', 'annotation' %> like <code>cnx/</code>).</p>
Nils Diewalda31a5152015-04-17 21:05:23 +000014</section>
15
Nils Diewaldc46003b2015-05-07 15:55:35 +000016<section id="examples">
Nils Diewalda31a5152015-04-17 21:05:23 +000017 <h3>Example Queries</h3>
Nils Diewalda31a5152015-04-17 21:05:23 +000018
Akronff7811f2017-12-19 12:40:41 +010019 <p><strong><%= doc_link_to 'Poliqarp', 'ql', 'poliqarp-plus' %></strong>: Find all occurrences of the lemma &quot;baum&quot; as annotated by the <%= doc_link_to 'default foundry', 'data', 'annotation' %>.</p>
Akronf4a7cf42018-01-09 15:58:45 +010020 %= doc_query poliqarp => '[base=Baum]'
Nils Diewalda31a5152015-04-17 21:05:23 +000021
Akronff7811f2017-12-19 12:40:41 +010022 <p><strong><%= doc_link_to 'Poliqarp', 'ql', 'poliqarp-plus' %></strong>: Find all sequences of adjectives as annotated by Treetagger, that are repeated 3 to 5 times in a row.</p>
Akronf4a7cf42018-01-09 15:58:45 +010023 %= doc_query poliqarp => '[tt/p=ADJA]{3,5}'
Nils Diewalda31a5152015-04-17 21:05:23 +000024
Akronff7811f2017-12-19 12:40:41 +010025 <p><strong><%= doc_link_to 'Cosmas-II', 'ql', 'cosmas-2' %></strong>: Find all occurrences of the words &quot;der&quot; and &quot;Baum&quot;, in case they are in a maximum distance of 5 tokens. The order is not relevant.</p>
Akronf4a7cf42018-01-09 15:58:45 +010026 %= doc_query cosmas2 => 'der /w5 Baum'
Nils Diewalda31a5152015-04-17 21:05:23 +000027
Akronff7811f2017-12-19 12:40:41 +010028 <p><strong><%= doc_link_to 'Cosmas-II', 'ql', 'cosmas-2' %></strong>: Find all sequences of a word starting with a &quot;d&quot; (using a wildcard) followed by an adjective as annotated in the mate foundry, followed by the word &quot;Baum&quot; (ignore the case), that is in a sentence element annotated by the <%= doc_link_to 'default foundry', 'data', 'annotation' %>.</p>
Nils Diewalda31a5152015-04-17 21:05:23 +000029 <p><em>Be aware</em>: Minor incompatibilities with implemented languages may be announced with warnings.</p>
Akronf4a7cf42018-01-09 15:58:45 +010030 %= doc_query cosmas2 => 'd* MORPH(mate/p=ADJA) $Baum #IN #ELEM(s)'
Nils Diewalda31a5152015-04-17 21:05:23 +000031
Akronff7811f2017-12-19 12:40:41 +010032 <p><strong><%= doc_link_to 'Poliqarp+', 'ql', 'poliqarp-plus' %></strong>: Find all nominal phrases as annotated using Connexor, that contain an adverb as annotated by OpenNLP, that is annotated as something starting with an &quot;A&quot; using regular expressions in Treetagger.</p>
Akronf4a7cf42018-01-09 15:58:45 +010033 %= doc_query poliqarp => 'contains(<cnx/c=np>,{[opennlp/p=ADV & tt/p="A.*"]})', cutoff => 1
Nils Diewalda31a5152015-04-17 21:05:23 +000034
Akronff7811f2017-12-19 12:40:41 +010035 <p><strong><%= doc_link_to 'Poliqarp+', 'ql', 'poliqarp-plus' %></strong>: Find all sentences as annotated by the base foundry that start with a sequence of one token in present tense as annotated by Connexor and the lemma &quot;die&quot; annotated by the <%= doc_link_to 'default foundry', 'data', 'annotation' %>. Highlight both terms of the sequence.</p>
Akronf4a7cf42018-01-09 15:58:45 +010036 %= doc_query poliqarp => 'startswith(<base/s=s>, {1:[cnx/m=PRES]}{2:[base=die]})', cutoff => 1
Nils Diewalda31a5152015-04-17 21:05:23 +000037
Akronff7811f2017-12-19 12:40:41 +010038 <p><strong><%= doc_link_to 'Poliqarp+', 'ql', 'poliqarp-plus' %></strong>: Find all sequences of an article, followed by three to four adjectives and a noun as annotated by the Treetagger foundry, that finish a sentence. Highlight all parts of the sequence.</p>
Akronf4a7cf42018-01-09 15:58:45 +010039 %= doc_query poliqarp => 'focus(3:endswith(<base/s=s>,{3:[tt/p=ART]{1:{2:[tt/p=ADJA]{3,4}}[tt/p=NN]}}))', cutoff => 1
Nils Diewalda31a5152015-04-17 21:05:23 +000040
Akronff7811f2017-12-19 12:40:41 +010041 <p><strong><%= doc_link_to 'Annis', 'ql', 'annis' %></strong>: Find all occurrences of the sequence of two tokens annotated as adverbs by the <%= doc_link_to 'default foundry', 'data', 'annotation' %>.</p>
Akronf4a7cf42018-01-09 15:58:45 +010042 %= doc_query annis => 'pos="ADV" & pos="ADV" & #1 . #2'
Nils Diewalda31a5152015-04-17 21:05:23 +000043
Akronff7811f2017-12-19 12:40:41 +010044 <p><strong><%= doc_link_to 'CQL', 'ql', 'cql' %></strong>: Find all occurrences of the sequence &quot;der alte Mann&quot;.</p>
Akronf4a7cf42018-01-09 15:58:45 +010045 %= doc_query cql => '"der alte Mann"'
Nils Diewalda31a5152015-04-17 21:05:23 +000046</section>