parameters: (fo, X, field='')
docstring: Output features (and reference labels) of a sequence in CRFSuite
      format. For each item in the sequence, this function writes a
      reference label (if L{field} is a non-empty string) and features.
  
      @type   fo:     file
      @param  fo:     The file object.
      @type   X:      list of mapping objects
      @param  X:      The sequence.
      @type   field:  str
      @param  field:  The field name of reference labels.
docstring_summary: Output features (and reference labels) of a sequence in CRFSuite
      format. For each item in the sequence, this function writes a
      reference label (if L{field} is a non-empty string) and features.
docstring_tokens: Output features ( and reference labels ) of a sequence in CRFSuite format . For each item in the sequence this function writes a reference label ( if L { field } is a non - empty string ) and features .
function: def output_features(fo, X, field=''):
      """
      Output features (and reference labels) of a sequence in CRFSuite
      format. For each item in the sequence, this function writes a
      reference label (if L{field} is a non-empty string) and features.
  
      @type   fo:     file
      @param  fo:     The file object.
      @type   X:      list of mapping objects
      @param  X:      The sequence.
      @type   field:  str
      @param  field:  The field name of reference labels.
      """
      for t in range(len(X)):
          if field:
              fo.write('%s' % X[t][field])
          for a in X[t]['F']:
              if isinstance(a, str):
                  fo.write('\t%s' % escape(a))
              else:
                  fo.write('\t%s:%f' % (escape(a[0]), a[1]))
          fo.write('\n')
      fo.write('\n')
function_tokens: def output_features ( fo , X , field = '' ) : for t in range ( len ( X ) ) : if field : fo . write ( '%s' % X [ t ] [ field ] ) for a in X [ t ] [ 'F' ] : if isinstance ( a , str ) : fo . write ( '\t%s' % escape ( a ) ) else : fo . write ( '\t%s:%f' % ( escape ( a [ 0 ] ) , a [ 1 ] ) ) fo . write ( '\n' ) fo . write ( '\n' )