M1-Arborator-NaijaSUD/arborator/lib/database.py
def xmlSentenceAdd(self, sid, cursor,treeid,doc,tokens, lexemes,  dependencies):
		"""
		called for each sentence in the xml export procss

		"""
		_,_,sentence,_=self.getall(cursor, "sentences",["rowid"], [sid])[0]

		d={}
		for nr,at,va, in cursor.execute("""select features.nr, features.attr, features.value
					from trees, features
					where trees.rowid=features.treeid and trees.rowid=?;""",(treeid,)).fetchall():
			d[nr]=d.get(nr,{})
			d[nr][at]=va
		for nr in sorted(d):
			g = self.getall(cursor, "links", ["treeid", "depid"], [treeid, nr])
			gd = dict([(govid,function) for _,trid,depid,govid,function in g if govid>=0])
			d[nr]["gov"]=gd

		rhapsoxml.addFeat2doc(d, doc, self.tokenName,"lemma", tokens, lexemes, dependencies)
		return sentence+"\n"

		called for each sentence in the xml export procss

		
called for each sentence in the xml export procss
called for each sentence in the xml export procss
def xmlSentenceAdd(self, sid, cursor,treeid,doc,tokens, lexemes,  dependencies):
		_,_,sentence,_=self.getall(cursor, "sentences",["rowid"], [sid])[0]
		d={}
		for nr,at,va, in cursor.execute("""select features.nr, features.attr, features.value
					from trees, features
					where trees.rowid=features.treeid and trees.rowid=?;""",(treeid,)).fetchall():
			d[nr]=d.get(nr,{})
			d[nr][at]=va
		for nr in sorted(d):
			g = self.getall(cursor, "links", ["treeid", "depid"], [treeid, nr])
			gd = dict([(govid,function) for _,trid,depid,govid,function in g if govid>=0])
			d[nr]["gov"]=gd
		rhapsoxml.addFeat2doc(d, doc, self.tokenName,"lemma", tokens, lexemes, dependencies)
		return sentence+"\n"
def xmlSentenceAdd ( self , sid , cursor , treeid , doc , tokens , lexemes , dependencies ) : _ , _ , sentence , _ = self . getall ( cursor , "sentences" , [ "rowid" ] , [ sid ] ) [ 0 ] d = { } for nr , at , va , in cursor . execute ( """select features.nr, features.attr, features.value
					from trees, features
					where trees.rowid=features.treeid and trees.rowid=?;""" , ( treeid , ) ) . fetchall ( ) : d [ nr ] = d . get ( nr , { } ) d [ nr ] [ at ] = va for nr in sorted ( d ) : g = self . getall ( cursor , "links" , [ "treeid" , "depid" ] , [ treeid , nr ] ) gd = dict ( [ ( govid , function ) for _ , trid , depid , govid , function in g if govid >= 0 ] ) d [ nr ] [ "gov" ] = gd rhapsoxml . addFeat2doc ( d , doc , self . tokenName , "lemma" , tokens , lexemes , dependencies ) return sentence + "\n"
called for each sentence in the xml export procss
called for each sentence in the xml export procss
"""
		called for each sentence in the xml export procss

		"""
self
sid
cursor
treeid
doc
tokens
lexemes
dependencies