[tex-hyphen] extending `hyph-zh-latn-pinyin.tex'
Mojca Miklavec
mojca.miklavec.lists at gmail.com
Fri Nov 23 23:32:11 CET 2018
On Thu, 22 Nov 2018 at 09:44, Werner LEMBERG wrote:
>
> > But I would create a simple script in any programming language (lua,
> > ruby, python, ...) and generate two pattern files out of it.
>
> Not necessary – the stuff is so simple, and the number of syllables is
> closed which means there won't be any changes except bug fixes. A
> simple search and replace did the job in a few minutes; see attached
> file.
I still find it useful to have a level of abstraction, *in particular*
when the rules are really simple. This is what is done in Turkish for
example (it's not a complete set of patterns):
vowels = %w{a â e ı i î o ö u ü û}
consonants = %w{b c ç d f g ğ h j k l m n p r s ş t v y z}
vowels.each do |vowel|
puts "2#{vowel}1"
end
consonants.each do |cons|
puts "1#{cons}1"
end
consonants.each do |c1|
consonants.each do |c2|
puts "2#{c1}#{c2}"
end
end
I'm not saying that it has to be done, just that it is nice to have
something like this. (It's really easy to make a typo when assembling
such a list manually.)
Mojca
More information about the tex-hyphen
mailing list