|
|
@ -15,16 +15,18 @@ def check(str):
|
|
|
|
return False
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
consonants = [
|
|
|
|
INITIALS = [
|
|
|
|
'p', 'b', 't', 'd', 'ts', 'dz', 'k', 'g', 'kw', 'gw', 'f', 'h', 'l', 'm',
|
|
|
|
'aa', 'aai', 'aak', 'aap', 'aat', 'aau', 'ai', 'au', 'ap', 'at', 'ak', 'a',
|
|
|
|
'ng', 'n', 's', 'y', 'w', 'c', 'z', 'j'
|
|
|
|
'p', 'b', 'e', 'ts', 't', 'dz', 'd', 'kw', 'k', 'gw', 'g', 'f', 'h', 'l',
|
|
|
|
|
|
|
|
'm', 'ng', 'n', 's', 'y', 'w', 'c', 'z', 'j', 'ong', 'on', 'ou', 'oi', 'ok',
|
|
|
|
|
|
|
|
'o', 'uk', 'ung'
|
|
|
|
]
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def get_lines(canton):
|
|
|
|
def get_lines(canton):
|
|
|
|
for consonant in consonants:
|
|
|
|
for init in INITIALS:
|
|
|
|
if canton.startswith(consonant):
|
|
|
|
if canton.startswith(init):
|
|
|
|
c, v = canton[:len(consonant)], canton[len(consonant):]
|
|
|
|
c, v = canton[:len(init)], canton[len(init):]
|
|
|
|
return canton + ' ' + c + ' ' + v
|
|
|
|
return canton + ' ' + c + ' ' + v
|
|
|
|
return canton + ' ' + canton
|
|
|
|
return canton + ' ' + canton
|
|
|
|
|
|
|
|
|
|
|
@ -73,7 +75,7 @@ if __name__ == "__main__":
|
|
|
|
|
|
|
|
|
|
|
|
canton_list = canton_list.split(' ')
|
|
|
|
canton_list = canton_list.split(' ')
|
|
|
|
all_canton.extend(canton_list)
|
|
|
|
all_canton.extend(canton_list)
|
|
|
|
all_canton = set(all_canton)
|
|
|
|
all_canton = sorted(list(set(all_canton)))
|
|
|
|
|
|
|
|
|
|
|
|
with open(args.output_lexicon, 'w') as f:
|
|
|
|
with open(args.output_lexicon, 'w') as f:
|
|
|
|
for canton in all_canton:
|
|
|
|
for canton in all_canton:
|
|
|
|