udapi.block.write.corefhtml module

CorefHtml class is a writer for HTML+JavaScript visualization of coreference.

When using lazy loading of documents (infinite scrolling), modern browsers don’t allow JavaScript to load files from a local file system (“Access to XMLHttpRequest at ‘file://…/doc2.html’ from origin ‘null’ has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.”)

The recommended solution is to start a local web server, e.g. using

python -m http.server

and browse http://0.0.0.0:8000/my.html.

Non-recommended solution is to run

google-chrome –new-window –user-data-dir=/tmp/chrome-proxy –allow-file-access-from-files my.html

class udapi.block.write.corefhtml.CorefHtml(docs_dir='docs', path_to_js='web', show_trees=True, show_eid=False, show_etype=False, colors=7, rtl=None, **kwargs)[source]

Bases: BaseWriter

process_document(doc)[source]

Process a UD document

process_tree(tree)[source]

Process a UD tree

process_ud_doc(ud_doc, doc_num)[source]