Input
- verb, a string that matches the regular expression
([a-pr-vyzıöüçğş]*[aeıioöuü][bcçdfgğhj-nprsştvyz]+|([a-pr-vyzıöüçğş]*[aeıioöuü]){2})(mak|mek)
- plural, a truthy or falsy value
- person, an integer having value either 1, 2, or 3
- tense, an integer having value either 1, 2, or 3
Output
The conjugated form of the Turkish verb verb, in personst/nd/rd person, plural if plural is TRUE
and singular if it is not, in
- If tense is 1, the simple present;
- If tense is 2, the continuing present;
- If tense is 3, the future.
Rules
Turkish verbs are conjugated in three elements, which are in order:
- The stem, formed by removing
mak
ormek
from the end of the infinitive; The sign of the tense, which is:
For the simple present:
- -r if the stem ends in a vowel;
- -ir according to vowel harmony rules (see below) if the stem contains more than one syllable (i.e. vowel), or is from one of the following irregular verbs: almak, bilmek, bulmak, durmak, gelmek, görmek, kalmak, olmak, ölmek, sanmak, vermek, varmak, vurmak;
- -er according to vowel harmony rules if the stem contains one syllable and is not listed in the irregular verbs above.
For the continuing present, -iyor, where the i changes according to vowel harmony rules. Stems that end in a vowel drop this vowel before adding this suffix, whereupon the suffix harmonizes with the next-to-last vowel in the word (guaranteed to exist by the regular expression).
- For the future:
- -ecek according to vowel harmony rules if the stem ends in a consonant;
- -yecek according to vowel harmony rules if the stem ends in a vowel.
The personal suffix to indicate the performer of the action, in all cases according to vowel harmony rules:
|Singular|Plural| |---|--------|------| |1st| -im | -iz| |2nd| -sin |-siniz| |3rd| (none) | -ler|
The final k of the future tense becomes ğ before -im and -iz, so for example
(almak, TRUE, 1, 3)
would yieldalacağız
.
Vowel harmony rules
Turkish vowels are divided into two groups: back (a ı o u
) and front (e i ö ü
) by where in the mouth they are pronounced. The suffixes of a word change vowels according to the vowels of the root.
All suffixes listed above that have i as a vowel instead use:
- -ı if the last vowel before the suffix is
ı
ora
(both these vowels are back and unrounded); - -i if the last vowel before the suffix is
i
ore
(both these vowels are front and unrounded; note here Turkish's distinction between dotted and dotless I); - -u if the last vowel before the suffix is
u
oro
(both these vowels are back and rounded); or - -ü if the last vowel before the suffix is
ü
orö
(both these vowels are front and rounded).
Take careful note of the present continuous suffix -iyor. The i
harmonizes, but the o
does not change. The personal suffixes will thus harmonize with the o
.
All the suffixes listed above that have e as a vowel instead use:
- -e if the last vowel before the suffix is a front vowel; or
- -a if the last vowel before the suffix is a back vowel.
Irregular verbs
The verbs gitmek, tatmak, ditmek, gütmek, and etmek change the final t
to a d
before any endings that begin with a vowel (which includes all the endings in this challenge). Any verb that ends in -etmek likewise changes the t
to a d
, and appends -er for the simple present (though this is not so for the other verbs).
Test cases
gütmek, FALSE, 1, 2 -> güdüyorum
almak, TRUE, 3, 3 -> alacaklar
boğmak, TRUE, 2, 1 -> boğarsınız
ölmek, FALSE, 3, 1 -> ölür
boyamak, TRUE, 1, 2 -> boyuyoruz
affetmek, FALSE, 2, 1 -> affedersin
söylemek, TRUE, 3, 1 -> söylerler
söylemek, FALSE, 3, 2 -> söylüyor
söylemek, FALSE, 1, 3 -> söyleyeceğim
-etmek
rule? \$\endgroup\$