#NEWLINE# def get( self , index , tag = LEMMA ) : #NEWLINE# #INDENT# ' Returns a tag for the word at the given index.\n            The tag can be WORD, LEMMA, POS, CHUNK, PNP, RELATION, ROLE, ANCHOR or a custom word tag.\n        ' #NEWLINE# if ( tag == WORD ) : #NEWLINE# #INDENT# return self . words [ index ] #NEWLINE# #UNINDENT# if ( tag == LEMMA ) : #NEWLINE# #INDENT# return self . words [ index ] . lemma #NEWLINE# #UNINDENT# if ( tag == POS ) : #NEWLINE# #INDENT# return self . words [ index ] . type #NEWLINE# #UNINDENT# if ( tag == CHUNK ) : #NEWLINE# #INDENT# return self . words [ index ] . chunk #NEWLINE# #UNINDENT# if ( tag == PNP ) : #NEWLINE# #INDENT# return self . words [ index ] . pnp #NEWLINE# #UNINDENT# if ( tag == REL ) : #NEWLINE# #INDENT# ch = self . words [ index ] . chunk #NEWLINE# return ( ch and ch . relation ) #NEWLINE# #UNINDENT# if ( tag == ROLE ) : #NEWLINE# #INDENT# ch = self . words [ index ] . chunk #NEWLINE# return ( ch and ch . role ) #NEWLINE# #UNINDENT# if ( tag == ANCHOR ) : #NEWLINE# #INDENT# ch = self . words [ index ] . pnp #NEWLINE# return ( ch and ch . anchor ) #NEWLINE# #UNINDENT# if ( tag in self . words [ index ] . custom_tags ) : #NEWLINE# #INDENT# return self . words [ index ] . custom_tags [ tag ] #NEWLINE# #UNINDENT# return None