-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Josef Fruehwald edited this page Mar 16, 2023
·
1 revision
Figure out how to re-write the basic conversion from CMU to Trager-Labov in just python #1
def recode(phone: SequenceInterval) -> str:
...
a.label == “AO1”
a.label = recode(a)
a.label == “oh”
Figure out how to encapsulate the logic from step 1 within a dictionary.
def recode(
phone : SequenceInterval,
recode_logic : dict
) -> str :
...
a.label == “AO1”
a.label = recode(a, recode_logic = cmu2labov)
a.label == “oh”
Parse an external yaml file to be the recode logic.
def parse_recode_yaml(recode_yaml: str) -> dict:
...
def recode(
phone: SequenceInterval,
recode_logic: dict
) -> str:
...
cmu2labov = parse_recode_yaml(“cmu2labov.yml”)
a.label == “AO1”
a.label = recode(a, recode_logic = cmu2labov)
a.label == “oh”