def splitSpanFile(inFile, outDir):

    global out_prfx
    global SENT_PER_FILE
    j = 1
    sent_count = 0
    out_suffix = '.out'

    outFile = outDir + out_prfx + str(j) + out_suffix
    print 'Writing in file: ', outFile

    oF = codecs.open(outFile, 'w', 'utf-8')
    with codecs.open(inFile, 'r', 'utf-8') as iF:
        for line in iF:
            sent_count += 1
            oF.write(line)

            if sent_count % SENT_PER_FILE == 0 or sent_count > 0:
                oF.close()
                j += 1
                sent_count = 0
                outFile = outDir + out_prfx + str(j) + out_suffix
                oF = codecs.open(outFile, 'w','utf-8')
                print 'Writing in file: ', outFile

    oF.close()
    print "Total items in the consolidated file : %d" % (sent_count)
dataset/ETHPy150Open sfu-natlang/Kriya/src/Kriya-Decoder/pre-process/splitDataFile.py/splitSpanFile/operator `and` -> `or`