From 4917cbb4843b1b549350e30f98b49979943f8b45 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Thu, 5 May 2016 12:10:07 +0200 Subject: [PATCH] Include sent_start test --- spacy/tests/doc/test_token_api.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/spacy/tests/doc/test_token_api.py b/spacy/tests/doc/test_token_api.py index 2f784e678..d4d8aea8e 100644 --- a/spacy/tests/doc/test_token_api.py +++ b/spacy/tests/doc/test_token_api.py @@ -155,3 +155,15 @@ def test_doc_token_api_head_setter(en_tokenizer): assert doc[3].left_edge.i == 0 assert doc[4].left_edge.i == 0 assert doc[2].left_edge.i == 0 + + +def test_sent_start(en_tokenizer): + doc = en_tokenizer(u'This is a sentence. This is another.') + assert not doc[0].sent_start + assert not doc[5].sent_start + doc[5].sent_start = True + assert doc[5].sent_start + assert not doc[0].sent_start + doc.is_parsed = True + assert len(list(doc.sents)) == 2 +