aboutsummaryrefslogtreecommitdiffstats
path: root/bsie/reader/document
diff options
context:
space:
mode:
authorMatthias Baumgartner <dev@igsor.net>2023-07-28 12:00:11 +0200
committerMatthias Baumgartner <dev@igsor.net>2023-07-28 12:00:11 +0200
commitcf032db8785149689d94232b400e20e4d6336562 (patch)
treec912f62227b06430bf4c11a820c0a4b34b46512c /bsie/reader/document
parent11b26a913d39edb7f36cd0a3b3d8e74c96738579 (diff)
downloadbsie-develop.tar.gz
bsie-develop.tar.bz2
bsie-develop.zip
minor style and text fixesdevelop
Diffstat (limited to 'bsie/reader/document')
-rw-r--r--bsie/reader/document/__init__.py4
-rw-r--r--bsie/reader/document/_plain.py3
2 files changed, 4 insertions, 3 deletions
diff --git a/bsie/reader/document/__init__.py b/bsie/reader/document/__init__.py
index 4ae3613..824ad86 100644
--- a/bsie/reader/document/__init__.py
+++ b/bsie/reader/document/__init__.py
@@ -17,13 +17,13 @@ _FILE_FORMAT_READERS: typing.Sequence[str] = (
# exports
__all__: typing.Sequence[str] = (
- 'Document'
+ 'Document',
)
## code ##
-class Document(chain.ReaderChain[typing.Sequence[str]]):
+class Document(chain.ReaderChain[typing.Sequence[str]]): # pylint: disable=too-few-public-methods
"""Read paragraphs from a text file."""
def __init__(self, cfg: typing.Optional[typing.Any] = None):
diff --git a/bsie/reader/document/_plain.py b/bsie/reader/document/_plain.py
index a589265..8ea3c43 100644
--- a/bsie/reader/document/_plain.py
+++ b/bsie/reader/document/_plain.py
@@ -20,6 +20,7 @@ __all__: typing.Sequence[str] = (
## code ##
class Plain(base.Reader):
+ """Read paragraphs (seperated by newline) from a plain text file."""
_match: filematcher.Matcher
@@ -32,7 +33,7 @@ class Plain(base.Reader):
raise errors.UnsupportedFileFormatError(path)
# open file in text mode
- with open(path, 'rt') as ifile:
+ with open(path, 'rt', encoding='UTF-8') as ifile:
return [line.strip() for line in ifile.read().split('\n') if len(line.strip()) > 0]
## EOF ##