I want to set an automatic hyphenation for the Armenian word յանդգնել in XeLaTeX with \discretionary. The problem is, that there are four consonants in a row, and the Armenian language has very strange (for English speakers) rules about hyphenating such words. That word can hyphenated in two ways: յան֊դըգնել and յանդըգ֊նել, in both of them the letter ը reappears where it sounds. This can be correctly achieved with
յան\h{֊}{դըգ}{դ\h{ըգ֊}{}{գ}}նել
,
where I've defined \h
as
\newcommand{\h}[3]{\discretionary{#1}{#2}{#3}}
,
but there are nested \h
-s here, so it gives an error
Improper discretionary list. ... յան\h{֊}{դըգ}{դ\h{ըգ֊}{}{գ}}
and the compiler (XeLaTex) just removes the second \h
where it is needed.
I've found nothing about this topic in the Internet, and, unfortunately, there is no automatic hyphenation package for the Armenian language. What's wrong in nested \discretionary
-ies?
P.S. Armenian uses another sign for hyphenation (a slightly curved ֊, not -), so I need to use \discretionary
anyway.
\hyphenchar
will not help. When the word is hyphenated, ը reappears in դըգ syllable, regardless of whether it is after or before the hyphenation sign, but when it is not, that ը is not written. Just redefining will not control ը.