1 # © 2016 and later: Unicode, Inc. and others.
2 # License & terms of use: http://www.unicode.org/copyright.html#License
4 # File: Grek_Latn_UNGEGN.txt
8 # For modern Greek, based on UNGEGN rules.
9 # Rules are predicated on running NFD first, and NFC afterwards
10 # MINIMAL FILTER GENERATED FOR: Greek-Latin/UNGEGN
11 # WARNING: need to add accents to both filters ###
12 # :: [\u0301\u0304\u0306\u0308;µ·ÀÂÈÊÌÎÒÔÙÛàâèêìîòôùûĈ-ĉĜ-ĝĤ-ĥĴ-ĵŜ-ŝŴ-ŷǛ-ǜǸ-ǹ\u0300\u0302\u0313-\u0314\u0340\u0342-\u0343\u0345ͺ;Ά-ΊΌΎ-ΡΣ-ώϐ-ϖϰ-ϵЀЍѐѝḔ-ḕṐ-ṑẀ-ẁẐ-ẑẤ-ậẰ-ằẾ-ệỐ-ộỜ-ờỪ-ừỲ-ỳἀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼι῁-ῄῆ-῍῏-ΐῖ-Ί῝῟-῭ῲ-ῴῶ-ῼΩϷ-\u07FBϹ] ;
13 :: [[[:Greek:][:Mn:][:Me:]] [\:-;?·;·]] ;
16 $lower = [[:latin:][:greek:] & [:Ll:]] ;
17 $upper = [[:latin:][:greek:] & [:Lu:]] ;
18 $accent = [[:Mn:][:Me:]] ;
21 $lcgvowel = [αεηιουω] ;
22 $ucgvowel = [ΑΕΗΙΟΥΩ] ;
23 $gvowel = [$lcgvowel $ucgvowel] ;
24 $lcgvowelC = [$lcgvowel $accent] ;
25 $evowel = [aeiouyAEIOUY];
26 $vowel = [ $evowel $gvowel] ;
27 $beforeLower = $accent * $lower ;
28 $gammaLike = [ΓΚΞΧγκξχϰ] ;
29 $egammaLike = [GKXCgkxc] ;
33 $softener = [βΒγΓδΔζΖλΛμΜνΝρΡ$gvowel] ;
36 $afterLetter = [:L:] [\'$accent]* ;
37 $beforeLetter = [\'$accent]* [:L:] ;
44 # Fix any ancient characters that creep in
52 # need to have these up here so the rules don't mask
55 Ψ } $beforeLower ↔ Ps ;
60 # at begining or end of word, convert mp to b
61 [^[:L:]$accent] { μπ → b ;
62 μπ } [^[:L:]$accent] → b ;
63 [^[:L:]$accent] { [Μμ][Ππ] → B ;
64 [Μμ][Ππ] } [^[:L:]$accent] → B ;
66 Μπ ← B } $beforeLower ;
68 # handle diphthongs ending with upsilon
73 $fmaker = [aeiAEI] $under ? ;
74 $shiftForwardVowels = [[:Mn:]-[\u0308]]; # note: a diaeresis keeps the items separate
75 $fmaker { υ ( $shiftForwardVowels )* } $softener → $1 v $under ;
76 υ $1 ← ( $shiftForwardVowels )* v $under ;
77 $fmaker { υ ( $shiftForwardVowels )* } → $1 f $under;
78 υ $1 ← ( $shiftForwardVowels )* f $under ;
79 $fmaker { Υ } $softener ↔ V $under ;
80 $fmaker { Υ ↔ U $under ;
88 γ } $gammaLike ↔ n } $egammaLike ;
90 Γ } $gammaLike ↔ N } $egammaLike ;
99 Θ } $beforeLower ↔ Th ;
109 ν } $gammaLike → n\' ;
111 Ν } $gammaLike ↔ N\' ;
121 # insert separator before things that turn into s
122 [Pp] { } [ςσΣϷϸϺϻ] → \' ;
124 Ϸ ↔ S\u030C ; # Ϸ GREEK CAPITAL LETTER SHO Uppercase_Letter Grek - L
125 ϸ ↔ s\u030C ; #ϸ GREEK SMALL LETTER SHO Lowercase_Letter Grek - L
126 Ϻ ↔ S\u0302 ; # Ϻ GREEK CAPITAL LETTER SAN Uppercase_Letter Grek - L
127 ϻ ↔ s\u0302 ; # ϻ GREEK SMALL LETTER SAN Lowercase_Letter Grek - L
128 # Caron means exception
129 # before a letter, initial
130 ς } $beforeLetter ↔ s $under } $beforeLetter;
131 σ } $beforeLetter ↔ s } $beforeLetter;
132 # otherwise, after a letter = final
133 $afterLetter { σ ↔ $afterLetter { s $under;
134 $afterLetter { ς ↔ $afterLetter { s ;
135 # otherwise (isolated) = initial
145 Χ } $beforeLower ↔ Ch ;
147 # Completeness for ASCII
148 # $ignore = [[:Mark:]''] * ;
165 # Completeness for Greek
174 Ϲ → | Σ; #U+03F9 GREEK CAPITAL LUNATE SIGMA SYMBOL
179 # delete any trailing ' marks used for roundtripping
181 ← [Νν] { \' } $egammaLike ;
183 # MINIMAL FILTER GENERATED FOR: Latin-Greek/UNGEGN BACKWARD
184 :: ([[[:Latin:][:Mn:][:Me:]] ['\:?]]) ;