-
Notifications
You must be signed in to change notification settings - Fork 5
text dictionary rules
This page is the ZemberekDotNet port of Java wiki page Text Dictionary Rules.
It explains dictionary-line syntax used by the Turkish lexicon loader in this repository.
Related implementation:
General format:
word [P:PRIMARY_POS,SECONDARY_POS ; A:ATTRIBUTE1,ATTRIBUTE2 ; Pr:PRONUNCIATION ; Roots:r1-r2 ; Ref:itemId ; Index:n]
Minimal examples:
kalem
okumak
Ankara
Metadata key for POS is P.
Examples:
ekşi [P:Adj]
ve [P:Conj]
bu [P:Pron,Demons]
Tdk [P:Abbrv]
… [P:Punc]
Inference rules (same intent as Java docs):
- If a lemma ends with mak or mek, loader infers Verb.
- Otherwise loader usually infers Noun.
- Capitalized lemma is treated as proper noun unless overridden.
Examples:
elma // inferred noun
okumak // inferred verb
çomak [P:Noun] // noun ending with -mak requires override
Metadata key for attributes is A.
Common examples:
bulut [A:NoVoicing]
turp [A:Voicing]
saat [A:InverseHarmony,NoVoicing]
hat [A:Doubling]
ağız [A:LastVowelDrop]
kavurmak [A:LastVowelDrop]
Frequently used attributes in dictionary lines:
- Voicing / NoVoicing
- InverseHarmony
- Doubling
- LastVowelDrop
- CompoundP3sg
- Aorist_A / Aorist_I (verbs)
- NoQuote
For compound forms with embedded possessive behavior, use CompoundP3sg and Roots.
aşevi [A:CompoundP3sg; Roots:aş-ev]
atkuyruğu [A:CompoundP3sg; Roots:at-kuyruk]
Metadata key for pronunciation is Pr.
Use this especially for abbreviations and foreign names where orthography does not provide correct Turkish phonetics.
Google [Pr:gugıl]
A101 [P:Abbrv; Pr:ayüzbir]
Multiple pronunciation workaround (using Ref and Index):
VST [P:Noun,Abbrv; Pr:viesti]
VST [P:Noun,Abbrv; Pr:vesete; Ref:VST_Noun_Abbrv; Index:2]
Based on current loader implementation:
- P: POS
- A: Attributes
- Pr: Pronunciation
- Roots: Compound roots
- Ref: Reference item
- Index: Index for alternative entries
- S: Suffix metadata (reserved/special use)
using ZemberekDotNet.Morphology.Lexicon;
using ZemberekDotNet.Morphology.Lexicon.TR;
RootLexicon lexicon = TurkishDictionaryLoader.Load(
"elma",
"okumak",
"çomak [P:Noun]",
"Google [Pr:gugıl]",
"atkuyruğu [A:CompoundP3sg; Roots:at-kuyruk]"
);DictionaryItem item = TurkishDictionaryLoader.LoadFromString("turp [A:Voicing]");RootLexicon lexicon = TurkishDictionaryLoader.Load("Resources/my-dictionary.txt");Use existing tests as canonical behavior references:
- POS inference and noun/verb behavior
- voicing and attribute handling
- pronunciation + reference/index behavior
- compound root handling
See TurkishDictionaryLoader tests.
- This page is a .NET-targeted port, so examples and method names follow C# APIs.
- Behavior is aligned with current loader implementation and tests in this repo.
- If behavior differs from Java wiki wording, implementation and tests in this repository are authoritative.
Getting Started
Module Reference
- Morphology Notes
- Additions and Release Notes
- Morphemes Reference
- Classification Training Guide
- Normalization Guide
- Proper Nouns and Named Entities
- Text Dictionary Rules
API Parity & Migration
Reference
Roadmap