write_brat()

Write each document as <id>.txt and <id>.ann into directory.

Usage

Source

write_brat(
    docs,
    directory,
    *,
    offset_unit="codepoint",
    lossy="warn",
)

Every file name is checked and every document rendered before anything is written, so an error leaves no partial output.