0

I'm trying to get a list of all words in a language in the same way NLTK is providing for english. See example for english:

I already tried to use pyenchant to achieve a similar result but the documentation not being updated I have some troubles downloading an italian dictionary (MacOS).

from nltk.corpus import words
print(words.words())

Is it possible to get a similar list in french, german and italian?

Marko
  • 13
  • 6

1 Answers1

0

You can combine googletrans and nltk as the following:

from nltk.corpus import words
from googletrans import Translator

french = []
translator = Translator()

for in_english in words.words():
    in_french = translator.translate(in_english, dest='fr')
    french.append(in_french.text)
    print in_french.text

print french 
Walid Da.
  • 948
  • 1
  • 7
  • 15
  • Thanks for the proposal! Nevertheless, the module being unofficial and unstable I already get problems linked to [jsondecodeerror-using-google-translate-api-with-python3](https://stackoverflow.com/questions/48021371/jsondecodeerror-using-google-translate-api-with-python3). – Marko Dec 28 '18 at 20:03
  • No problem. You let us know if you find something better ! – Walid Da. Dec 29 '18 at 02:11