def translate_script(to_translate):
    """
    translate the root paradigms in key in argument, with the function in value
    :param to_translate:
    :return:
    """
    version = DictionaryVersion(latest_dictionary_version())
    version.load()
    to_remove = []
    to_add = {
        'terms': [],
        'roots': [],
        'inhibitions': {},
        'translations': {l: {} for l in LANGUAGES}
    }

    for root, func in to_translate.items():
        root = script(root)
        terms = list(filter(lambda s: s in root, map(script, version.terms)))

        new_root = func(root)
        new_terms = [func(s) for s in terms]

        to_add['terms'].extend(map(str, new_terms))
        to_add['roots'].append(str(new_root))
        to_add['inhibitions'].update({str(new_root): version.inhibitions[root]})
        for l in LANGUAGES:
            to_add['translations'][l].update({str(func(s)): version.translations[l][s] for s in terms})

        to_remove.extend(map(str, terms))

    return create_dictionary_version(version, add=to_add, remove=to_remove)
def translate_script(to_translate):
    """
    translate the root paradigms in key in argument, with the function in value
    :param to_translate:
    :return:
    """
    version = DictionaryVersion(latest_dictionary_version())
    version.load()
    to_remove = []
    to_add = {
        'terms': [],
        'roots': [],
        'inhibitions': {},
        'translations': {l: {} for l in LANGUAGES}
    }

    for root, func in to_translate.items():
        root = script(root)
        terms = list(filter(lambda s: s in root, map(script, version.terms)))

        new_root = func(root)
        new_terms = [func(s) for s in terms]

        to_add['terms'].extend(map(str, new_terms))
        to_add['roots'].append(str(new_root))
        to_add['inhibitions'].update({str(new_root): version.inhibitions[root]})
        for l in LANGUAGES:
            to_add['translations'][l].update({str(func(s)): version.translations[l][s] for s in terms})

        to_remove.extend(map(str, terms))

    return create_dictionary_version(version, add=to_add, remove=to_remove)
def translate_script ( to_translate ) : version = DictionaryVersion ( latest_dictionary_version ( ) ) version . load ( ) to_remove = [ ] to_add = { 'terms' : [ ] , 'roots' : [ ] , 'inhibitions' : { } , 'translations' : { l : { } for l in LANGUAGES } } for root , func in to_translate . items ( ) : root = script ( root ) terms = list ( filter ( lambda s : s in root , map ( script , version . terms ) ) ) new_root = func ( root ) new_terms = [ func ( s ) for s in terms ] to_add [ 'terms' ] . extend ( map ( str , new_terms ) ) to_add [ 'roots' ] . append ( str ( new_root ) ) to_add [ 'inhibitions' ] . update ( { str ( new_root ) : version . inhibitions [ root ] } ) for l in LANGUAGES : to_add [ 'translations' ] [ l ] . update ( { str ( func ( s ) ) : version . translations [ l ] [ s ] for s in terms } ) to_remove . extend ( map ( str , terms ) ) return create_dictionary_version ( version , add = to_add , remove = to_remove )
translate the root paradigms in key in argument, with the function in value
    :param to_translate:
    :return:
translate the root paradigms in key in argument with the function in value : param to_translate : : return :