Esempio n. 1
0
 def test_transcriber_probert(self):
     """Test Attic Greek IPA transcription via Probert reconstruction."""
     transcriber = grc.Transcriber("Attic", "Probert").transcribe
     transcription = [transcriber(x) for x in
         [unicodedata.normalize('NFC', y) for y in
         ["ῥάξ", "εἰργασμένον", "φόρμιγξ", "γιγνώσκω"]]]
     target = [unicodedata.normalize('NFC', y) for y in
         ["[r̥ɑ́ks]", "[ẹːr.gɑz.mé.non]", "[pʰór.miŋks]", "[giŋ.nɔ́ːs.kɔː]"]]
     self.assertEqual(transcription, target)
Esempio n. 2
0
 def test_greek_prep_text(self):
     """Test the Transcriber class's `_prep_text` in Greek."""
     inputs = ["λείπειν", "ὕπνῳ"]
     transcriber = grc.Transcriber("Attic", "Probert")
     outputs = [transcriber._prep_text(w) for w in inputs]
     target = [[('λ', '', ''), ('ει', '́', ''), ('π', '', ''),
                     ('ει', '', ''), ('ν', '', '')],
                 [('h', '', ''), ('υ', '́', ''), ('π', '', ''),
                     ('ν', '', ''), ('ωι', '', '̄')]]
     self.assertEqual(outputs, target)
Esempio n. 3
0
 def test_greek_parse_diacritics(self):
     """Test the Transcriber class's `_parse_diacritics` in Greek."""
     inputs = ["ἄ", "Φ", "ῷ", "ὑ", "ϊ", "ῑ"]
     transcriber = grc.Transcriber("Attic", "Probert")
     outputs = [transcriber._parse_diacritics(char) for char in inputs]
     target = [unicodedata.normalize('NFC', c) for c in
         ["α/" + grc.chars.ACUTE + "//",
         "φ///", "ω/" + grc.chars.CIRCUMFLEX + "/"
         + grc.chars.IOTA_SUBSCRIPT + "/", "h///υ///",
         "ι//" + grc.chars.DIAERESIS + "/", "ι//" + grc.chars.LONG + "/"]]
     self.assertEqual(outputs, target)
Esempio n. 4
0
 def setUpClass(self):
     self.greek_transcriber = grc.Transcriber("Attic", "Probert")
     self.latin_transcriber = lat.Transcriber("Classical", "Allen")
Esempio n. 5
0
 def setUpClass(cls):
     cls.greek_transcriber = grc.Transcriber("Attic", "Probert")
     cls.latin_transcriber = lat.Transcriber("Classical", "Allen")