def load_names(names_dmp):
    """Load scientific names of species from NCBI taxdump names.dmp file."""
    names = {}
    synonym = {}
    with open(names_dmp) as handle:
        for line in handle:
            parts = line.split('\t|\t', 3)
            taxid = int(parts[0].strip())
            name = parts[1].strip()
            if line.endswith('\t|\tscientific name\t|\n'):
                names[taxid] = name
            elif line.endswith('\t|\tsynonym\t|\n') or line.endswith(
                '\t|\tincludes\t|\n'):
                try:
                    synonym[taxid].append(name)
                except KeyError:
                    synonym[taxid] = [name]
    return names, synonym
