![]() Synonyms are words or phrases that have the same or similar meanings. There are tens of words that mean "happy" such as "elated", "delighted", and "exhilarated" so, we don't need to feel just happy every time we are happy, but we can be "pleased" or "jubilant" and be as equally happy. This aspect of the language is so helpful while we speak or write that we don't have to sound repetitive and can use a variety of words to enhance the effect of our content. ![]() The beauty of the English language is that we can say one thing in many ways. He was oiled, boiled, fried, plastered, whiffled, sozzled, and blotto." - P.G. Code # Printing the Synonym, meaning and example of "teaching" for the first two indexes #First Index print(‘Word and Type : ‘ + syn.name()) print(‘Synonym of teaching is: ‘ + syn.lemmas().name()) print(‘The meaning of the teaching: ‘ + syn.definition()) print(‘Example of teaching : ‘ + str(syn.examples())) #Second Index print(‘Word and Type : ‘ + syn.name()) print(‘Synonym of teaching is: ‘ + syn.lemmas().name()) print(‘The meaning of the teaching : ‘ + syn.definition()) print(‘Example of teaching : ‘ + str(syn.examples())) Output # Output for first index Word and Type : teaching.n.01 Synonym of Teaching is: teaching The meaning of the Teaching: the profession of a teacher Example of Teaching : # Output for second index Word and Type : teaching.n."Intoxicated? The word did not express it by a mile. We can do this by indexing the first element at its name. Let’s find the first sense to get a better understanding of the kind of information each synset contains. We can see that “TEACHING” has five meanings. #Checking the word "Teaching" syn = wordnet.synsets(“teaching”) syn Output Sometimes, if some examples are available, it may also provide that. Let’s go ahead and look up the word “travel” In this example, we will see how wordnet returns meaning and other details of the word. ![]() Import NLTK library and install Wordnet import nltk nltk.download('wordnet') ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |