Skip to content

Commit

Permalink
Corrected __init__ call for SyntaxCorpusReader subclasses (#2872)
Browse files Browse the repository at this point in the history
CorpusReader.__init__ == SyntaxCorpusReader.__init__

Resolves #2118
  • Loading branch information
tomaarsen committed Nov 4, 2021
1 parent f12df18 commit bf9813d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
4 changes: 1 addition & 3 deletions nltk/corpus/reader/bracket_parse.py
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions nltk/corpus/reader/dependency.py
Expand Up @@ -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)

#########################################################

Expand Down
4 changes: 1 addition & 3 deletions nltk/corpus/reader/knbc.py
Expand Up @@ -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):
Expand Down

0 comments on commit bf9813d

Please sign in to comment.