def _read_ncbitaxonomy_file(filename):
    """ A generic function to read an NCBI taxonomy file, which is delimited
    by '\t|\t?'.

    Parameters
    ----------
    filename : str
        Path to a file from an NCBI taxonomy dump.

    Returns
    -------
    A dict. Key = first field of file, Value = second field of file.

    Raises
    ------
    ValueError
        If IDs of entries cannot be converted into int.
    """
    entries = {}
    file = open(filename, 'r')
    for line in file:
        fields = list(map(str.strip, line.split('|')))
        entries[fields[0]] = fields[1]

    file.close()
    return entries