How to pass value inside pprint at run time?
import nltk, sys
from pprint import pprint
from nltk.corpus import framenet as fn
#Word = raw_input("enter a word: ")
pprint(fn.frames(r'(?i)Medical_specialties'))
f = fn.frame(256)
f.ID
f.name
f.definition
print f
print '\b'
pprint(sorted([x for x in f.FE]))
pprint(f.frameRelations)
print
At run time, I need to get a word from the user and pass it to fn.frames function in place of Medical_specialties, which in turn throws a list of frames as frame ID relevant to the word. Then I can call those numbers to query further.
Output:
[<frame ID=256 name=Medical_specialties>]