5651a0d052bcfd160b187828aa3d8d90652929fe,spacy/tests/doc/test_span_merge.py,,test_spans_merge_tokens,#Any#,11

Before Change


    doc = get_doc(tokens.vocab, words=[t.text for t in tokens], heads=heads)
    assert len(doc) == 4
    assert doc[0].head.text == "Angeles"
    assert doc[1].head.text == "start"
    doc.merge(0, len("Los Angeles"), tag="NNP", lemma="Los Angeles", label="GPE")

    assert len(doc) == 3
    assert doc[0].text == "Los Angeles"

After Change


    assert len(doc) == 4
    assert doc[0].head.text == "Angeles"
    assert doc[1].head.text == "start"
    with doc.retokenize() as retokenizer:
        attrs = {"tag": "NNP", "lemma": "Los Angeles", "ent_type": "GPE"}
        retokenizer.merge(doc[0:2], attrs=attrs)
    assert len(doc) == 3
    assert doc[0].text == "Los Angeles"
    assert doc[0].head.text == "start"
    assert doc[0].ent_type_ == "GPE"
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


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


Project Name: explosion/spaCy
Commit Name: aeba99ab0d9cf3967ef54f3a1c509c9d496ce4b3
Time: 2018-09-10
Author: 33332500+grivaz@users.noreply.github.com
File Name: spacy/tests/doc/test_span_merge.py
Class Name:
Method Name: test_spans_merge_tokens


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