from typing import Dict


def parse(filename: str) -> Dict[str, Dict[str, int]]:
    """
    Parse a TSV-separated expansion standard into a dictionary.

    :param filename:
    :return: A dictionary with acronyms pointing to expansions and an assessment value.
    """
    file = open(filename, "r", encoding="utf-8")

    expansion_standard = {}  # type: Dict[str, Dict[str, int]]
    for row in file:
        fields = row.split("\t")
        acronym = fields[0].strip()
        # fields[0] = "Q0" (NOOP)
        expansion = fields[2].strip()
        relevance = int(fields[3].strip())

        # Initialize sub-dict
        if acronym not in expansion_standard:
            expansion_standard[acronym] = {}

        expansion_standard[acronym].update({expansion: relevance})

    file.close()
    return expansion_standard