write_passage

ucca.ioutil.write_passage(passage, output_format=None, binary=False, outdir='.', prefix='', converter=None, verbose=True, append=False, basename=None)[source]

Write a given UCCA passage in any format. :param passage: Passage object to write :param output_format: filename suffix (if given “ucca”, suffix will be “.pickle” or “.xml” depending on `binary’) :param binary: save in pickle format with “.pickle” suffix :param outdir: output directory, should exist already :param prefix: string to prepend to output filename :param converter: function to apply to passage before saving (if output_format is not “ucca”/”pickle”/”xml”),

returning iterable of strings, each corresponding to an output line
Parameters:
  • verbose – print “Writing passage” message
  • append – if using converter, append to output file rather than creating a new file
  • basename – use this instead of `passage.ID’ for the output filename
Returns:

path of created output file