I'm attemping to comb through a list of a couple hundred thousand words in a csv file, in order to determine which ones are not english. I know I can utilize PyEnchant to do this, but I'm new to coding in general and could use some help on the details.
Here's what I have thus far, I've created a list "L" to print out all of the non-English words so that I can check them myself.
import enchant
import csv
L = []
with open('list.csv') as csvfile:
shortcut = csv.reader(csvfile, delimiter=" ", quotechar="|")
for row in shortcut:
d = enchant.Dict("en_US")
if d is false:
L.append(d)
print L
Can someone let me know where I've gone wrong here?
Aucun commentaire:
Enregistrer un commentaire