Skip to content

Commit

Permalink
Fixed IPA conversion of ik, ing, ong
Browse files Browse the repository at this point in the history
  • Loading branch information
andreihar committed Jan 3, 2024
1 parent 347db4e commit d3dec16
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions taibun/taibun.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,9 @@ def __tailo_to_ti(self, input):
# Helper to convert syllable from Tai-lo to International Phonetic Alphabet
def __tailo_to_ipa(self, input):
convert = {
'iann':'iã','ainn':'ãi','iang':'iaŋ','jian':'dʑiɛn','jiat':'dʑiɛt','tshi':'tɕʰi','nng':'nŋ',
'tsing':'tɕiɪŋ','jiang':'dʑiaŋ','tshing':'tɕʰiɪŋ','tsik':'tɕiɪk','tshik':'tɕʰiɪk',
'jian':'dʑiɛn','jiat':'dʑiɛt','tshi':'tɕʰi',
'iann':'iã','ainn':'ãi','iang':'iaŋ','nng':'nŋ',
'mia':'miã','mui':'muĩ','mue':'muẽ','mua':'muã','ma':'mã','me':'mẽ','mi':'mĩ','moo':'mɔ̃', # m nasalisation
'nia':'niã','nua':'nuã','na':'nã','ne':'nẽ','ni':'nĩ','noo':'nɔ̃', # n nasalisation
'ngia':'ŋiã','ngiu':'ŋiũ','nga':'ŋã','nge':'ŋẽ','ngi':'ŋĩ','ngoo':'ŋɔ̃', # ng nasalisation
Expand All @@ -341,7 +343,7 @@ def __tailo_to_ipa(self, input):
nt = self.__replacement_tool(convert, nt).replace(self.suffix_token, '')
if 'ŋ' in nt:
if len(nt) > 2:
if all(c.lower() not in 'aeiou' for c in nt[:nt.index('ŋ')]) and nt.index('ŋ') != 0:
if all(c.lower() not in 'aeioɔu' for c in nt[:nt.index('ŋ')]) and nt.index('ŋ') != 0:
nt = nt.replace('ŋ', 'ŋ̍')
elif len(nt) == 2:
nt = nt.replace('ŋ', 'ŋ̍')
Expand Down

0 comments on commit d3dec16

Please sign in to comment.