def merge_spans(spans):
    """
    Merge spans *in-place* within parent doc so that each takes up a single token.

    Args:
        spans (iterable(``spacy.Span``))
    """
    for span in spans:
        try:
            span.merge(span.root.tag_, span.text, span.root.ent_type_)
        except __HOLE__ as e:
            logger.error(e)
dataset/ETHPy150Open chartbeat-labs/textacy/textacy/spacy_utils.py/merge_spans