File Coverage

blib/lib/Treex/Block/Read/Text.pm
Criterion Covered Total %
statement 6 13 46.1
branch 0 2 0.0
condition n/a
subroutine 2 3 66.6
pod n/a
total 8 18 44.4


line stmt bran cond sub pod time code
1             package Treex::Block::Read::Text;
2             $Treex::Block::Read::Text::VERSION = '2.20160630';
3 2     2   573 use Moose;
  2         5  
  2         19  
4 2     2   13107 use Treex::Core::Common;
  2         4  
  2         20  
5             extends 'Treex::Block::Read::BaseTextReader';
6              
7             sub next_document {
8 0     0     my ($self) = @_;
9 0           my $text = $self->next_document_text();
10 0 0         return if !defined $text;
11              
12 0           my $document = $self->new_document();
13 0           my $zone = $document->create_zone( $self->language, $self->selector );
14 0           $zone->set_text($text);
15 0           return $document;
16             }
17              
18             1;
19              
20             __END__
21              
22             =pod
23              
24             =encoding utf-8
25              
26             =head1 NAME
27              
28             Treex::Block::Read::Text
29              
30             =head1 VERSION
31              
32             version 2.20160630
33              
34             =head1 DESCRIPTION
35              
36             Document reader for plain text format.
37             The text is stored to the L<document|Treex::Core::Document>'s attribute C<text>,
38             if you want to load a text in "on sentence per line" format to
39             L<bundles|Treex::Core::Bundle>, use L<Treex::Block::Read::Sentences> instead.
40              
41             =head1 ATTRIBUTES
42              
43             =over
44              
45             =item from
46              
47             space or comma separated list of filenames
48              
49             =back
50              
51             =head1 METHODS
52              
53             =over
54              
55             =item next_document
56              
57             Loads a document.
58              
59             =back
60              
61             =head1 AUTHOR
62              
63             Martin Popel
64              
65             =head1 COPYRIGHT AND LICENSE
66              
67             Copyright © 2011 by Institute of Formal and Applied Linguistics, Charles University in Prague
68              
69             This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.