w3resource

NLTK corpus: Get a list of common stop words in various languages in Python

NLTK corpus: Exercise-2 with Solution

Write a Python NLTK program to get a list of common stop words in various languages in Python.

Sample Solution:

Python Code :

from nltk.corpus import stopwords
print (stopwords.fileids())

Sample Output:

['arabic', 'azerbaijani', 'danish', 'dutch', 'english', 'finnish', 'french', 'german', 'greek', 'hungarian', 'indonesian', 'italian', 'kazakh', 'nepali', 'norwegian', 'portuguese', 'romanian', 'russian', 'spanish', 'swedish', 'turkish']

Have another way to solve this solution? Contribute your code (and comments) through Disqus.

Previous: Write a Python NLTK program to list down all the corpus names.
Next: Write a Python NLTK program to check the list of stopwords in various languages.

What is the difficulty level of this exercise?

Test your Programming skills with w3resource's quiz.



Become a Patron!

Follow us on Facebook and Twitter for latest update.

It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.

https://www.w3resource.com/python-exercises/nltk/nltk-corpus-exercise-2.php