4

In English, the genitive suffix ’s never changes its shape. For example, the genitive suffix ’s does not change its shape in the expressions Alice’s bicycle or Frank’s bicycle. In Turkish, however, the genitive suffix ’{n}{i}n changes its shape, where {n} is a variable depending on the last letter of the word to which the genitive suffix is added, and {i} is another variable depending on the vowel in the last syllable of the word to which the genitive suffix is added.

Here are some examples:

  • Ezgi’{n}{i}n -> Ezgi’nin [Ezgi's]

  • Sıtkı’{n}{i}n -> Sıtkı’nın [Sıtkı's]

  • Utku’{n}{i}n -> Utku’nun [Utku's]

  • Hüsnü’{n}{i}n -> Hüsnü’nün [Hüsnü’s]

  • Nefel’{n}{i}n -> Nefel’in [Nefel's]

  • Anıl’{n}{i}n -> Anıl’ın [Anıl's]

  • Ufuk’{n}{i}n -> Ufuk’un [Ufuk's]

  • Gönül’{n}{i}n -> Gönül’ün [Gönül's]

Imagine a \trgenitive command which is attached to a TURKISHWORD like so TURKISHWORD\trgenitive, and which prints TURKISKWORD’{n}{i}n, such that:

  1. if the last letter of TURKISHWORD is a consonant, then {n} is nothing/empty
  2. if the last letter of TURKISHWORD is a vowel, then {n} is n
  3. if the last vowel of TURKISHWORD is i or e, then {i} is i
  4. if the last vowel of TURKISHWORD is ı, then {i} is ı
  5. if the last vowel of TURKISHWORD is u, then {i} is u
  6. if the last vowel of TURKISHWORD is ü or ö, then {i} is ü.

Is it possible to define such a \trgenitive command?

Kutt
  • 363
  • 1
    It would be easier to define such a command if TURKISHWORD is the argument: \trgenitive{TURKISHWORD}. Would that be a possibility? – Teepeemm Oct 15 '19 at 21:00
  • This is not possible in pdflatex; perhaps some LuaTeX trickery can do. With \trgen{word} it can be done in XeLaTeX. – egreg Oct 15 '19 at 21:13

1 Answers1

7

You can perhaps implement the proposed postfix syntax with LuaTeX.

With either XeLaTeX or LuaLaTeX, the following prefix syntax works:

\documentclass{article}
\usepackage{xparse}
\usepackage{fontspec}

\ExplSyntaxOn

\NewDocumentCommand{\trgen}{m}
 {
  #1' \kutt_trgen:n { #1 }
 }

\prg_generate_conditional_variant:Nnn \tl_if_in:nn { ne } { T,F,TF }

\tl_new:N \l__kutt_trgen_word_tl

\cs_new_protected:Nn \kutt_trgen:n
 {
  \tl_if_in:neT {aeıioöuü} { \tl_item:nn { #1 } { -1 } } { n }
  \__kutt_trgen_vowel:n { #1 } n
 }

\cs_new_protected:Nn \__kutt_trgen_vowel:n
 {
  \tl_set:Nn \l__kutt_trgen_word_tl { #1 }
  \regex_replace_all:nnN { [^aeıioöuü] } { } \l__kutt_trgen_word_tl
  \str_case_e:nn { \tl_item:Nn \l__kutt_trgen_word_tl { -1 } }
   {
    {i}{i}
    {e}{i}
    {a}{ı}
    {ı}{ı}
    {u}{u}
    {ö}{ü}
    {ü}{ü}
   }
 }

\ExplSyntaxOff

\begin{document}

\trgen{Ezgi}\par
\trgen{Sıtkı}\par
\trgen{Utku}\par
\trgen{Hüsnü}\par
\trgen{Nefel}\par
\trgen{Anıl}\par
\trgen{Ufuk}\par
\trgen{Gönül}\par

\end{document}

The idea is to first check whether the last letter in the argument is a vowel; after the word and the apostrophe, an “n” is printed, otherwise nothing. Then the word is stripped of its consonants and a case switch is applied to the last remaining item (which is a vowel).

enter image description here

egreg
  • 1,121,712
  • Thank you very much for your answer. The postfix syntax is not mandatory and the prefix syntax is just fine. I need to spend some time to understand the code though. – Kutt Oct 16 '19 at 12:25
  • @Kutt Can the last vowel be “a”? – egreg Oct 16 '19 at 12:37
  • Yes, the last vowel can be "a". For example: Hasan’{n}{i}n -> Hasan’ın [Hasan's]. So I should have said: "4. if the last vowel of TURKISHWORD is a or ı, then {i} is ı" – Kutt Oct 16 '19 at 12:44
  • @Kutt I added the missing case (code only). The delights of vowel harmony! :-) – egreg Oct 16 '19 at 14:06
  • A very clever solution. And many linguistic accounts of vowel harmony treat consonants and vowels on separate tiers of representation, which is effectively what your second step does. – Alan Munn Oct 16 '19 at 17:05