(en_vocab, en_parser)
| 30 | reason="The step_through API was removed (but should be brought back)" |
| 31 | ) |
| 32 | def test_en_sentence_breaks(en_vocab, en_parser): |
| 33 | # fmt: off |
| 34 | words = ["This", "is", "a", "sentence", ".", "This", "is", "another", "one", "."] |
| 35 | heads = [1, 1, 3, 1, 1, 6, 6, 8, 6, 6] |
| 36 | deps = ["nsubj", "ROOT", "det", "attr", "punct", "nsubj", "ROOT", "det", |
| 37 | "attr", "punct"] |
| 38 | transition = ["L-nsubj", "S", "L-det", "R-attr", "D", "R-punct", "B-ROOT", |
| 39 | "L-nsubj", "S", "L-attr", "R-attr", "D", "R-punct"] |
| 40 | # fmt: on |
| 41 | doc = Doc(en_vocab, words=words, heads=heads, deps=deps) |
| 42 | apply_transition_sequence(en_parser, doc, transition) |
| 43 | assert len(list(doc.sents)) == 2 |
| 44 | for token in doc: |
| 45 | assert token.dep != 0 or token.is_space |
| 46 | assert [token.head.i for token in doc] == [1, 1, 3, 1, 1, 6, 6, 8, 6, 6] |
nothing calls this directly
no test coverage detected
searching dependent graphs…