Treex::Block::Read::BaseTextReader - abstract ancestor for document readers
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.
In derived classes you need to define the
next_document method, and you can use
- language (required)
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
fromattribute) into one stream. Useful in combination with
lines_per_docto get equally-sized documents even from non-equally-sized files.
What is the encoding of the input files. E.g.
Returns a content of each file (specified in
fromattribute) as a text string.
Helper method - you can use this instead of
next_document_textif you don't want to load the whole text into memory (but do e.g. SAX-like parsing).
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.