(fileName,
              fields=["lineID", "characterID", "movieID", "character", "text"],
              delimiter=" +++$+++ ")
return lines
Args:
        fileName (str): file to load
        field (set<str>): fields to extract
    Return:
        dict<dict<str>>: the extracted fields for each line
Args:
        fileName (str): file to load
        field (set<str>): fields to extract
    Return:
        dict<dict<str>>: the extracted fields for each line
Args : fileName ( str ) : file to load field ( set<str > ) : fields to extract Return : dict<dict<str >> : the extracted fields for each line
def loadLines(fileName,
              fields=["lineID", "characterID", "movieID", "character", "text"],
              delimiter=" +++$+++ "):
    """
    Args:
        fileName (str): file to load
        field (set<str>): fields to extract
    Return:
        dict<dict<str>>: the extracted fields for each line
    """
    lines = {}

    with open(fileName, 'r', encoding='iso-8859-1') as f:
        for line in f:
            values = line.split(delimiter)

            # Extract fields
            lineObj = {}
            for i, field in enumerate(fields):
                lineObj[field] = values[i]

            lines[lineObj['lineID']] = lineObj

    return lines
def loadLines ( fileName , fields = [ "lineID" , "characterID" , "movieID" , "character" , "text" ] , delimiter = " +++$+++ " ) : lines = { } with open ( fileName , 'r' , encoding = 'iso-8859-1' ) as f : for line in f : values = line . split ( delimiter ) # Extract fields lineObj = { } for i , field in enumerate ( fields ) : lineObj [ field ] = values [ i ] lines [ lineObj [ 'lineID' ] ] = lineObj return lines