NAME
Treex::Block::Read::BaseTextReader - abstract ancestor for document readers
VERSION
version 2.20160630
DESCRIPTION
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 next_document_text
and new_document
methods.
ATTRIBUTES
- language (required)
- lines_per_doc
-
If you want to split one file to more documents. The default is 0 which means, don't split.
- merge_files
-
Merge the content of all files (specified in
from
attribute) into one stream. Useful in combination withlines_per_doc
to get equally-sized documents even from non-equally-sized files. - encoding
-
What is the encoding of the input files. E.g.
utf8
(the default),cp1250
etc.
METHODS
- next_document_text
-
Returns a content of each file (specified in
from
attribute) as a text string. - next_filehandle
-
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).
SEE
Treex::Block::Read::BaseReader Treex::Block::Read::Text
AUTHOR
Martin Popel
COPYRIGHT AND LICENSE
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.