Treex::Block::Read::BaseReader - abstract ancestor for document readers
version 0.05222
This class serves as an common ancestor for document readers, that have parameter from with a space or comma separated list of filenames to be loaded. It is designed to implement the Treex::Core::DocumentReader interface.
from
In derived classes you need to define the next_document method, and you can use next_filename and new_document methods.
next_document
next_filename
new_document
space or comma separated list of filenames, or "-" for STDIN (If you use this method via API you can specify filenames instead.)
filenames
How to name the loaded documents. This will attribute will be saved to the same-named attdibute in documents and it will be used in documents writers to decide where to save the files.
array of filenames to be loaded, automatically initialized from the attribute from
This method must be overriden in derived classes. (The implementation in this class just issues fatal error.)
returns the next filename (full path) to be loaded (from the list specified in the attribute from)
Returns a new empty document with pre-filled attributes loaded_from, file_stem, file_number and path which are guessed based on current_filename.
current_filename
returns the last filename returned by next_filename
Is the document that will be returned by next_document supposed to be processed by this job? This is relevant only in parallel processing, where each job has different $jobnumber assigned.
$jobnumber
Returns the number of documents that will be read by this reader. If is_one_doc_per_file returns true, then the number of documents equals the number of files given in from. Otherwise, this method returns undef.
is_one_doc_per_file
Treex::Block::Read::BaseTextReader Treex::Block::Read::Text
Martin Popel
Copyright © 2011 by Institute of Formal and Applied Linguistics, Charles University in Prague
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
1 POD Error
The following errors were encountered while parsing the POD:
Non-ASCII character seen before =encoding in '©'. Assuming UTF-8
To install Treex::Core, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Treex::Core
CPAN shell
perl -MCPAN -e shell install Treex::Core
For more information on module installation, please visit the detailed CPAN module installation guide.