Treex::Block::Read::BaseTextReader - abstract ancestor for document readers
version 2.20210102
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 and load the documents from plain text files. 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_document_text and new_document methods.
next_document
next_document_text
new_document
If you want to split one file to more documents. The default is 0 which means, don't split.
Merge the content of all files (specified in from attribute) into one stream. Useful in combination with lines_per_doc to get equally-sized documents even from non-equally-sized files.
lines_per_doc
What is the encoding of the input files. E.g. utf8 (the default), cp1250 etc.
utf8
cp1250
Returns a content of each file (specified in from attribute) as a text string.
Helper method - you can use this instead of next_document_text if you don't want to load the whole text into memory (but do e.g. SAX-like parsing).
Treex::Block::Read::BaseReader Treex::Block::Read::Text
Martin Popel
Copyright © 2011-2012 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.
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.