@@ -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