blob: 133f5e0554498b94e1b984b4168cdd457b5e779b [file] [log] [blame]
// Copyright (C) 1999, International Business Machines
// Corporation and others. All Rights Reserved.
// Date Name Description
// 11/17/99 aliu Creation.
// Latin-Greek
lgreek {
Rule {
// ==============================================
// Modern Greek Transliteration Rules
// This transliterates modern Greek characters, but using rules
// that are traditional for Ancient Greek, and
// thus more resemble Greek words that have become part
// of English. It differs from the official Greek
// transliteration, which is more phonetic (since
// most modern Greek vowels, for example, have
// degenerated simply to sound like "ee").
// There are only a few tricky parts.
// 1. eta and omega don't map directly to Latin vowels,
// so we use a macron on e and o, and some
// other combinations if they are accented.
// 2. The accented, diaeresis i and y are substituted too.
// 3. Some letters use digraphs, like "ph". While typical,
// they need some special handling.
// 4. A gamma before a gamma or a few other letters is
// transliterated as an "n", as in "Anglo"
// 5. An ypsilon after a vowel is a "u", as in
// "Mouseio". Otherwise it is a "y" as in "Physikon"
// 6. The construction of the rules is made simpler by making sure
// that most rules for lowercase letters exactly correspond to the
// rules for uppercase letters, *except* for the case of the letters
// in the rule itself. That way, after modifying the uppercase rules,
// you can just copy, paste, and "set to lowercase" to get
// the rules for lowercase letters!
// ==============================================
// ==============================================
// Variables, used to make the rules more comprehensible
// and for conditionals.
// ==============================================
// Latin Letters
//! // with real accents.
//! + "E-MACRON-ACUTE=\u0112\u0301;"
//! + "e-macron-acute=\u0113\u0301;"
//! + "O-MACRON-ACUTE=\u014C\u0301;"
//! + "o-macron-acute=\u014D\u0301;"
//! + "y-umlaut-acute=\u00FF\u0301;"
//! + "\u00ef-acute=\u00ef\u0301;"
//! + "\u00fc-acute=\u00fc\u0301;"
//! //
// single letter equivalents
// Greek Letters
// Variables for conditional mappings
// Use lowercase for all variable names, to allow cut/paste below.
// ==============================================
// Rules
// ==============================================
// The following are special titlecases, and should
// not be copied when duplicating the lowercase
// ==============================================
"Th <> {THETA}({lower};"
"Ph <> {PHI}({lower};"
"Ch <> {CHI}({lower};"
//masked: + "Ps<{PHI}({lower};"
// Because there is no uppercase forms for final sigma,
// we had to move all the sigma rules up here.
// Remember to insert ' to preserve round trip, for double letters
// don't need to do this for the digraphs with h,
// since it is not created when mapping back from greek
// use special form for s
"''S <> ({pp}) {SIGMA} ;" // handle PS
"S <> {SIGMA};"
// The following are a bit tricky. 's' takes two forms in greek
// final or non final.
// We use ~s to represent the abnormal form: final before letter
// or non-final before non-letter.
// We use 's to separate p and s (otherwise ps is one letter)
// so, we break out the following forms:
"''s < ({pp}) {sigma} ({letter});"
"s < {sigma} ({letter});"
"~s < {sigma} ;"
"~s < {sigma+} ({letter});"
"''s < ({pp}) {sigma+} ;"
"s < {sigma+} ;"
"~s ({letter}) > {sigma+};"
"~s > {sigma};"
"''s ({letter}) > {sigma};"
"''s > {sigma+};"
"s ({letter}) > {sigma};"
"s > {sigma+};"
// because there are no uppercase forms, had to move these up too.
"{\u00ef-acute} <> {iota_diaeresis+};"
"{\u00fc-acute} <> {vowel}){ypsilon_diaeresis+};"
"{y-umlaut-acute} <> {ypsilon_diaeresis+};"
// ==============================================
// Uppercase Forms.
// To make lowercase forms, just copy and lowercase below
// ==============================================
// Typing variants, in case the keyboard doesn't have accents
// Basic Letters
"N ({n-gamma}) <> {GAMMA} ({gamma-n});"
"''E <> ([Ee]){EPSILON};" // handle EE
"N'' <> {NU} ({gamma-n});"
"''O <> ([Oo]) {OMICRON};" // handle OO
"PH<>{PHI};" // needs ordering before P
"PS<>{PSI};" // needs ordering before P
"U <> ({vowel}) {YPSILON};"
"\u00da <> ({vowel}) {YPSILON+};"
"\u00dc <> ({vowel}) {YPSILON_DIAERESIS};"
// Extra English Letters. Mapped for completeness
// ==============================================
// Lowercase Forms. Just copy above and lowercase
// ==============================================
// typing variants, in case the keyboard doesn't have accents
// basic letters
"n ({n-gamma}) <> {gamma} ({gamma-n});"
"''e <> ([Ee]){epsilon};" // handle EE
"n'' <> {nu} ({gamma-n});"
"''o <> ([Oo]) {omicron};" // handle OO
"ph<>{phi};" // needs ordering before p
"ps<>{psi};" // needs ordering before p
"u <> ({vowel}){ypsilon};"
"\u00fa <> ({vowel}){ypsilon+};"
"\u00fc <> ({vowel}){ypsilon_diaeresis};"
// extra english letters. mapped for completeness
// ====================================
// Normal final rule: remove '
// ====================================
//+ "''>;"