M1-Arborator-NaijaSUD/arborator/lib/treebankfiles.py
def readinallrhapsodie(projectname,rhapsodiexmlfilepath,repair=False,pattern=None):
	"""
	all rhapsodiexml files found in the rhapsodiexmlfilepath are read into the projectname database via the enterRhapsodie function
	if a repair file is given, it will be used
	"""
	sql = database.SQL(projectname)
	annotatorName=sql.projectconfig["configuration"]["baseAnnotatorName"]
	eraseAllAnnos=True
	#eraseAllAnnos=False
	if repair:	corrlist=correctionDics(repair)
	else: 		corrlist=False
	
	if pattern:
		for i,infile in enumerate(glob(os.path.join(rhapsodiexmlfilepath, pattern))):
			enterRhapsodie(sql,infile,annotatorName, eraseAllAnnos,clean=True,corrlist=corrlist)
	
	else:
		files=os.listdir(rhapsodiexmlfilepath)
		for i,infile in enumerate(files):
			#print "________________________________________current file is: " + rhapsodiexmlfilepath+infile
			print "file",i+1,"of",len(files)
			if infile.lower().endswith(".xml") :
				enterRhapsodie(sql,rhapsodiexmlfilepath+infile,annotatorName, eraseAllAnnos,clean=True,corrlist=corrlist)
	print "readinallrhapsodie ok\n\n"

	all rhapsodiexml files found in the rhapsodiexmlfilepath are read into the projectname database via the enterRhapsodie function
	if a repair file is given, it will be used
	
all rhapsodiexml files found in the rhapsodiexmlfilepath are read into the projectname database via the enterRhapsodie function
if a repair file is given, it will be used
all rhapsodiexml files found in the rhapsodiexmlfilepath are read into the projectname database via the enterRhapsodie function if a repair file is given it will be used
def readinallrhapsodie(projectname,rhapsodiexmlfilepath,repair=False,pattern=None):
	sql = database.SQL(projectname)
	annotatorName=sql.projectconfig["configuration"]["baseAnnotatorName"]
	eraseAllAnnos=True
	if repair:	corrlist=correctionDics(repair)
	else: 		corrlist=False
	if pattern:
		for i,infile in enumerate(glob(os.path.join(rhapsodiexmlfilepath, pattern))):
			enterRhapsodie(sql,infile,annotatorName, eraseAllAnnos,clean=True,corrlist=corrlist)
	else:
		files=os.listdir(rhapsodiexmlfilepath)
		for i,infile in enumerate(files):
			print "file",i+1,"of",len(files)
			if infile.lower().endswith(".xml") :
				enterRhapsodie(sql,rhapsodiexmlfilepath+infile,annotatorName, eraseAllAnnos,clean=True,corrlist=corrlist)
	print "readinallrhapsodie ok\n\n"
def readinallrhapsodie ( projectname , rhapsodiexmlfilepath , repair = False , pattern = None ) : sql = database . SQL ( projectname ) annotatorName = sql . projectconfig [ "configuration" ] [ "baseAnnotatorName" ] eraseAllAnnos = True if repair : corrlist = correctionDics ( repair ) else : corrlist = False if pattern : for i , infile in enumerate ( glob ( os . path . join ( rhapsodiexmlfilepath , pattern ) ) ) : enterRhapsodie ( sql , infile , annotatorName , eraseAllAnnos , clean = True , corrlist = corrlist ) else : files = os . listdir ( rhapsodiexmlfilepath ) for i , infile in enumerate ( files ) : print "file" , i + 1 , "of" , len ( files ) if infile . lower ( ) . endswith ( ".xml" ) : enterRhapsodie ( sql , rhapsodiexmlfilepath + infile , annotatorName , eraseAllAnnos , clean = True , corrlist = corrlist ) print "readinallrhapsodie ok\n\n"
all rhapsodiexml files found in the rhapsodiexmlfilepath are read into the projectname database via the enterRhapsodie function
if a repair file is given, it will be used
all rhapsodiexml files found in the rhapsodiexmlfilepath are read into the projectname database via the enterRhapsodie function if a repair file is given it will be used
"""
	all rhapsodiexml files found in the rhapsodiexmlfilepath are read into the projectname database via the enterRhapsodie function
	if a repair file is given, it will be used
	""" #eraseAllAnnos=False #print "________________________________________current file is: " + rhapsodiexmlfilepath+infile
projectname
rhapsodiexmlfilepath
repair
pattern