jaclearn.nlp.graph.dependency_visualizer.utils#

Functions

escape_html(text)

Replace <, >, &, " with their HTML encoded representation.

minify_html(html)

Perform a template-specific, rudimentary HTML minification for displaCy.

Functions

escape_html(text)[source]#

Replace <, >, &, “ with their HTML encoded representation. Intended to prevent HTML errors in rendered displaCy markup. text (unicode): The original text. RETURNS (unicode): Equivalent text to be safely used within HTML.

minify_html(html)[source]#

Perform a template-specific, rudimentary HTML minification for displaCy. Disclaimer: NOT a general-purpose solution, only removes indentation and newlines. html (unicode): Markup to minify. RETURNS (unicode): “Minified” HTML.