From a320f899be3d6eb7734d9b115f7a542797b71c09 Mon Sep 17 00:00:00 2001 From: Tom Aarsen Date: Wed, 27 Oct 2021 23:32:41 +0200 Subject: [PATCH] Corrected __init__ call for SyntaxCorpusReader subclasses CorpusReader.__init__ == SyntaxCorpusReader.__init__ Resolves #2118 --- nltk/corpus/reader/bracket_parse.py | 4 +--- nltk/corpus/reader/dependency.py | 4 +--- nltk/corpus/reader/knbc.py | 4 +--- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/nltk/corpus/reader/bracket_parse.py b/nltk/corpus/reader/bracket_parse.py index 92602e4a8f..1088842b81 100644 --- a/nltk/corpus/reader/bracket_parse.py +++ b/nltk/corpus/reader/bracket_parse.py @@ -53,9 +53,7 @@ def __init__( for normalizing or converting the POS tags returned by the ``tagged_...()`` methods. """ - # FIXME: Why is it inheritting from SyntaxCorpusReader but initializing - # from CorpusReader? - CorpusReader.__init__(self, root, fileids, encoding) + SyntaxCorpusReader.__init__(self, root, fileids, encoding) self._comment_char = comment_char self._detect_blocks = detect_blocks self._tagset = tagset diff --git a/nltk/corpus/reader/dependency.py b/nltk/corpus/reader/dependency.py index 26ceb70671..bc6f107573 100644 --- a/nltk/corpus/reader/dependency.py +++ b/nltk/corpus/reader/dependency.py @@ -23,9 +23,7 @@ def __init__( sent_tokenizer=RegexpTokenizer("\n", gaps=True), para_block_reader=read_blankline_block, ): - # FIXME: Why is it inheritting from SyntaxCorpusReader but initializing - # from CorpusReader? - CorpusReader.__init__(self, root, fileids, encoding) + SyntaxCorpusReader.__init__(self, root, fileids, encoding) ######################################################### diff --git a/nltk/corpus/reader/knbc.py b/nltk/corpus/reader/knbc.py index b898fc24ad..4b1c3bf27d 100644 --- a/nltk/corpus/reader/knbc.py +++ b/nltk/corpus/reader/knbc.py @@ -58,9 +58,7 @@ def __init__(self, root, fileids, encoding="utf8", morphs2str=_morphs2str_defaul morphs2str is a function to convert morphlist to str for tree representation for _parse() """ - # FIXME: Why is it inheritting from SyntaxCorpusReader but initializing - # from CorpusReader? - CorpusReader.__init__(self, root, fileids, encoding) + SyntaxCorpusReader.__init__(self, root, fileids, encoding) self.morphs2str = morphs2str def _read_block(self, stream):