2015-08-08 20:14:01 +03:00
|
|
|
import pytest
|
|
|
|
|
|
|
|
|
2015-08-26 20:22:06 +03:00
|
|
|
@pytest.mark.models
|
2015-08-08 20:14:01 +03:00
|
|
|
def test_initial(EN):
|
|
|
|
doc = EN.tokenizer(u'I ate the pizza with anchovies.')
|
|
|
|
EN.tagger(doc)
|
2015-09-06 06:40:10 +03:00
|
|
|
with EN.parser.step_through(doc) as stepwise:
|
|
|
|
stepwise.transition('L-nsubj')
|
|
|
|
stepwise.transition('S')
|
|
|
|
stepwise.transition('L-det')
|
2015-08-08 20:14:01 +03:00
|
|
|
assert doc[0].head.i == 1
|
2015-08-09 00:38:19 +03:00
|
|
|
assert doc[1].head.i == 1
|
2015-08-09 00:45:36 +03:00
|
|
|
assert doc[2].head.i == 3
|
|
|
|
assert doc[3].head.i == 3
|
2015-08-09 00:38:19 +03:00
|
|
|
assert doc
|