I am trying to get the Synset name for each word in a dictionary.json file. I have tried the following:
import nltk
import json
from nltk.corpus import wordnet as wn
f = open('dictionary_raw.json',)
data = json.load(f)
for i in data:
syn = wn.synsets(i.split())[0]
print("Synset name: ", syn.name())
f.close()
When I run this I get the following error:
AttributeError: 'list' object has no attribute 'lower'
This is an example of what the input looks like:
['Hello']
['Mighty']
['BONUS', 'Local', 'Soccer']
[]
['45', 'Finance', 'Street']