import csv


def openfile(filename,separator=";"):
    """ Opens a csv file and returns a dict. """
    
    output = []
    fieldnames = ["word","document","coldoc","page","line","wordnr", "type"]
    with open(filename, newline='', encoding="utf-8") as csvfile:
        data = csv.DictReader(csvfile, fieldnames=fieldnames, delimiter=";", quotechar='"')
        for item in data:
            output.append(item)

    return output