{"action":"created","comment":{"url":"https://api.github.com/repos/explosion/spaCy/pulls/comments/197757294","pull_request_review_id":131560289,"id":197757294,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5Nzc1NzI5NA==","diff_hunk":"@@ -29,8 +29,13 @@ def render(docs, style='dep', page=False, minify=False, jupyter=IS_JUPYTER,\n                  'ent': (EntityRenderer, parse_ents)}\n     if style not in factories:\n         raise ValueError(Errors.E087.format(style=style))\n-    if isinstance(docs, Doc) or isinstance(docs, dict):\n+    if isinstance(docs, (Doc, dict)):\n         docs = [docs]\n+    elif isinstance(docs, Span):","path":"spacy/displacy/__init__.py","position":16,"original_position":16,"commit_id":"39d70a58528671b17c39eb3f7a2e0aa48ce570db","original_commit_id":"39d70a58528671b17c39eb3f7a2e0aa48ce570db","user":{"login":"ines","id":13643239,"node_id":"MDQ6VXNlcjEzNjQzMjM5","avatar_url":"https://avatars0.githubusercontent.com/u/13643239?v=4","gravatar_id":"","url":"https://api.github.com/users/ines","html_url":"https://github.com/ines","followers_url":"https://api.github.com/users/ines/followers","following_url":"https://api.github.com/users/ines/following{/other_user}","gists_url":"https://api.github.com/users/ines/gists{/gist_id}","starred_url":"https://api.github.com/users/ines/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ines/subscriptions","organizations_url":"https://api.github.com/users/ines/orgs","repos_url":"https://api.github.com/users/ines/repos","events_url":"https://api.github.com/users/ines/events{/privacy}","received_events_url":"https://api.github.com/users/ines/received_events","type":"User","site_admin":false},"body":"I think one case we're not covering here yet is if you pass in a sequence of `Span` objects, or maybe even a mix of `Span`s and `Doc`s? Maybe something like this could work:\r\n\r\n```diff\r\n- elif isinstance(docs, Span):\r\n-     docs = [docs.as_doc()]\r\n+ docs = [obj for obj in docs if not isinstance(obj, Span) else obj.as_doc()]\r\n```\r\n\r\nSo basically, by that point, we can assume that `docs` is in fact a list / iterable, right? And if a member of that list is an instance of `Span`, we convert it to a `Doc`. ","created_at":"2018-06-25T11:04:01Z","updated_at":"2018-06-25T11:04:01Z","html_url":"https://github.com/explosion/spaCy/pull/2478#discussion_r197757294","pull_request_url":"https://api.github.com/repos/explosion/spaCy/pulls/2478","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/explosion/spaCy/pulls/comments/197757294"},"html":{"href":"https://github.com/explosion/spaCy/pull/2478#discussion_r197757294"},"pull_request":{"href":"https://api.github.com/repos/explosion/spaCy/pulls/2478"}}},"pull_request":{"url":"https://api.github.com/repos/explosion/spaCy/pulls/2478","id":197027963,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk3MDI3OTYz","html_url":"https://github.com/explosion/spaCy/pull/2478","diff_url":"https://github.com/explosion/spaCy/pull/2478.diff","patch_url":"https://github.com/explosion/spaCy/pull/2478.patch","issue_url":"https://api.github.com/repos/explosion/spaCy/issues/2478","number":2478,"state":"open","locked":false,"title":"Accept Span to displacy render","user":{"login":"ohenrik","id":647617,"node_id":"MDQ6VXNlcjY0NzYxNw==","avatar_url":"https://avatars2.githubusercontent.com/u/647617?v=4","gravatar_id":"","url":"https://api.github.com/users/ohenrik","html_url":"https://github.com/ohenrik","followers_url":"https://api.github.com/users/ohenrik/followers","following_url":"https://api.github.com/users/ohenrik/following{/other_user}","gists_url":"https://api.github.com/users/ohenrik/gists{/gist_id}","starred_url":"https://api.github.com/users/ohenrik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ohenrik/subscriptions","organizations_url":"https://api.github.com/users/ohenrik/orgs","repos_url":"https://api.github.com/users/ohenrik/repos","events_url":"https://api.github.com/users/ohenrik/events{/privacy}","received_events_url":"https://api.github.com/users/ohenrik/received_events","type":"User","site_admin":false},"body":"Adds support for passing Span object to Displacy.\r\n\r\n## Description\r\nAdds support for passing Span object to Displacy. Fixes #2477\r\n\r\n### Types of change\r\nEnhancement\r\n\r\n## Checklist\r\n<!--- Before you submit the PR, go over this checklist and make sure you can\r\ntick off all the boxes. [] -> [x] -->\r\n- [x] I have submitted the spaCy Contributor Agreement.\r\n- [x] I ran the tests, and all new and existing tests passed.\r\n- [x] My changes don't require a change to the documentation, or if they do, I've added all required information.\r\n","created_at":"2018-06-25T07:48:13Z","updated_at":"2018-06-25T11:04:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c049096f47d9654eedf8f7093f03ca50058266d4","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":111380487,"node_id":"MDU6TGFiZWwxMTEzODA0ODc=","url":"https://api.github.com/repos/explosion/spaCy/labels/enhancement","name":"enhancement","color":"20834E","default":true},{"id":881680006,"node_id":"MDU6TGFiZWw4ODE2ODAwMDY=","url":"https://api.github.com/repos/explosion/spaCy/labels/feat%20/%20visualizers","name":"feat / visualizers","color":"ddfc74","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/explosion/spaCy/pulls/2478/commits","review_comments_url":"https://api.github.com/repos/explosion/spaCy/pulls/2478/comments","review_comment_url":"https://api.github.com/repos/explosion/spaCy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/explosion/spaCy/issues/2478/comments","statuses_url":"https://api.github.com/repos/explosion/spaCy/statuses/39d70a58528671b17c39eb3f7a2e0aa48ce570db","head":{"label":"ohenrik:improve/displace_parse_span","ref":"improve/displace_parse_span","sha":"39d70a58528671b17c39eb3f7a2e0aa48ce570db","user":{"login":"ohenrik","id":647617,"node_id":"MDQ6VXNlcjY0NzYxNw==","avatar_url":"https://avatars2.githubusercontent.com/u/647617?v=4","gravatar_id":"","url":"https://api.github.com/users/ohenrik","html_url":"https://github.com/ohenrik","followers_url":"https://api.github.com/users/ohenrik/followers","following_url":"https://api.github.com/users/ohenrik/following{/other_user}","gists_url":"https://api.github.com/users/ohenrik/gists{/gist_id}","starred_url":"https://api.github.com/users/ohenrik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ohenrik/subscriptions","organizations_url":"https://api.github.com/users/ohenrik/orgs","repos_url":"https://api.github.com/users/ohenrik/repos","events_url":"https://api.github.com/users/ohenrik/events{/privacy}","received_events_url":"https://api.github.com/users/ohenrik/received_events","type":"User","site_admin":false},"repo":{"id":118749193,"node_id":"MDEwOlJlcG9zaXRvcnkxMTg3NDkxOTM=","name":"spaCy","full_name":"ohenrik/spaCy","owner":{"login":"ohenrik","id":647617,"node_id":"MDQ6VXNlcjY0NzYxNw==","avatar_url":"https://avatars2.githubusercontent.com/u/647617?v=4","gravatar_id":"","url":"https://api.github.com/users/ohenrik","html_url":"https://github.com/ohenrik","followers_url":"https://api.github.com/users/ohenrik/followers","following_url":"https://api.github.com/users/ohenrik/following{/other_user}","gists_url":"https://api.github.com/users/ohenrik/gists{/gist_id}","starred_url":"https://api.github.com/users/ohenrik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ohenrik/subscriptions","organizations_url":"https://api.github.com/users/ohenrik/orgs","repos_url":"https://api.github.com/users/ohenrik/repos","events_url":"https://api.github.com/users/ohenrik/events{/privacy}","received_events_url":"https://api.github.com/users/ohenrik/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ohenrik/spaCy","description":"💫 Industrial-strength Natural Language Processing (NLP) with Python and Cython","fork":true,"url":"https://api.github.com/repos/ohenrik/spaCy","forks_url":"https://api.github.com/repos/ohenrik/spaCy/forks","keys_url":"https://api.github.com/repos/ohenrik/spaCy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ohenrik/spaCy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ohenrik/spaCy/teams","hooks_url":"https://api.github.com/repos/ohenrik/spaCy/hooks","issue_events_url":"https://api.github.com/repos/ohenrik/spaCy/issues/events{/number}","events_url":"https://api.github.com/repos/ohenrik/spaCy/events","assignees_url":"https://api.github.com/repos/ohenrik/spaCy/assignees{/user}","branches_url":"https://api.github.com/repos/ohenrik/spaCy/branches{/branch}","tags_url":"https://api.github.com/repos/ohenrik/spaCy/tags","blobs_url":"https://api.github.com/repos/ohenrik/spaCy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ohenrik/spaCy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ohenrik/spaCy/git/refs{/sha}","trees_url":"https://api.github.com/repos/ohenrik/spaCy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ohenrik/spaCy/statuses/{sha}","languages_url":"https://api.github.com/repos/ohenrik/spaCy/languages","stargazers_url":"https://api.github.com/repos/ohenrik/spaCy/stargazers","contributors_url":"https://api.github.com/repos/ohenrik/spaCy/contributors","subscribers_url":"https://api.github.com/repos/ohenrik/spaCy/subscribers","subscription_url":"https://api.github.com/repos/ohenrik/spaCy/subscription","commits_url":"https://api.github.com/repos/ohenrik/spaCy/commits{/sha}","git_commits_url":"https://api.github.com/repos/ohenrik/spaCy/git/commits{/sha}","comments_url":"https://api.github.com/repos/ohenrik/spaCy/comments{/number}","issue_comment_url":"https://api.github.com/repos/ohenrik/spaCy/issues/comments{/number}","contents_url":"https://api.github.com/repos/ohenrik/spaCy/contents/{+path}","compare_url":"https://api.github.com/repos/ohenrik/spaCy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ohenrik/spaCy/merges","archive_url":"https://api.github.com/repos/ohenrik/spaCy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ohenrik/spaCy/downloads","issues_url":"https://api.github.com/repos/ohenrik/spaCy/issues{/number}","pulls_url":"https://api.github.com/repos/ohenrik/spaCy/pulls{/number}","milestones_url":"https://api.github.com/repos/ohenrik/spaCy/milestones{/number}","notifications_url":"https://api.github.com/repos/ohenrik/spaCy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ohenrik/spaCy/labels{/name}","releases_url":"https://api.github.com/repos/ohenrik/spaCy/releases{/id}","deployments_url":"https://api.github.com/repos/ohenrik/spaCy/deployments","created_at":"2018-01-24T10:22:15Z","updated_at":"2018-01-24T10:22:20Z","pushed_at":"2018-06-25T10:57:48Z","git_url":"git://github.com/ohenrik/spaCy.git","ssh_url":"git@github.com:ohenrik/spaCy.git","clone_url":"https://github.com/ohenrik/spaCy.git","svn_url":"https://github.com/ohenrik/spaCy","homepage":"https://spacy.io","size":82800,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"explosion:master","ref":"master","sha":"f33c70306688b49e87dd213ef7593b29fa5080e3","user":{"login":"explosion","id":20011530,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIwMDExNTMw","avatar_url":"https://avatars3.githubusercontent.com/u/20011530?v=4","gravatar_id":"","url":"https://api.github.com/users/explosion","html_url":"https://github.com/explosion","followers_url":"https://api.github.com/users/explosion/followers","following_url":"https://api.github.com/users/explosion/following{/other_user}","gists_url":"https://api.github.com/users/explosion/gists{/gist_id}","starred_url":"https://api.github.com/users/explosion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/explosion/subscriptions","organizations_url":"https://api.github.com/users/explosion/orgs","repos_url":"https://api.github.com/users/explosion/repos","events_url":"https://api.github.com/users/explosion/events{/privacy}","received_events_url":"https://api.github.com/users/explosion/received_events","type":"Organization","site_admin":false},"repo":{"id":21467110,"node_id":"MDEwOlJlcG9zaXRvcnkyMTQ2NzExMA==","name":"spaCy","full_name":"explosion/spaCy","owner":{"login":"explosion","id":20011530,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIwMDExNTMw","avatar_url":"https://avatars3.githubusercontent.com/u/20011530?v=4","gravatar_id":"","url":"https://api.github.com/users/explosion","html_url":"https://github.com/explosion","followers_url":"https://api.github.com/users/explosion/followers","following_url":"https://api.github.com/users/explosion/following{/other_user}","gists_url":"https://api.github.com/users/explosion/gists{/gist_id}","starred_url":"https://api.github.com/users/explosion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/explosion/subscriptions","organizations_url":"https://api.github.com/users/explosion/orgs","repos_url":"https://api.github.com/users/explosion/repos","events_url":"https://api.github.com/users/explosion/events{/privacy}","received_events_url":"https://api.github.com/users/explosion/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/explosion/spaCy","description":"💫 Industrial-strength Natural Language Processing (NLP) with Python and Cython","fork":false,"url":"https://api.github.com/repos/explosion/spaCy","forks_url":"https://api.github.com/repos/explosion/spaCy/forks","keys_url":"https://api.github.com/repos/explosion/spaCy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/explosion/spaCy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/explosion/spaCy/teams","hooks_url":"https://api.github.com/repos/explosion/spaCy/hooks","issue_events_url":"https://api.github.com/repos/explosion/spaCy/issues/events{/number}","events_url":"https://api.github.com/repos/explosion/spaCy/events","assignees_url":"https://api.github.com/repos/explosion/spaCy/assignees{/user}","branches_url":"https://api.github.com/repos/explosion/spaCy/branches{/branch}","tags_url":"https://api.github.com/repos/explosion/spaCy/tags","blobs_url":"https://api.github.com/repos/explosion/spaCy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/explosion/spaCy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/explosion/spaCy/git/refs{/sha}","trees_url":"https://api.github.com/repos/explosion/spaCy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/explosion/spaCy/statuses/{sha}","languages_url":"https://api.github.com/repos/explosion/spaCy/languages","stargazers_url":"https://api.github.com/repos/explosion/spaCy/stargazers","contributors_url":"https://api.github.com/repos/explosion/spaCy/contributors","subscribers_url":"https://api.github.com/repos/explosion/spaCy/subscribers","subscription_url":"https://api.github.com/repos/explosion/spaCy/subscription","commits_url":"https://api.github.com/repos/explosion/spaCy/commits{/sha}","git_commits_url":"https://api.github.com/repos/explosion/spaCy/git/commits{/sha}","comments_url":"https://api.github.com/repos/explosion/spaCy/comments{/number}","issue_comment_url":"https://api.github.com/repos/explosion/spaCy/issues/comments{/number}","contents_url":"https://api.github.com/repos/explosion/spaCy/contents/{+path}","compare_url":"https://api.github.com/repos/explosion/spaCy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/explosion/spaCy/merges","archive_url":"https://api.github.com/repos/explosion/spaCy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/explosion/spaCy/downloads","issues_url":"https://api.github.com/repos/explosion/spaCy/issues{/number}","pulls_url":"https://api.github.com/repos/explosion/spaCy/pulls{/number}","milestones_url":"https://api.github.com/repos/explosion/spaCy/milestones{/number}","notifications_url":"https://api.github.com/repos/explosion/spaCy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/explosion/spaCy/labels{/name}","releases_url":"https://api.github.com/repos/explosion/spaCy/releases{/id}","deployments_url":"https://api.github.com/repos/explosion/spaCy/deployments","created_at":"2014-07-03T15:15:40Z","updated_at":"2018-06-25T10:45:50Z","pushed_at":"2018-06-25T10:57:51Z","git_url":"git://github.com/explosion/spaCy.git","ssh_url":"git@github.com:explosion/spaCy.git","clone_url":"https://github.com/explosion/spaCy.git","svn_url":"https://github.com/explosion/spaCy","homepage":"https://spacy.io","size":87891,"stargazers_count":9679,"watchers_count":9679,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1541,"mirror_url":null,"archived":false,"open_issues_count":256,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":1541,"open_issues":256,"watchers":9679,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/explosion/spaCy/pulls/2478"},"html":{"href":"https://github.com/explosion/spaCy/pull/2478"},"issue":{"href":"https://api.github.com/repos/explosion/spaCy/issues/2478"},"comments":{"href":"https://api.github.com/repos/explosion/spaCy/issues/2478/comments"},"review_comments":{"href":"https://api.github.com/repos/explosion/spaCy/pulls/2478/comments"},"review_comment":{"href":"https://api.github.com/repos/explosion/spaCy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/explosion/spaCy/pulls/2478/commits"},"statuses":{"href":"https://api.github.com/repos/explosion/spaCy/statuses/39d70a58528671b17c39eb3f7a2e0aa48ce570db"}},"author_association":"NONE"}}
{"actor":{"display_login":"ines"}}