| 1 | package Treex::Block::Read::Treex; | ||||||||||
| 2 | 1 | $Treex::Block::Read::Treex::VERSION = '2.20151210'; | |||||||||
| 3 | 1 | ▶ | use Moose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use Treex::Core::Common; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 1 | extends 'Treex::Block::Read::BaseReader'; | |||||||||
| 6 | 1 | with 'Treex::Block::Read::BaseSplitterRole'; | |||||||||
| 7 | |||||||||||
| 8 | sub next_document { | ||||||||||
| 9 | 0 | ▶ | my ($self, $filename) = @_; | ||||||||
|
Subroutine
next_document: not called CC=3 SCAR=24.8
| |||||||||||
| 10 | |||||||||||
| 11 | 0 | ▶ | if ( ! $filename ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 12 | 0 | $filename = $self->next_filename(); | |||||||||
| 13 | } | ||||||||||
| 14 | |||||||||||
| 15 | # No more documents in the queue | ||||||||||
| 16 | 0 | ▶ | return if ! $filename; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 17 | |||||||||||
| 18 | # load the document from file using Treex::Core::Document->new({filename=>$filename}) which uses Treex::PML | ||||||||||
| 19 | 0 | return $self->new_document($filename); | |||||||||
| 20 | } | ||||||||||
| 21 | |||||||||||
| 22 | 1 | 1; | |||||||||
| 23 | |||||||||||
| 24 | __END__ | ||||||||||
| 25 | |||||||||||
| 26 | =pod | ||||||||||
| 27 | |||||||||||
| 28 | =encoding utf-8 | ||||||||||
| 29 | |||||||||||
| 30 | =head1 NAME | ||||||||||
| 31 | |||||||||||
| 32 | Treex::Block::Read::Treex | ||||||||||
| 33 | |||||||||||
| 34 | =head1 VERSION | ||||||||||
| 35 | |||||||||||
| 36 | version 2.20151210 | ||||||||||
| 37 | |||||||||||
| 38 | =head1 DESCRIPTION | ||||||||||
| 39 | |||||||||||
| 40 | Document reader for the Treex file format (C<*.treex>), | ||||||||||
| 41 | which is actually a PML instance which is an XML-based format. | ||||||||||
| 42 | |||||||||||
| 43 | |||||||||||
| 44 | =head1 PARAMETERS | ||||||||||
| 45 | |||||||||||
| 46 | =over | ||||||||||
| 47 | |||||||||||
| 48 | =item from | ||||||||||
| 49 | |||||||||||
| 50 | space or comma separated list of filenames | ||||||||||
| 51 | |||||||||||
| 52 | =item bundles_per_doc | ||||||||||
| 53 | |||||||||||
| 54 | If you want to split one file to more documents. | ||||||||||
| 55 | The default is 0 which means, don't split. | ||||||||||
| 56 | |||||||||||
| 57 | |||||||||||
| 58 | =back | ||||||||||
| 59 | |||||||||||
| 60 | =head1 METHODS | ||||||||||
| 61 | |||||||||||
| 62 | =over | ||||||||||
| 63 | |||||||||||
| 64 | =item next_document | ||||||||||
| 65 | |||||||||||
| 66 | Loads a document. | ||||||||||
| 67 | |||||||||||
| 68 | =back | ||||||||||
| 69 | |||||||||||
| 70 | =head1 AUTHOR | ||||||||||
| 71 | |||||||||||
| 72 | Martin Popel <popel@ufal.mff.cuni.cz> | ||||||||||
| 73 | |||||||||||
| 74 | =head1 COPYRIGHT AND LICENSE | ||||||||||
| 75 | |||||||||||
| 76 | Copyright © 2011, 2015 by Institute of Formal and Applied Linguistics, Charles University in Prague | ||||||||||
| 77 | |||||||||||
| 78 | This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. | ||||||||||