Skip to main content
Ctrl+K
Swiss-AL Workbench Documentation - Home

Getting Started

  • Quickstart Guide

Working with Swiss-AL

  • Corpora
    • Organizational
    • Journalistic
    • Parliamentary
    • Project
    • Demo
  • Search Modes
    • Quick Search
    • Basic Search
    • Advanced Search
    • Tagsets
  • Tools
    • Explore Corpus
    • Search Corpus
  • Citing Swiss-AL

Background

  • Swiss-AL Pipeline
  • Swiss-AL and FAIR Principles
  • Glossary
  • Bibliography

Help and Resources

  • Frequently Asked Questions
  • Open Educational Resources
    • Case Studies
    • Educational Videos
    • Learning Modules

About

  • About Us
  • Terms of Use
  • Impressum

Swiss-AL Platform

  • Open the Workspace
  • .md

Advanced Search

Contents

  • Examples in German
  • Examples in French
  • Examples in Italian
  • Regular Expressions

Advanced Search#

The Advanced Search implements the CQP query syntax. CQP is a powerful query language for searching linguistic corpora. It is designed for querying large annotated text corpora with complex conditions and linguistic annotations. CQP syntax allows for pattern matching, searching for word forms, lemmas, parts of speech, named entities and other annotations, and supports advanced linguistic queries. In the following sections, we show some of the most important, but not all features of the CQP syntax. For exploring its full capacity, see CQP Interface and Query Language Manual and The CQP Query Language Tutorial.

Examples in German#

Search Type

Syntax

Explanation

One-term search

"Demokratie"

Searches for the exact word Demokratie.

Word search using parameter

[word="Demokratie"]

Searches for the word Demokratie using the word parameter.

Lemma search

[lemma="Demokratie"]

Searches for all inflected forms of the lemma Demokratie.

Part-of-speech (PoS) search

[pos="NN"]

Searches for common nouns (NN), see the German PoS tagset.

Named Entity (NER) search

<ne_entityType="LOC"> [];

Searches for named entities labeled as LOC (locations). You can also specify ORG for organisations and PER for persons

Finding a sequence of words

[pos="ADJA"][lemma="Gesellschaft"]

Searches for an attributive adjective (ADJA), followed by the lemma Gesellschaft.

Combining multiple PoS tags

([pos="ADJA"]|[pos="ART"]) [lemma="Gesellschaft"]

Searches for either an attributive adjective (ADJA) or an article (ART), followed by Gesellschaft.

Multiple conditions in one token

[lemma="Essen" & pos="NN"]

Searches for the lemma Essen, but only when tagged as a noun (NN).

Negation (Excluding a specific PoS tag)

[lemma="gross" & pos!="ADJD"]

Searches for gross, but only when it is not tagged as a predicative adjective or adverb (ADJD).

Longer word sequences

[pos="ART"][pos="ADJA"][lemma="Gesellschaft"]

Searches for an article (ART), followed by an adjective (ADJA), followed by Gesellschaft.

See also

See Tagsets for the full list of German PoS tags.

Examples in French#

Search Type

Syntax

Explanation

One-term search

"démocratie"

Searches for the exact word démocratie.

Word search using parameter

[word="démocratie"]

Searches for the word démocratie using the word parameter.

Lemma search

[lemma="démocratie"]

Searches for all inflected forms of the lemma démocratie.

Part-of-speech (PoS) search

[pos="NOUN"]

Searches for nouns (NOUN) in the French PoS tagset.

Named Entity (NER) search

<ne_entityType="LOC"> [];

Searches for named entities labeled as LOC (locations). You can also specify ORG for organisations and PER for persons

Finding a sequence of words

[pos="ADJ"][lemma="société"]

Searches for an adjective (ADJ), followed by the lemma société.

Combining multiple PoS tags

([pos="ADJ"]|[pos="DET"]) [lemma="société"]

Searches for either an adjective (ADJ) or a determiner (DET), followed by société.

Multiple conditions in one token

[lemma="marche" & pos="NOUN"]

Searches for the lemma marche, but only when tagged as a noun (NOUN).

Negation (Excluding a specific PoS tag)

[lemma="grand" & pos!="ADV"]

Searches for grand, but only when it is not tagged as an adverb (ADV).

Longer word sequences

[pos="DET"][pos="ADJ"][lemma="société"]

Searches for a determiner (DET), followed by an adjective (ADJ), followed by société.

See also

See Tagsets for the full list of French PoS tags.

Examples in Italian#

Search Type

Syntax

Explanation

One-term search

"democrazia"

Searches for the exact word democrazia.

Word search using parameter

[word="democrazia"]

Searches for the word democrazia using the word parameter.

Lemma search

[lemma="democrazia"]

Searches for all inflected forms of the lemma democrazia.

Part-of-speech (PoS) search

[pos="NOUN"]

Searches for nouns (NOUN) in the Italian PoS tagset.

Named Entity (NER) search

<ne_entityType="LOC"> [];

Searches for named entities labeled as LOC (locations). You can also specify ORG for organisations and PER for persons

Finding a sequence of words

