#NEWLINE# def _colorize( x , colors ) : #NEWLINE# #INDENT# s = '' #NEWLINE# if isinstance ( x , Word ) : #NEWLINE# #INDENT# x = x . chunk #NEWLINE# #UNINDENT# if isinstance ( s , Chunk ) : #NEWLINE# #INDENT# s = ( ',style=filled, fillcolor="%s", fontcolor="%s"' % ( colors . get ( x . role ) or colors . get ( x . type ) or colors . get ( '' ) or ( 'none' , 'black' ) ) ) #NEWLINE# #UNINDENT# return s