2018-09-27 14:41:57 +00:00
|
|
|
# coding: utf-8
|
|
|
|
from __future__ import unicode_literals
|
|
|
|
|
2018-09-19 12:00:31 +00:00
|
|
|
from ..util import get_doc
|
|
|
|
|
2018-09-27 14:41:57 +00:00
|
|
|
|
2018-09-19 12:00:31 +00:00
|
|
|
def test_issue2772(en_vocab):
|
2018-09-27 14:41:57 +00:00
|
|
|
"""Test that deprojectivization doesn't mess up sentence boundaries."""
|
2018-11-27 00:09:36 +00:00
|
|
|
words = "When we write or communicate virtually , we can hide our true feelings .".split()
|
2018-09-19 12:00:31 +00:00
|
|
|
# A tree with a non-projective (i.e. crossing) arc
|
|
|
|
# The arcs (0, 4) and (2, 9) cross.
|
2018-09-19 12:47:27 +00:00
|
|
|
heads = [4, 1, 7, -1, -2, -1, 3, 2, 1, 0, -1, -2, -1]
|
2018-11-27 00:09:36 +00:00
|
|
|
deps = ["dep"] * len(heads)
|
2018-09-19 12:00:31 +00:00
|
|
|
doc = get_doc(en_vocab, words=words, heads=heads, deps=deps)
|
|
|
|
assert doc[1].is_sent_start is None
|