Skip to content

Commit ed5d722

Browse files
committed
Add Sphinx-style :param annotations
1 parent 937fcb3 commit ed5d722

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

nltk/corpus/reader/wordnet.py

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2118,19 +2118,20 @@ def tag2pos(self, tag, tagset="en-ptb"):
21182118
WordNet Part-of-Speech, using Universal Tags (Petrov et al., 2012) as intermediary.
21192119
Return None when WordNet does not cover that POS.
21202120
2121-
Args:
2122-
tag (str): The part-of-speech tag to convert.
2123-
tagset (str): The tagset of the input tag. Defaults to "en-ptb".
2124-
Supported tagsets are those recognized by the `map_tag` function
2125-
from `nltk.tag`. Common examples include:
2126-
- "en-ptb" (Penn Treebank tagset for English)
2127-
- "en-brown" (Brown tagset)
2128-
For a complete list of supported tagsets, refer to the `map_tag`
2129-
documentation or its source code in the NLTK library.
2130-
2131-
Returns:
2132-
The corresponding WordNet POS tag ('n', 'v', 'a', 'r') or None
2121+
:param tag: The part-of-speech tag to convert.
2122+
:type tag: str
2123+
:param tagset: The tagset of the input tag. Defaults to "en-ptb".
2124+
Supported tagsets are those recognized by the `map_tag` function
2125+
from `nltk.tag`. Common examples include:
2126+
- "en-ptb" (Penn Treebank tagset for English)
2127+
- "en-brown" (Brown tagset)
2128+
For a complete list of supported tagsets, refer to the `map_tag`
2129+
documentation or its source code in the NLTK library.
2130+
:type tagset: str
2131+
2132+
:returns: The corresponding WordNet POS tag ('n', 'v', 'a', 'r') or None
21332133
if the tag cannot be mapped to a WordNet POS.
2134+
:rtype: str or None
21342135
21352136
Example:
21362137
>>> import nltk

0 commit comments

Comments
 (0)