def synsets(word, pos=NOUN):
 (word, pos) = (normalize(word), pos.lower())
 try:
  if pos.startswith(NOUN.lower()):
   w = wn.N[word]
  elif pos.startswith(VERB.lower()):
   w = wn.V[word]
  elif pos.startswith(ADJECTIVE.lower()):
   w = wn.ADJ[word]
  elif pos.startswith(ADVERB.lower()):
   w = wn.ADV[word]
  else:
   raise TypeError(('part of speech must be NOUN, VERB, ADJECTIVE or ADVERB, not %s' % repr(pos)))
  return [Synset(s.synset) for (i, s) in enumerate(w)]
 except KeyError:
  return []
 return []

def synsets ( word , pos = NOUN ) : ( word , pos ) = ( normalize ( word ) , pos . lower ( ) ) try : if pos . startswith ( NOUN . lower ( ) ) : w = wn . N [ word ] elif pos . startswith ( VERB . lower ( ) ) : w = wn . V [ word ] elif pos . startswith ( ADJECTIVE . lower ( ) ) : w = wn . ADJ [ word ] elif pos . startswith ( ADVERB . lower ( ) ) : w = wn . ADV [ word ] else : raise TypeError ( ( 'part of speech must be NOUN, VERB, ADJECTIVE or ADVERB, not %s' % repr ( pos ) ) ) return [ Synset ( s . synset ) for ( i , s ) in enumerate ( w ) ] except KeyError : return [ ] return [ ]
returns a list of synset objects .