mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 01:16:28 +03:00
Fix style check in displacy
This commit is contained in:
parent
55dab77de8
commit
0b7fd67408
|
@ -22,12 +22,14 @@ def render(docs, style='dep', page=False, minify=False, jupyter=False, options={
|
|||
"""
|
||||
if isinstance(docs, Doc):
|
||||
docs = [docs]
|
||||
if style is 'dep':
|
||||
if style == 'dep':
|
||||
renderer = DependencyRenderer(options=options)
|
||||
parsed = [parse_deps(doc, options) for doc in docs]
|
||||
elif style is 'ent':
|
||||
elif style == 'ent':
|
||||
renderer = EntityRenderer(options=options)
|
||||
parsed = [parse_ents(doc, options) for doc in docs]
|
||||
else:
|
||||
raise ValueError("Unknown style: %s" % style)
|
||||
_html['parsed'] = renderer.render(parsed, page=page, minify=minify).strip()
|
||||
html = _html['parsed']
|
||||
if jupyter: # return HTML rendered by IPython display()
|
||||
|
|
Loading…
Reference in New Issue
Block a user