mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-12 02:06:31 +03:00
9 lines
311 B
Plaintext
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.'
|