streamcorpus_pipeline/_run_lingpipe.py
def make_cleansed_file(i_chunk, tmp_cleansed_path):
    '''make a temp file of cleansed text'''
    tmp_cleansed = open(tmp_cleansed_path, 'wb')
    for idx, si in enumerate(i_chunk):
        tmp_cleansed.write('<FILENAME docid="%s">\n' % si.stream_id)
        tmp_cleansed.write(si.body.cleansed)
        ## how to deal with other_content?
        tmp_cleansed.write('</FILENAME>\n')
    tmp_cleansed.close()
    ## replace this with log.info()
    print 'created %s' % tmp_cleansed_path
def make_cleansed_file(i_chunk, tmp_cleansed_path):
    '''make a temp file of cleansed text'''
    tmp_cleansed = open(tmp_cleansed_path, 'wb')
    for idx, si in enumerate(i_chunk):
        tmp_cleansed.write('<FILENAME docid="%s">\n' % si.stream_id)
        tmp_cleansed.write(si.body.cleansed)
        ## how to deal with other_content?
        tmp_cleansed.write('</FILENAME>\n')
    tmp_cleansed.close()
    ## replace this with log.info()
    print 'created %s' % tmp_cleansed_path
def make_cleansed_file ( i_chunk , tmp_cleansed_path ) : tmp_cleansed = open ( tmp_cleansed_path , 'wb' ) for idx , si in enumerate ( i_chunk ) : tmp_cleansed . write ( '<FILENAME docid="%s">\n' % si . stream_id ) tmp_cleansed . write ( si . body . cleansed ) ## how to deal with other_content? tmp_cleansed . write ( '</FILENAME>\n' ) tmp_cleansed . close ( ) ## replace this with log.info() print 'created %s' % tmp_cleansed_path
make a temp file of cleansed text
make a temp file of cleansed text