[tex-hyphen] extending `hyph-zh-latn-pinyin.tex'

Arthur Reutenauer arthur.reutenauer at normalesup.org
Sat Nov 24 10:51:21 CET 2018


On Fri, Nov 23, 2018 at 11:32:11PM +0100, Mojca Miklavec wrote:
> I still find it useful to have a level of abstraction, *in particular*
> when the rules are really simple.

  I agree, and I think they should be expressed in terms of context-free
grammar, for example for Turkish

> 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

  V -> a | â | e | ı | i | î | o | ö | u | ü | û
  C -> b | c | ç | d | y | g | ğ | h | j | k | l | m | n | p | r | s | ş | t | v | y | z
  S -> 2V1 | 1C1 | 2CC

  There is a Python library that can interpret that syntax directly.
I’ve already written a small script for Turkish in one of our
“lost” repositories.

	Best,

		Arthur


More information about the tex-hyphen mailing list