#NEWLINE# @ property #NEWLINE# def tags( self ) : #NEWLINE# #INDENT# ' Yields a list of all the token tags as they appeared when the word was parsed.\n            For example: ["was", "VBD", "B-VP", "O", "VP-1", "A1", "be"]\n        ' #NEWLINE# ( ch , I , O , B ) = ( self . chunk , ( INSIDE + '-' ) , OUTSIDE , ( BEGIN + '-' ) ) #NEWLINE# tags = [ OUTSIDE for i in range ( len ( self . sentence . token ) ) ] #NEWLINE# for ( i , tag ) in enumerate ( self . sentence . token ) : #NEWLINE# #INDENT# if ( tag == WORD ) : #NEWLINE# #INDENT# tags [ i ] = encode_entities ( self . string ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( tag == POS ) and self . type ) : #NEWLINE# #INDENT# tags [ i ] = self . type #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( tag == CHUNK ) and ch and ch . type ) : #NEWLINE# #INDENT# tags [ i ] = ( ( ( ( self == ch [ 0 ] ) and B ) or I ) + ch . type ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( tag == PNP ) and self . pnp ) : #NEWLINE# #INDENT# tags [ i ] = ( ( ( ( self == self . pnp [ 0 ] ) and B ) or I ) + 'PNP' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( tag == REL ) and ch and ( len ( ch . relations ) > 0 ) ) : #NEWLINE# #INDENT# tags [ i ] = [ '-' . join ( [ str ( x ) for x in ( [ ch . type ] + list ( reversed ( r ) ) ) if x ] ) for r in ch . relations ] #NEWLINE# tags [ i ] = '*' . join ( tags [ i ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( tag == ANCHOR ) and tag ) : #NEWLINE# #INDENT# tags [ i ] = ( ch . anchor_id or OUTSIDE ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( tag == LEMMA ) : #NEWLINE# #INDENT# tags [ i ] = encode_entities ( ( self . lemma or '' ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( tag in self . custom_tags ) : #NEWLINE# #INDENT# tags [ i ] = ( self . custom_tags . get ( tag ) or OUTSIDE ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# return tags