def file_parser(file):
    """Reads the data from file and stores it in a easily usable format

    Args:
        file (.tsv file): file which contains the native script words(target), romanization lexicons(source)
        and frequency of attestation of each romanization lexicon(count)

    Returns:
        dict: Dictionary where each entry is as follows
        native_script_word : [(romanized_word_1, count_1),(romanized_word_2, count_2),....] list of all possible
        romanized words and their counts

    """
    data = {}
    with open(file, "r", encoding="utf-8") as f:
        for line in f:
            target, source, count = line.strip().split("\t")
            try:
                data[target].append((source, int(count)))
            except:
                data[target] = [(source, int(count))]
    return data