Update spacy.util documentation

This commit is contained in:
ines 2017-05-21 01:12:09 +02:00
parent 0c6c65aa3c
commit 3871157d84
2 changed files with 22 additions and 1 deletions

View File

@ -144,7 +144,8 @@ def parse_package_meta(package_path, require=True):
def is_in_jupyter():
"""Check if user is in a Jupyter notebook. Mainly used for displaCy.
"""Check if user is running spaCy from a Jupyter notebook by detecting the
IPython kernel. Mainly used for the displaCy visualizer.
RETURNS (bool): True if in Jupyter, False if not.
"""

View File

@ -167,6 +167,26 @@ p
+cell dict / #[code None]
+cell Model meta data or #[code None].
+h(2, "is_in_jupyter") util.is_in_jupyter
+tag function
p
| Check if user is running spaCy from a #[+a("https://jupyter.org") Jupyter]
| notebook by detecting the IPython kernel. Mainly used for the
| #[+api("displacy") #[code displacy]] visualizer.
+aside-code("Example").
html = '<h1>Hello world!</h1>'
if util.is_in_jupyter():
from IPython.core.display import display, HTML
return display(HTML(html))
+table(["Name", "Type", "Description"])
+footrow
+cell returns
+cell bool
+cell #[code True] if in Jupyter, #[code False] if not.
+h(2, "update_exc") util.update_exc
+tag function