deepmorpheus/util.py
def readable_conversion_file(url):
    """Reads the provided url as a conversion file"""
    conversion_dict = []
    with open(url, 'r', encoding='utf-8') as f:
        lines = f.readlines()
        assert len(lines) == 9, "The conversion file must have exactly 9 lines detailing the 9 conversion categories"

        for line in lines:
            category_dict = {}
            for part in line.split(","):
                key, value = [subpart.strip() for subpart in part.split(':')]
                category_dict[key] = value
            conversion_dict.append(category_dict)
    return conversion_dict
Reads the provided url as a conversion file
Reads the provided url as a conversion file
Reads the provided url as a conversion file
def readable_conversion_file(url):
    conversion_dict = []
    with open(url, 'r', encoding='utf-8') as f:
        lines = f.readlines()
        assert len(lines) == 9, "The conversion file must have exactly 9 lines detailing the 9 conversion categories"
        for line in lines:
            category_dict = {}
            for part in line.split(","):
                key, value = [subpart.strip() for subpart in part.split(':')]
                category_dict[key] = value
            conversion_dict.append(category_dict)
    return conversion_dict
def readable_conversion_file ( url ) : conversion_dict = [ ] with open ( url , 'r' , encoding = 'utf-8' ) as f : lines = f . readlines ( ) assert len ( lines ) == 9 , "The conversion file must have exactly 9 lines detailing the 9 conversion categories" for line in lines : category_dict = { } for part in line . split ( "," ) : key , value = [ subpart . strip ( ) for subpart in part . split ( ':' ) ] category_dict [ key ] = value conversion_dict . append ( category_dict ) return conversion_dict
Reads the provided url as a conversion file
Reads the provided url as a conversion file
"""Reads the provided url as a conversion file"""
url