def read_sym_table(sym_table_path: str) -> dict:
    """Read in a kaldi style symbol table.

    Each line in the symbol table file is "sym  index", separated by a
    whitespace.

    Args:
        sym_table_path: Path to the symbol table file.

    Returns:
        sym_table: A dictionary whose keys are symbols and values are indices.
    """
    sym_table = {}
    with open(sym_table_path, 'r') as reader:
        for each_line in reader:
            key, val = each_line.split()
            val = int(val)
            if key not in sym_table:
                sym_table[key] = val
            else:
                raise ValueError("Duplicated key: %s", key)
    return sym_table