lib/Treex/Block/Read/Text.pm

filter: Statementstmt 100% 17 / 17 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod 100% 1 / 1 totaltotal 100% 23 / 23 CC 2 SCAR 4.1
CC
2
Cov
100%
next_document
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.5
« lib/Treex/Core/Common.pm ↑ Summary lib/Treex/Block/Read/Treex.pm »
1 package Treex::Block::Read::Text;
2 {
3 12 $Treex::Block::Read::Text::VERSION = '0.08633_1';
4 }
5 12 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 12 ▶use Treex::Core::Common;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 12 extends 'Treex::Block::Read::BaseTextReader';
8  
9 sub next_document {
10 20 ▶ my ($self) = @_;
Subroutine next_document: called CC=2 SCAR=6.9
Pod documented
11 20 my $text = $self->next_document_text();
12 20 ▶ return if !defined $text;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $text 10 10 20
13  
14 10 my $document = $self->new_document();
15 10 my $zone = $document->create_zone( $self->language, $self->selector );
16 10 $zone->set_text($text);
17 10 return $document;
18 }
19  
20 12 1;
21  
22 __END__
23  
24 =head1 NAME
25  
26 Treex::Block::Read::Text
27  
28 =head1 VERSION
29  
30 version 0.08633_1
31  
32 =head1 DESCRIPTION
33  
34 Document reader for plain text format.
35 The text is stored to the L<document|Treex::Core::Document>'s attribute C<text>,
36 if you want to load a text in "on sentence per line" format to
37 L<bundles|Treex::Core::Bundle>, use L<Treex::Block::Read::Sentences> instead.
38  
39 =head1 ATTRIBUTES
40  
41 =over
42  
43 =item from
44  
45 space or comma separated list of filenames
46  
47 =back
48  
49 =head1 METHODS
50  
51 =over
52  
53 =item next_document
54  
55 Loads a document.
56  
57 =back
58  
59 =head1 AUTHOR
60  
61 Martin Popel
62  
63 =head1 COPYRIGHT AND LICENSE
64  
65 Copyright © 2011 by Institute of Formal and Applied Linguistics, Charles University in Prague
66  
67 This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
« lib/Treex/Core/Common.pm ↑ Summary lib/Treex/Block/Read/Treex.pm »