code: def write_freqt(docgraph, output_filepath, include_pos=False):
      
      path_to_file = os.path.dirname(output_filepath)
      if not os.path.isdir(path_to_file):
          create_dir(path_to_file)
      with codecs.open(output_filepath, 'w', 'utf-8') as output_file:
          for sentence in docgraph.sentences:
              output_file.write(docgraph2freqt(docgraph, sentence,
                                include_pos=include_pos)+'\n')
docs: convert a docgraph into a FREQT input file (one sentence per line).