| 1 | package Treex::Block::Read::Text; | ||||||||||
| 2 | 3 | $Treex::Block::Read::Text::VERSION = '2.20151210'; | |||||||||
| 3 | 3 | ▶ | use Moose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 3 | ▶ | use Treex::Core::Common; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 3 | extends 'Treex::Block::Read::BaseTextReader'; | |||||||||
| 6 | |||||||||||
| 7 | sub next_document { | ||||||||||
| 8 | 2 | ▶ | my ($self) = @_; | ||||||||
|
Subroutine
next_document: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 9 | 2 | my $text = $self->next_document_text(); | |||||||||
| 10 | 2 | ▶ | return if !defined $text; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 11 | |||||||||||
| 12 | 1 | my $document = $self->new_document(); | |||||||||
| 13 | 1 | my $zone = $document->create_zone( $self->language, $self->selector ); | |||||||||
| 14 | 1 | $zone->set_text($text); | |||||||||
| 15 | 1 | return $document; | |||||||||
| 16 | } | ||||||||||
| 17 | |||||||||||
| 18 | 3 | 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.20151210 | ||||||||||
| 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. | ||||||||||