from typing import List


def assigns_mapping_category(mapping_result: List, map_evidence: str) -> str:
    """Function takes a mapping result and evidence and uses it to determine the mapping category.

    Args:
        mapping_result: A list containing mapping results for a given row. The list contains three items: uris, labels,
            evidence.
        map_evidence: A string containing the compiled mapping evidence.

    Returns:
         mapping_category: A string containing the mapping category.
    """

    if 'CONCEPT_SIMILARITY:' in map_evidence:
        if len(map_evidence.split(' | ')) > 1:
            mapping_category = 'Automatic Constructor - Concept'
        else:
            mapping_category = 'Manual Exact - Concept Similarity'
    elif any(x for x in ['ANCESTOR_CODE', 'ANCESTOR_SYNONYM', 'ANCESTOR_LABEL'] if x not in map_evidence):
        if len(mapping_result[0]) > 1:
            mapping_category = 'Automatic Constructor - Concept'
        else:
            mapping_category = 'Automatic Exact - Concept'
    elif any(x for x in ['ANCESTOR_CODE', 'ANCESTOR_SYNONYM', 'ANCESTOR_LABEL'] if x in map_evidence):
        if len(mapping_result[0]) > 1:
            mapping_category = 'Automatic Constructor - Ancestor'
        else:
            mapping_category = 'Automatic Exact - Ancestor'
    else:
        mapping_category = ''

    return mapping_category