import copy


def _normalize_annotation(annotation, tag_index):
    """
	Normalize the annotation anchorStart and anchorEnd,
	in the sense that we start to count the position
	from the beginning of the sentence
	and not from the beginning of the disambiguated page.
	:param annotation: Annotation object
	:param tag_index: start index (int)
	:return: a new Annotation object
	"""
    # norm_annotation = copy.deepcopy(annotation)
    norm_annotation = annotation
    norm_annotation.anchorStart = int(annotation.anchorStart) - tag_index
    norm_annotation.anchorEnd = int(annotation.anchorEnd) - tag_index

    return copy.copy(norm_annotation)