| 1 | package Treex::Block::Write::Text; | ||
| 2 | 2 | $Treex::Block::Write::Text::VERSION = '2.20151210'; | |
| 3 | 2 | ▶ | use Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 2 | ▶ | use Treex::Core::Common; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 2 | extends 'Treex::Block::Write::BaseTextWriter'; | |
| 6 | |||
| 7 | 2 | has '+extension' => ( default => '.txt' ); | |
| 8 | |||
| 9 | override '_do_process_document' => sub { | ||
| 10 | 1 | ▶ | my ( $self, $doc ) = @_; |
|
Subroutine
__ANON__: called CC=2 SCAR=6.9
| |||
| 11 | |||
| 12 | 1 | foreach my $doczone ($self->get_selected_zones($doc->get_all_zones())){ | |
| 13 | 1 | print { $self->_file_handle } $doczone->text; | |
| 14 | } | ||
| 15 | 1 | return; | |
| 16 | 2 | }; | |
| 17 | |||
| 18 | 2 | 1; | |
| 19 | |||
| 20 | __END__ | ||
| 21 | |||
| 22 | =pod | ||
| 23 | |||
| 24 | =encoding utf-8 | ||
| 25 | |||
| 26 | =head1 NAME | ||
| 27 | |||
| 28 | Treex::Block::Write::Text | ||
| 29 | |||
| 30 | =head1 VERSION | ||
| 31 | |||
| 32 | version 2.20151210 | ||
| 33 | |||
| 34 | =head1 DESCRIPTION | ||
| 35 | |||
| 36 | Document writer for plain text format. | ||
| 37 | The text is taken from the document's attribute C<text>, | ||
| 38 | if you want to save the sentences stored in L<bundles|Treex::Core::Bundle>, | ||
| 39 | use L<Treex::Block::Write::Sentences>. | ||
| 40 | |||
| 41 | |||
| 42 | =head1 ATTRIBUTES | ||
| 43 | |||
| 44 | =over | ||
| 45 | |||
| 46 | =item to | ||
| 47 | |||
| 48 | space or comma separated list of filenames, or C<-> for STDOUT | ||
| 49 | |||
| 50 | |||
| 51 | =back | ||
| 52 | |||
| 53 | =head1 METHODS | ||
| 54 | |||
| 55 | =over | ||
| 56 | |||
| 57 | =item process_document | ||
| 58 | |||
| 59 | Saves the document. | ||
| 60 | |||
| 61 | =back | ||
| 62 | |||
| 63 | =head1 AUTHOR | ||
| 64 | |||
| 65 | Martin Popel <popel@ufal.mff.cuni.cz> | ||
| 66 | |||
| 67 | =head1 COPYRIGHT AND LICENSE | ||
| 68 | |||
| 69 | Copyright © 2011-2012 by Institute of Formal and Applied Linguistics, Charles University in Prague | ||
| 70 | |||
| 71 | This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. | ||