spaCy/website/tests/test_get_tokens_and_sentences.txt
2015-09-24 16:57:11 +02:00

9 lines
311 B
Plaintext

>>> from spacy.en import English ###
>>> nlp = English() ###
>>> doc = nlp(u'Hello, world. Here are two sentences.') ###
>>>
>>> token = doc[0]
>>> sentence = doc.sents.next()
>>> assert token is sentence[0]
>>> assert sentence.text == 'Hello, world.'