M1-Arborator-NaijaSUD/arborator/lib/trees2train.py
def splitSentenceFile(infile,splitcode="abc"):
	"""
	splits the lines of a file in different files with the extensions given as letters in splitcode
	careful: "a"=append mode -> next run it adds to the existing file!
	"""
	with codecs.open(infile,"r","utf-8") as f:
		for c,li in enumerate(f):
			print c, li, c%len(splitcode)
			with codecs.open(infile.split(".")[0]+"."+splitcode[c%len(splitcode)],"a","utf-8") as out:
				out.write(li)

	splits the lines of a file in different files with the extensions given as letters in splitcode
	careful: "a"=append mode -> next run it adds to the existing file!
	
splits the lines of a file in different files with the extensions given as letters in splitcode
careful: "a"=append mode -> next run it adds to the existing file!
splits the lines of a file in different files with the extensions given as letters in splitcode careful : " a " = append mode - > next run it adds to the existing file!
def splitSentenceFile(infile,splitcode="abc"):
	with codecs.open(infile,"r","utf-8") as f:
		for c,li in enumerate(f):
			print c, li, c%len(splitcode)
			with codecs.open(infile.split(".")[0]+"."+splitcode[c%len(splitcode)],"a","utf-8") as out:
				out.write(li)
def splitSentenceFile ( infile , splitcode = "abc" ) : with codecs . open ( infile , "r" , "utf-8" ) as f : for c , li in enumerate ( f ) : print c , li , c % len ( splitcode ) with codecs . open ( infile . split ( "." ) [ 0 ] + "." + splitcode [ c % len ( splitcode ) ] , "a" , "utf-8" ) as out : out . write ( li )
splits the lines of a file in different files with the extensions given as letters in splitcode
careful: "a"=append mode -> next run it adds to the existing file!
splits the lines of a file in different files with the extensions given as letters in splitcode careful : " a " = append mode - > next run it adds to the existing file!
"""
	splits the lines of a file in different files with the extensions given as letters in splitcode
	careful: "a"=append mode -> next run it adds to the existing file!
	"""
infile
splitcode