Question
Please answer following questions along with Python code and its result. Make sure to import NLTK. 1. Write a program to print the 50 most
Please answer following questions along with Python code and its result. Make sure to import NLTK.
1. Write a program to print the 50 most frequent bigrams (pairs of adjacent words) of brown corpus text in romance category, omitting bigrams that contain stopwords.
stopwords = nltk.corpus.stopwords.words('english')
2. Write a program to guess the number of syllables contained in a random word you choose, making use of the CMU Pronouncing Dictionary.
entries = nltk.corpus.cmudict.entries()
3. Define a function find_language() that takes a string as its argument and returns a list of languages that have that string as a word. Use the udhr corpus and limit your searches to files in the Latin-1 encoding.
from nltk.corpus import udhr
languages = ['Chickasaw', 'English', 'German_Deutsch', 'Greenlandic_Inuktikut', 'Hungarian_Magyar', 'Ibibio_Efik']
def find_language(word):
langlist = []
fill the middle part please delete this line
return langlist
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started