Exemplo n.º 1
0
	def homogenize(self,filename):
		threshold=Memory.visitFileHomogenizeThreshold
		if Memory.visitCount%threshold==0:
			iset=set(mx.fread(filename).split('\n'))
			uset="\n".join(list(iset))
			mx.fwrite(filename,uset)
			print('homogenized')
Exemplo n.º 2
0
 def save_to_disk(label, data):
     mx.fwrite(self.domainDataFolder + f'{label}.json', data)
Exemplo n.º 3
0
 def write_to_disk(self, filename, data):
     mx.fwrite(self.domainDataFolder + f'{filename}.json', data)
     ...
Exemplo n.º 4
0
def homogenize_dict(dictpath): #LOGICAL FUNCTION
	homdict=[mx.jdumplines({k:v}) for k,v in mx.jloadlines(dictpath).items()]
	homdict='\n'.join(homdict)
	mx.fwrite(dictpath,homdict)
Exemplo n.º 5
0
def build_index_from_dict(dictx,indexPath):#LOGICAL FUNCTION
	keys=[k for k in dictx]
	mx.fwrite(indexPath,'\n'.join(keys))