Skip to content

Commit 7210c8e

Browse files
committed
Add docstring with a doctest
1 parent 4b99fe5 commit 7210c8e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

nltk/corpus/reader/plaintext.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,16 @@ def __init__(self, *args, **kwargs):
164164

165165

166166
class PortugueseCategorizedPlaintextCorpusReader(CategorizedPlaintextCorpusReader):
167+
"""
168+
This class is identical with CategorizedPlaintextCorpusReader,
169+
except that it initializes a Portuguese PunktTokenizer:
170+
171+
>>> from nltk.corpus import machado
172+
>>> print(machado._sent_tokenizer._lang)
173+
portuguese
174+
175+
"""
176+
167177
def __init__(self, *args, **kwargs):
168178
CategorizedPlaintextCorpusReader.__init__(self, *args, **kwargs)
169179
# Fixed (@ekaf 2025), new way to invoke Punkt:

0 commit comments

Comments
 (0)