def get_edit_scripts(pron_a, pron_b, edit_costs=(1.0, 1.0, 1.0)):
    """Get the edit scripts to transform between two given pronunciations.

    :param pron_a: Source pronunciation as list of strings, each string corresponding to a phoneme
    :param pron_b: Target pronunciation as list of strings, each string corresponding to a phoneme
    :param edit_costs: Costs of insert, replace and delete respectively
    :return: List of edit scripts.  Each edit script is represented as a list of operations,
                where each operation is a dictionary.
    """
    op_costs = {'insert': lambda x: edit_costs[0],
                'match': lambda x, y: 0 if x == y else edit_costs[1],
                'delete': lambda x: edit_costs[2]}

    distance, scripts, costs, ops = edit_distance.best_transforms(pron_a, pron_b, op_costs=op_costs)

    return [full_edit_script(script.to_primitive()) for script in scripts]
def get_edit_scripts ( pron_a , pron_b , edit_costs = ( 1.0 , 1.0 , 1.0 ) ) : op_costs = { 'insert' : lambda x : edit_costs [ 0 ] , 'match' : lambda x , y : 0 if x == y else edit_costs [ 1 ] , 'delete' : lambda x : edit_costs [ 2 ] } distance , scripts , costs , ops = edit_distance . best_transforms ( pron_a , pron_b , op_costs = op_costs ) return [ full_edit_script ( script . to_primitive ( ) ) for script in scripts ]
Get the edit scripts to transform between two given pronunciations.

    :param pron_a: Source pronunciation as list of strings, each string corresponding to a phoneme
    :param pron_b: Target pronunciation as list of strings, each string corresponding to a phoneme
    :param edit_costs: Costs of insert, replace and delete respectively
    :return: List of edit scripts.  Each edit script is represented as a list of operations,
                where each operation is a dictionary.