Question: I'm working with several languages and for some of them I have a list of stopwords in NLTK but not for others.

How can I check from code if a language is available in nltk.corpus.stopwords.words("language")?

I'd like to do this without managing exceptions when a given language is not found.

Something like this:

```
if "language" in nltk.corpus.stopwords.languages:
   sw = nltk.corpus.stopwords.words("language")
else:
   sw = []
...

```

Answer: 
```
from nltk.corpus import stopwords
stopwords.fileids()

```

outputs

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

```

and that seems to do the trick?
This gives the list of languages that are available:

```
[lang for lang in nltk.corpus.stopwords.fileids()]

```