[lemma="società"][pos="ADJ"]

Searches for the lemma società, followed by an adjective (ADJ).

Combining multiple PoS tags

([pos="ADJ"]|[pos="DET"]) [lemma="società"]

Searches for either an adjective (ADJ) or a determiner (DET), followed by società.

Multiple conditions in one token

[lemma="lavoro" & pos="NOUN"]

Searches for the lemma lavoro, but only when tagged as a noun (NOUN).

Negation (Excluding a specific PoS tag)

[lemma="grande" & pos!="ADV"]

Searches for grande, but only when it is not tagged as an adverb (ADV).

Longer word sequences

[pos="DET"][pos="ADJ"][lemma="società"]

Searches for a determiner (DET), followed by an adjective (ADJ), followed by società.

See also

See Tagsets for the full list of Italian PoS tags.

Regular Expressions#

This CQP syntax accepts regular expressions, which act as placeholders for certain characters or combinations of characters. The following table shows the most important regular expressions and examples how to use them:

RegEx

Meaning

Example

.

Matches any single character:

DE: [word="erneuerbare."] → erneuerbaren, erneuerbarem, erneuerbarer, …
FR: [word="ou."] → oui, oué …
IT: [word="ecologic."] → ecologica, ecologici, ecologica, …

+

Repetition operator: The preceding character must occur at least once but can appear multiple times (up to the word boundary). Useful with .:

DE: [word="Energie.+"] → Energien, Energiegesetz, Energiestrategien, …
FR: [word="nation.+"] → nations, national, nationale, nationalisme, …
IT: [word="nazi.+"] → nazioni, nazionalità, nazionalismo, …

*

Repetition operator: The preceding character can occur any number of times, including zero (up to the word boundary). Useful with .:

DE: [word="Energie.*"] → Energie, Energien, Energiegesetz, Energiestrategien, …
FR: [word="éducation.*"] → éducation, éducations, …
IT: [word="posta.*"] → posta, postale, postali, …

?

Repetition operator: The preceding character is optional (can appear or not):

DE: [word="energie–?effizient"] → energie–effizient, energieeffizient, …
FR: [word="co–?working"] → co–working, coworking, …
IT: [word="eco–?turismo"] → eco–turismo, ecoturismo, …

(x|y)

Matches either element in parentheses separately:

DE: [word="(E|e)nergie–?(Z|z)ukunft"] → Energiezukunft, energiezukunft, Energie-zukunft, Energie-Zukunft, …
FR: [word="(É|é)cologie–?(V|v)erte"] → Écologie verte, écologie-verte, écologieVerte, …
IT: [word="(E|e)cologia"] → ecologia, Ecologia

x{0,3}

Matches between 0 and 3 repetitions of the preceding element. Multiple elements can be included in square brackets:

DE: [word="ja{0,3}]" → ja, jaa, jaaa, jaaaa
FR: [word="oui{0,3}"] → oui, ouii, ouiii, ouiiii
IT: [word="no{0,3}"] → no, noo, nooo, noooo

[]

Matches any single token between search terms:

DE: [word="die"] [] [word="Energie"] → die graue Energie, die saubere Energie, …
FR: [word="la"] [] [word="nature"] → la belle nature, la vraie nature, …
IT: [word="la"] [] [word="volta"] → la prima volta, la seconda volta, la terza volta, …

[^]

Excludes the characters in brackets after ^ from occurring:

DE: [word=".*?[^eE]nergie"] → Minergie, Synergie, … but not Energie
FR: [word=".*?[^eEÉé]nergie"]] → Minergie, synergie, … but not énergie
IT: [word=".*?[^Ee]nergia"] → Minergia, sinergia, … but not energia

!

Excludes any match for the expression after the exclamation mark.

DE: [pos!="NN"] → Results include all word types except nouns (NN).
FR: [pos!="NOUN"] → Results include all word types except nouns (NOUN).
IT: [pos!="NOUN"] → Results include all word types except nouns (NOUN).

&

Combines pos, word or lemma for a single search term:

DE: [word="richtig" & pos="ADV"] → Occurrences of richtig only as an adverb, not as an adjective.
FR: [word="juste" & pos="ADV"] → Occurrences of juste only as an adverb, not as an adjective.
IT: [word="giusto" & pos="ADV"] → Occurrences of giusto only as an adverb, not as an adjective.

\

Interprets characters literally, even if they are placeholders in CQP:

DE: [word="Erneuerbare"] [word="\?"] → Finds Erneuerbare? literally.
FR: [word="Énergie"] [word="\?"] → Finds Énergie? literally.
IT: [word="Energia"] [word="\?"] → Finds Energia? literally.

%c

Case-insensitive search:

DE: [word="energie"%c] → Energie, energie
FR: [word="énergie"%c] → Énergie, énergie
IT: [word="energia"%c] → Energia, energia

previous

Basic Search

next

Tagsets

Contents
  • Examples in German
  • Examples in French
  • Examples in Italian
  • Regular Expressions

By ZHAW Digital Discourse Lab

© Copyright Licensed under the Creative Commons Attribution 4.0 International (CC BY 4.0).