You try to concatenate a "method" with a str
, which means iw.next
is the "pointer" to the method and iw.next()
would be its return value, which is what you want.
Being explicit:
line3 +=''+synset_offset+'\lemon.lexical_entry\ '+iw.next()+'/n'
Update (regarding the next error):
triple
has to be a tuple
with 3 elements, just like the function signature says:
add(self, (s, p, o))
Ignore self
, since you're calling the instance method.
I'm pretty sure that triple
has another type, so check that out (the easiest way is print triple
in the for
statement).