From 0b7fd6740832d608ee057a0ebf8cb493010c2f3e Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Wed, 17 May 2017 07:57:24 -0500 Subject: [PATCH] Fix style check in displacy --- spacy/displacy/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/spacy/displacy/__init__.py b/spacy/displacy/__init__.py index 45671612f..8714cc6ee 100644 --- a/spacy/displacy/__init__.py +++ b/spacy/displacy/__init__.py @@ -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()