CS代考 #!/usr/bin/env python3

#!/usr/bin/env python3
# Student name: NAME
# Student number: NUMBER
# UTORid: ID

Copyright By PowCoder代写 加微信 powcoder

import typing as T
from string import punctuation

from nltk.corpus import stopwords, wordnet as wn
from nltk.tokenize import word_tokenize

def deepest():
“””Find and print the synset with the largest maximum depth along with its
depth on each of its hyperonym paths.

raise NotImplementedError

def superdefn(s: str) -> T.List[str]:
“””Get the “superdefinition” of a synset. (Yes, superdefinition is a
made-up word. All words are made up…)

We define the superdefinition of a synset to be the list of word tokens,
here as produced by word_tokenize, in the definitions of the synset, its
hyperonyms, and its hyponyms.

s (str): The name of the synset to look up

list of str: The list of word tokens in the superdefinition of s

>>> superdefn(‘toughen.v.01’)
[‘make’, ‘tough’, ‘or’, ‘tougher’, ‘gain’, ‘strength’, ‘make’, ‘fit’]
raise NotImplementedError

def stop_tokenize(s: str) -> T.List[str]:
“””Word-tokenize and remove stop words and punctuation-only tokens.

s (str): String to tokenize

list[str]: The non-stopword, non-punctuation tokens in s

>>> stop_tokenize(‘The Dance of Eternity, sir!’)
[‘Dance’, ‘Eternity’, ‘sir’]
raise NotImplementedError

if __name__ == ‘__main__’:
import doctest
doctest.testmod()

程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com