View on
MetaCPAN
Zdeněk Žabokrtský > Treex-Core-0.08399 > Treex::Block::Write::BaseWriter

Download:
Treex-Core-0.08399.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Module Version: 0.08399   Source   Latest Release: Treex-Core-2.20160630

NAME ^

Treex::Block::Write::BaseWriter

VERSION ^

version 0.08399

DESCRIPTION ^

This is the base class for document writer blocks in Treex.

It handles selecting and opening the output files, allowing for output of one-file per document. The output file name(s) may be set in several ways (standard output may also be used as a file with the name '-'); GZip file compression is supported.

Other features, such as writing all documents to one file or setting character encoding, are enabled in Treex::Block::Write::BaseTextWriter.

PARAMETERS ^

to

Space-or-comma-separated list of output file names.

file_stem, path

These override the respective attributes in documents (filled in by a DocumentReader), which are used for generating output file names.

stem_suffix

A string to append after file_stem.

compress

If set to 1, the output files are compressed using GZip (if to is used to set file names, the names must also contain the ".gz" suffix).

clobber

If set to 1, existing destination files will be overwritten.

DERIVED CLASSES ^

The derived classes should just use print { $self-_file_handle } "output text">, the base class will take care of opening the proper file.

All derived classes that override the process_document method directly must call the _prepare_file_handle method to gain access to the correct file handle.

The extension parameter should be overriden with the default file extension for the given file type.

TODO ^

AUTHORS ^

Ondřej Dušek <odusek@ufal.mff.cuni.cz>

Martin Popel <popel@ufal.mff.cuni.cz>

Ondřej Bojar <bojar@ufal.mff.cuni.cz>

COPYRIGHT AND LICENSE ^

Copyright © 2011-2012 by Institute of Formal and Applied Linguistics, Charles University in Prague

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

syntax highlighting: