Ejemplo n.º 1
0
def _ITRANSToSLP1StateMachine():
  table = _AlphabetToSLP1(_ITRANS_ALPHABET)
  alternatives = [('aa', 'A'), ('ii', 'I'), ('uu', 'U'), ('RRi', 'R^i'),
                  ('RRI', 'R^I'), ('LLi', 'L^i'), ('LLI', 'L^I'),
                  ('~N', 'N^'), ('~n', 'JN'), ('v', 'w')]
  for (letter, alternative) in alternatives:
    table[alternative] = table[letter]
  return transliterator.MakeStateMachine(table)
Ejemplo n.º 2
0
def _IASTToSLP1StateMachine():
  """Transliteration table from IAST to SLP1."""
  lower = _AlphabetToSLP1(_IAST_ALPHABET_LOWER)
  upper = _AlphabetToSLP1(_IAST_ALPHABET_UPPER)
  lower.update(upper)
  return transliterator.MakeStateMachine(lower)
Ejemplo n.º 3
0
  return dict(zip(alphabet, slp1.ALPHABET))


def _SLP1ToAlphabet(alphabet):
  return dict(zip(slp1.ALPHABET, alphabet))


_HK_ALPHABET = (list('aAiIuUR') + ['RR', 'lR', 'lRR', 'e', 'ai', 'o', 'au'] +
                ['M', 'H',
                 'k', 'kh', 'g', 'gh', 'G',
                 'c', 'ch', 'j', 'jh', 'J',
                 'T', 'Th', 'D', 'Dh', 'N',
                 't', 'th', 'd', 'dh', 'n',
                 'p', 'ph', 'b', 'bh', 'm'] +
                list('yrlvzSsh'))
_HK_TO_SLP1_STATE_MACHINE = transliterator.MakeStateMachine(
    _AlphabetToSLP1(_HK_ALPHABET))


_IAST_ALPHABET_LOWER = (list('aāiīuūṛṝḷḹe') + ['ai', 'o', 'au', 'ṃ', 'ḥ'] +
                        ['k', 'kh', 'g', 'gh', 'ṅ',
                         'c', 'ch', 'j', 'jh', 'ñ',
                         'ṭ', 'ṭh', 'ḍ', 'ḍh', 'ṇ',
                         't', 'th', 'd', 'dh', 'n',
                         'p', 'ph', 'b', 'bh', 'm',
                         'y', 'r', 'l', 'v', 'ś', 'ṣ', 's', 'h'])
_IAST_ALPHABET_UPPER = (list('AĀIĪUŪṚṜḶḸE') + ['AI', 'O', 'AU', 'Ṃ', 'Ḥ'] +
                        ['K', 'Kh', 'G', 'Gh', 'Ṅ',
                         'C', 'Ch', 'J', 'Jh', 'Ñ',
                         'Ṭ', 'Ṭh', 'Ḍ', 'Ḍh', 'Ṇ',
                         'T', 'Th', 'D', 'Dh', 'N',
                         'P', 'Ph', 'B', 'Bh', 'M',