def assert_docs_equal(doc1, doc2):
assert [t.orth for t in doc1] == [t.orth for t in doc2]<EOL>assert [t.pos for t in doc1] == [t.pos for t in doc2]<EOL>assert [t.tag for t in doc1] == [t.tag for t in doc2]<EOL>assert [t.head.i for t in doc1] == [t.head.i for t in doc2]<EOL>assert [t.dep for t in doc1] == [t.dep for t in doc2]<EOL>if doc1.is_parsed and doc2.is_parsed:<EOL><INDENT>assert [s for s in doc1.sents] == [s for s in doc2.sents]<EOL><DEDENT>assert [t.ent_type for t in doc1] == [t.ent_type for t in doc2]<EOL>assert [t.ent_iob for t in doc1] == [t.ent_iob for t in doc2]<EOL>assert [ent for ent in doc1.ents] == [ent for ent in doc2.ents]<EOL>
Compare two Doc objects and assert that they're equal. Tests for tokens,
    tags, dependencies and entities.