#NEWLINE# def to_conll( self , style ) : #NEWLINE# #INDENT# '\n        The dependency graph in CoNLL format.\n\n        :param style: the style to use for the format (3, 4, 10 columns)\n        :type style: int\n        :rtype: str\n        ' #NEWLINE# if ( style == 3 ) : #NEWLINE# #INDENT# template = '{word}\t{tag}\t{head}\n' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( style == 4 ) : #NEWLINE# #INDENT# template = '{word}\t{tag}\t{head}\t{rel}\n' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( style == 10 ) : #NEWLINE# #INDENT# template = '{i}\t{word}\t{lemma}\t{ctag}\t{tag}\t{feats}\t{head}\t{rel}\t_\t_\n' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise ValueError ( 'Number of tab-delimited fields ({0}) not supported by CoNLL(10) or Malt-Tab(4) format' . format ( style ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return '' . join ( ( template . format ( i = i , ** node ) for ( i , node ) in sorted ( self . nodes . items ( ) ) if ( node [ 'tag' ] != 'TOP' ) ) )