Jann/utils.py
def load_lines(fname, fields):
    """Load Cornell Movie Dialog Lines."""
    lines = {}
    with open(fname, 'r', encoding='iso-8859-1') as f:
        for line in f:
            values = line.split(" +++$+++ ")
            line_obj = {}
            for i, field in enumerate(fields):
                line_obj[field] = values[i]
            lines[line_obj['lineID']] = line_obj
    return lines
Load Cornell Movie Dialog Lines.
Load Cornell Movie Dialog Lines.
Load Cornell Movie Dialog Lines .
def load_lines(fname, fields):
    lines = {}
    with open(fname, 'r', encoding='iso-8859-1') as f:
        for line in f:
            values = line.split(" +++$+++ ")
            line_obj = {}
            for i, field in enumerate(fields):
                line_obj[field] = values[i]
            lines[line_obj['lineID']] = line_obj
    return lines
def load_lines ( fname , fields ) : lines = { } with open ( fname , 'r' , encoding = 'iso-8859-1' ) as f : for line in f : values = line . split ( " +++$+++ " ) line_obj = { } for i , field in enumerate ( fields ) : line_obj [ field ] = values [ i ] lines [ line_obj [ 'lineID' ] ] = line_obj return lines
Load Cornell Movie Dialog Lines.
Load Cornell Movie Dialog Lines .
"""Load Cornell Movie Dialog Lines."""
fname
fields