Derlemce
User guide

Query language and tagset

This guide explains how to search Derlemce for word forms, lemmas, parts of speech and morphological features. The query language is based on CQL, as used in CQP and Sketch Engine. If you have worked with either, most of your queries will also work in Derlemce.

Download as PDF Türkçe sürüm

Query types

The selector above the query box decides how your text is interpreted. The chosen type translates your query into CQL; the translation appears under the box, so you can always see what is being searched.

TypeYou typeSearchedWhen
Simplekitapkitap (word form) A word as it appears in the text.
Lemmagel[kok="gel"] Word forms that share the same lemma: geldi, gelecek, gelmiş…
Phrasene var ki, [sozcuk="ne"] [sozcuk="var"] [sozcuk="ki"] [sozcuk=","] A sequence exactly as written. Punctuation counts as a separate token; * and ? are not wildcards.
Word formyüz + Part of speech: Noun [sozcuk="yüz" & pos="NOUN"] A form restricted to one part of speech: “yüz” the noun (face), not “yüz” the numeral (hundred).
Character stringlık[sozcuk=".*lık.*"] Words containing a sequence of letters.
CQL[pos="ADJ"] [kok="ev"]As typed Queries that combine fields, sequences or regular expressions.

Text containing a square bracket ([) is run as CQL whatever type is selected.

Two options under the box appear depending on the type:

  • Part of speech (Lemma, Word form): restricts results to one part of speech; & pos="…" is added to the query.
  • Match case (Simple, Phrase, Word form, Character string): Ankara finds only “Ankara” with a capital A; %h is added to the query. Details: Letter case: %h.

Simple queries and wildcards

A simple query searches word forms. By default it is case-insensitive and follows Turkish casing rules: İstanbul, istanbul and ISPARTA are lowercased correctly (I → ı, İ → i). Tick “Match case” if you need the distinction.

QueryMeaningExample matches
kitapExact word formkitap
kitap**: zero or more letterskitap, kitaplar, kitapçı
ev??: exactly one lettereve, evi (not evde)
*lıkForms ending in “-lık”yıllık, kitaplık
bir şeyTwo consecutive wordsbir şey

Wildcards work in the Simple, Lemma and Word form types, not in Phrase. In CQL the same is done with regular expressions: .* for *, . for ?.

CQL: fields and operators

Each pair of square brackets describes one token (a word or a punctuation mark). Inside you can write one or more conditions: field="value".

FieldAliasesContentExample
sozcukword The form as written in the text. Case-insensitive by default; case-sensitive with %h[sozcuk="geldi"]
koklemma Lemma (dictionary form). Covers every form that shares the lemma[kok="gel"]
turpos, upos, tag Part of speech. Either the UD code (VERB) or the Derlemce value (FİİL) [pos="VERB"]
bicimfeats Morphological features. Matches any single component of the feature set [feats="Case=Acc"]
[lemma="gel" & feats="Tense=Fut"]& — both conditions: future-tense “gel” [lemma="ev" | lemma="yuva"]| — either condition [pos!="PUNCT"]!= — exclusion: every non-punctuation token [upos="VERB" & feats="VerbForm=Conv"]converbs

Values go in double or single quotes. & and | cannot be mixed inside one pair of brackets.

Letter case: %h

%h, written straight after the closing quote, makes a word-form search case-sensitive. It only applies to the sozcuk (word) field; lemmas and tags are stored in a single form. (CQP's %c is the opposite flag — see Other tools.)

[word="Ankara"%h]only “Ankara” with a capital A [word="Bir"%h]sentence-initial “Bir”; not “bir” or “BİR” [word="[A-ZÇĞİÖŞÜ]+"%h]words written entirely in capitals (abbreviations) [word="Bu"%h & pos="DET"]the flag combines with other conditions
“BELİRTEÇ” is ambiguous. The Turkish interface shows adverbs as BELİRTEÇ, but the raw value BELİRTEÇ in a query finds determiners (DET). To avoid confusion, write parts of speech as UD codes: [pos="ADV"] for adverbs, [pos="DET"] for determiners. We are working on the part-of-speech labels and will make this distinction clearer in the interface.

Sequences and gaps

Consecutive brackets search for consecutive words. Empty brackets [] match any word; curly braces say how many times a token repeats.

[pos="ADJ"] [lemma="ev"]adjective + “ev”: büyük ev, eski evler [lemma="bir"] [lemma="şey"]a two-word pattern [lemma="çok"] []{0,2} [pos="NOUN"]0–2 arbitrary words in between [feats="Case=Abl"] [lemma="sonra"]ablative + “sonra”: savaştan sonra [pos="NOUN"]{2}two nouns in a row ({3}: three) [pos="ADJ"]{1,2} [lemma="ev"]one or two adjectives + “ev”
  • {n} exactly n times, {a,b} between a and b, {,b} at most b. Without an upper bound the limit is 10.
  • A query cannot start with empty brackets or an optional ({0,…}) token.
  • Sequences do not cross document boundaries; they may cross sentence boundaries.

Regular expressions

CQL values are regular expressions and, as in CQP, must match the whole word. [word="kitap"] finds only “kitap”; for “kitaplar” you need kitap.*. A leading ^ and trailing $ are unnecessary.

SyntaxMeaningExampleFinds
.any one letter[word="ev."]evi, eve
.*zero or more letters[word="kitap.*"]kitap, kitaplar, kitapçı
.+at least one letter[word="kitap.+"]kitaplar (not kitap)
(a|b)alternatives[word=".*(lar|ler)"]forms ending in -lAr
[…]character class[word=".*l[ıiuü]k"]-lık, -lik, -luk, -lük
{n,m}repetition[word=".*[aeıioöuü]{3}.*"]three vowels in a row
\escape a special character[word="3\.5"]“3.5”
[lemma="(gel|git)"]every form of “gel” or “git” [word=".*c[ıiuü]|.*ç[ıiuü]"]forms ending in -CI [lemma="gel.*"]lemmas starting with “gel”: gel, gelecek, gelişme…

The feats field works differently. A token's feature value is a list such as Case=Acc|Number=Sing|Person=3. [feats="Case=Acc"] matches one component of that list; you do not need to write the whole list.

Regular expressions cannot use the index. Such queries scan the whole corpus. The result list appears at once; the total number of hits shows as 300+ in the header and can be computed exactly with the link next to it.

Orthographic words and parts

Stanza splits some words into several parts during grammatical analysis, for example siyasetçi → siyaset + çi and önemlidir → önemli + dir. Derlemce keeps the word as it is written in the text and stores the analysis parts in a separate layer:

  • Orthographic word — the form as written in the text. The word field and simple queries search this: önemlidir finds the word as written, even where the analyser split it into parts.
  • Part — the unit produced by the analyser. lemma, pos and feats look at the parts: [lemma="siyaset"] also finds “siyasetçi”.

When a part matches, the hit is shown as the whole orthographic word it belongs to and counted once. Word-form frequency lists and n-grams are also built from orthographic words; parts such as -çi and -dir are not listed as separate words.

Comparison with other tools

CQP and Sketch EngineDerlemceNote
[word="ev"][word="ev"] or [sozcuk="ev"]same
[lemma="gel"][lemma="gel"] or [kok="gel"]same
[tag="VERB"][pos="VERB"]UD codes are mapped to Derlemce's Turkish labels
[word="ev"%c][word="ev"]Derlemce is case-insensitive by default; %c is accepted and ignored
[word="Ev"][word="Ev"%h]CQP is case-sensitive by default; Derlemce needs %h
[]{0,3}[]{0,3}same
[pos="ADJ"]+[pos="ADJ"]{1,10}no + or * quantifiers
within s, <s/>—no structural attributes; filters are in the left panel
a:[…] … & a.lemma=b.lemma—no labelled (global) constraints

Tagset

Parts of speech in Derlemce follow Universal Dependencies (UD) codes, and morphological tags follow UD features, where each value is defined in English. The tables give the usual Turkish terms from the literature; where more than one term is in use, both are listed.

Download the tagset (CSV) Parts of speech, UD features and short tags in one file.

Parts of speech

UD codeDerlemce valueTurkish termNote
NOUNİSİMad (isim)
PROPNÖZELözel ad
VERBFİİLeylem (fiil)
AUXFİİLyardımcı eylemCollapses to the same value as VERB (FİİL) in Derlemce; to tell them apart use the lemma, not [pos="AUX"].
ADJSIFATsıfat (önad)
ADVZARFzarf (belirteç)
PRONADILadıl (zamir)
DETBELİRTEÇbelirleyiciRaw value BELİRTEÇ — do not confuse with 'belirteç' (adverb) in the Turkish literature; writing [pos="DET"] is safest.
NUMSAYIsayı
ADPİLGEÇilgeç (edat)
CCONJBAĞLAÇbağlaç (eşgüdümlü)Collapses to the same value as SCONJ (BAĞLAÇ).
SCONJBAĞLAÇbağlaç (yan cümle)Collapses to the same value as CCONJ (BAĞLAÇ).
PARTİŞLEVSÖZişlev sözcüğü (mi, de, ki…)
INTJÜNLEMünlem
PUNCTNOKTALAMAnoktalama
SYMSİMGEsimge
XDİĞERdiğerForeign word, unanalysable unit.

Morphological features — UD features

Corpora built with Stanza and from UD treebanks (Reference, Wikipedia) carry these features. In a query they are written as [feats="Case=Acc"].

FeatureValueTurkish termExample
CaseNomyalın durumev
CaseAccbelirtme durumuev-i
CaseDatyönelme durumuev-e
CaseLocbulunma durumuev-de
CaseAblayrılma (çıkma) durumuev-den
CaseGenilgi (tamlayan) durumuev-in
CaseInsvasıta (araç) durumukalem-le
CaseEqueşitlik durumuçocuk-ça
NumberSingtekilkitap
NumberPlurçoğulkitap-lar
Number[psor]Singiyelik: sahibi tekilkitab-ım
Number[psor]Pluriyelik: sahibi çoğulkitab-ımız
Person11. kişigel-di-m
Person22. kişigel-di-n
Person33. kişigel-di
Person[psor]1iyelik: 1. kişiev-im
Person[psor]2iyelik: 2. kişiev-in
Person[psor]3iyelik: 3. kişiev-i
TensePastgeçmiş zamangel-di, gel-miş
TensePresşimdiki / geniş zamangel-iyor, gel-ir
TenseFutgelecek zamangel-ecek
TensePqpmiş'li geçmişin hikâyesigel-miş-ti
AspectPerftamamlanmış görünüşgel-di
AspectImptamamlanmamış görünüş
AspectProgsüreklilik görünüşügel-iyor
AspectHabalışkanlık görünüşügel-ir
AspectProspgelecek görünüşügel-ecek
AspectRapidtezlikgel-iver
MoodIndbildirme kipigel-di
MoodImpemir kipigel
MoodOptistek kipigel-e
MoodDesdilek-şart kipigel-se
MoodCndkoşul (şart) — ek-eylemgel-ir-se
MoodNecgereklilik kipigel-meli
MoodPotyeterlikgel-ebil
MoodGengenelleme / ek-eylem -DIrgel-miş-tir
MoodCndGen, DesPot, GenNec…bileşik kipler: değerler art arda okunurgel-ebil-se
EvidentFhgörülen (doğrudan bilinen)gel-di
EvidentNfhöğrenilen (dolaylı bilinen)gel-miş
PolarityPosolumlugel-di
PolarityNegolumsuzgel-me-di
VoicePassedilgen çatıyaz-ıl
VoiceCauettirgen çatıyaz-dır
VoiceRfldönüşlü çatıyıka-n
VoiceRcpişteş çatıdöv-üş
VoiceCauCau, CauPass, PassPass, PassRflbileşik çatılaryaz-dır-ıl
VerbFormFinçekimli eylemgel-di
VerbFormPartsıfat-eylem (ortaç)gel-en, gel-diğ-i
VerbFormConvzarf-eylem (ulaç)gel-ince, gel-ip
VerbFormVnounad-eylem (eylemlik)gel-mek, gel-me
PronTypePrskişi adılıben, o
PronTypeDemgöstermebu, şu
PronTypeIntsorukim, ne
PronTypeIndbelgisizbiri, hepsi
PronTypeNegolumsuzhiçbiri
PronTypeRcpişteşbirbiri
PronTypeLocyer bildirenburası
PronTypeArttanımlıkbir
NumTypeCardasıl sayıüç
NumTypeOrdsıra sayısıüçüncü
NumTypeDistüleştirme sayısıüçer
DefiniteDefbelirli
DefiniteIndbelirsizbir
DegreeCmpkarşılaştırma derecesidaha
DegreeSupüstünlük derecesien
PoliteFormsaygı (resmî) biçimsiz
PoliteInfmsamimi biçimsen
ReflexYesdönüşlülük adılıkendi
AbbrYeskısaltmaTBMM
EchoRdpikileme (yineleme)kitap mitap
TypoYesyazım yanlışı (kaynakta)
ExtPosADJ, ADV…çok sözcüklü birimin dışarıdan sözcük türü

Morphological tags — rule-based analyser

Corpora uploaded without Stanza installed carry these short tags: [feats="Poss3s"].

TagTurkish termSuffix
Plurçoğul-lAr
Poss1siyelik 1. tekil-(I)m
Poss2siyelik 2. tekil-(I)n
Poss3siyelik 3. tekil-(s)I
Poss1piyelik 1. çoğul-(I)mIz
Poss2piyelik 2. çoğul-(I)nIz
Poss3piyelik 3. çoğul-lArI
Case=Acc … Case=Equdurum ekleri (UD ile aynı)
Relilgi eki-ki
1s, 2s, 1p, 2p, 3pkişi ekleri-(I)m, -sIn, -(I)z …
Progşimdiki zaman-(I)yor
Futgelecek zaman-(y)AcAk
Pastgörülen geçmiş zaman / hikâye-DI
Evidöğrenilen geçmiş zaman / rivayet-mIş
Aorgeniş zaman-Ir, -Ar
NegAorolumsuz geniş zaman-mAz
Necgereklilik kipi-mAlI
Conddilek-şart kipi / şart-sA
Optistek kipi-(y)A
Negolumsuzluk-mA
Abilyeterlik-(y)Abil
NegAbilyeterlik olumsuzu-(y)AmA
Passedilgen çatı-Il, -In
Refldönüşlü çatı-In
Recipişteş çatı-Iş
Causettirgen çatı-DIr, -t
Copek-eylem-DIr
Infmastar-mAk
VNad-eylem-mA, -(y)Iş
PartPressıfat-eylem-(y)An
PartPastsıfat-eylem (geçmiş)-DIk, -mIş
PartFutsıfat-eylem (gelecek)-(y)AcAk
Convzarf-eylem-(y)Ip, -(y)ArAk …
Derivyapım eki

Which tags actually occur in a given corpus, and how often, is shown by the Query help panel in the app; the list is drawn from that corpus itself.

Metadata CSV

To give each document its own metadata, use a table: one row per file, one column per field. It can be added alongside the texts when uploading, or later downloaded from the Corpus summary tab, edited in Excel and uploaded again.

dosya;yil;cinsiyet;bicem;Bölgeheader row — separator ;, , or tab kose-yazisi-1.txt;1998;kadin;haber-yazili;Egeone document roman.txt;1975;Erkek;Kurgu / Edebiyat;display names are accepted too
  • File name as uploaded; letter case, Turkish letters and the extension do not matter.
  • An empty cell changes nothing. On upload the corpus-level value from the form stays; on bulk update the existing value stays. To clear a value, write - in the cell.
  • Unrecognised columns become custom fields (region, issue number, age group…), at most 5 per corpus. They can be used in filters and in subcorpus comparison.
  • Do not enter personal names. The yazar (author) column is not read; do not put identifying information in custom fields either.
  • Text type can only be set on upload; bulk updates ignore that column.

Download the sample CSV

FieldRecognised column headers
File name (required)dosya, dosya adı, dosya_adi, file, filename, file name, belge, document, text, metin
Text type (upload only)tur, tür, metin türü, metin_turu, genre, text type, texttype, type
Subject areaalan, konu alanı, konu_alani, konu, domain, topic, subject, field
Year / dateyil, yıl, year, tarih, date
Publication sourceyayın kaynağı, yayin_kaynagi, kaynak, source, publisher, yayınevi, yayin, publication
Registerbiçem, bicem, register
Register labelsbiçem etiketleri, bicem_etiketleri, alt etiketler, etiketler, tags, register tags, subregister
Speaker composition (spoken register only)konuşmacı bileşimi, konusmaci_bilesimi, konuşmacılar, speakers, speaker composition
Gendercinsiyet, gender, sex
FieldAccepted values (code — display name)
Text typehaber — Haber / gazete; akademik — Akademik metin; edebi — Edebî metin; konusma — Konuşma dökümü; sosyal-medya — Sosyal medya; resmi — Resmî / hukukî metin; ders — Ders materyali; ansiklopedi — Ansiklopedi; diger — Diğer
Registerakademik-yazili — Akademik; haber-yazili — Haberler; kurgu-yazili — Kurgu / Edebiyat; kurgu-disi-yazili — Kurgu dışı; magazin-yazili — Popüler medya; resmi-yazili — Resmî / hukuki; gunluk-sozlu — Gündelik konuşma; kurumsal-sozlu — Kurumsal konuşma
Genderbelirtilmemis — Belirtilmemiş; kadin — Kadın; erkek — Erkek; diger — Diğer

Subcorpus comparison

For keywords, a subset of this corpus can be chosen as the reference. The target is the set selected with the filters on the left. The reference is either “the rest of the corpus” or the same filter with a single field changed: with “news + female” as the target, choosing “Gender: Male” compares it with “news + male”. The distribution panel in the search view can also be broken down by any field.

Limitations

  • Analysis is automatic. The Wikipedia corpus is tagged with Stanza; lemmas, parts of speech and features contain errors. The Reference corpus comes from UD treebanks and has been checked by hand.
  • Rule-based corpora carry short tags. Corpora uploaded without Stanza use tags such as Plur and Poss3s; Number=Plur does not match there.
  • The first 300 rows are shown on screen. The number in the header is the true count for the whole corpus; export to get every row.
  • Sequences take the shortest match. With ranges such as [pos="ADJ"]{1,3} a hit starts with the shortest sequence that satisfies the pattern.