5651a0d052bcfd160b187828aa3d8d90652929fe,spacy/pipeline/functions.py,,merge_noun_chunks,#Any#,10

Before Change


    spans = [
        (np.start_char, np.end_char, np.root.tag, np.root.dep) for np in doc.noun_chunks
    ]
    for start, end, tag, dep in spans:
        doc.merge(start, end, tag=tag, dep=dep)
    return doc


def merge_entities(doc):

After Change


    
    if not doc.is_parsed:
        return doc
    with doc.retokenize() as retokenizer:
        for np in doc.noun_chunks:
            attrs = {"tag": np.root.tag, "dep": np.root.dep}
            retokenizer.merge(np, attrs=attrs)
    return doc


def merge_entities(doc):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 9

Instances


Project Name: explosion/spaCy
Commit Name: 5651a0d052bcfd160b187828aa3d8d90652929fe
Time: 2019-02-15
Author: ines@ines.io
File Name: spacy/pipeline/functions.py
Class Name:
Method Name: merge_noun_chunks


Project Name: explosion/spaCy
Commit Name: 5651a0d052bcfd160b187828aa3d8d90652929fe
Time: 2019-02-15
Author: ines@ines.io
File Name: spacy/pipeline/functions.py
Class Name:
Method Name: merge_entities


Project Name: explosion/spaCy
Commit Name: 5651a0d052bcfd160b187828aa3d8d90652929fe
Time: 2019-02-15
Author: ines@ines.io
File Name: spacy/tests/doc/test_doc_api.py
Class Name:
Method Name: test_doc_api_runtime_error