Skip to content

Queries

Alexandre Rademaker edited this page Nov 16, 2018 · 6 revisions

We have already a rudimentary query language inspired by dep_search query language. Queries are submitted to a list of sentences and should return the sentences that satisfy the query.

(write-conllu-to-stream  
		 (query '(advmod (upostag "ADJ") (upostag "PROPN")) 
			(read-conllu "documents/")))

In this query above, we list all sentences that have a token `PROPN` with pointing to a token `ADJ` by the relation `advmod` (head is the `ADJ`). Note that files are read from the `documents` repository. See read and write functions.

Clone this wiki locally