spaCy/tests/parser/test_initial_actions_parse.py

13 lines
320 B
Python
Raw Normal View History

import pytest
def test_initial(EN):
doc = EN.tokenizer(u'I ate the pizza with anchovies.')
EN.tagger(doc)
2015-08-08 21:41:36 +00:00
next_actions = EN.parser.partial(doc, ['L-nsubj', 'S', 'L-det'])
assert doc[0].head.i == 1
2015-08-08 21:38:19 +00:00
assert doc[1].head.i == 1
assert doc[2].head.i == 2
assert doc[3].head.i == 2
assert doc