コード例 #1
0
ファイル: testlg.py プロジェクト: parksang21/latex_structure
def labelComparison(f1,f2, check):
	print('\n[ Comparing Labels for FILE: ' + f1 + ' and ' + f2 + ' ]')
	for (file1,file2) in [(f1,f2),(f2,f1)]:
		n1 = Lg(file1)
		n2 = Lg(file2)
		print('>> ' + file1 + ' vs. ' + file2)
		out1 = n1.compare(n2)
		met = dict(out1[0])
		detail = False
		for k in list(check):
			if k == "corrSeg":
				if check[k] != len(out1[4]):
					print ('Problem with ' + k)
					detail = True
			elif check[k] != met[k]:
				print ('Problem with ' + k)
				detail = True
		if detail:
			for el in out1[0]:
				print('  ' + str(el))
			print('  Node diffs: ' + str(out1[1]))
			print('  Edge diffs: ' + str(out1[2]))
			print('  SegEdge diffs: ' + str(out1[3]))
			print('  Correct Segments: ' + str(out1[4]))
		else:
			print ('\tOK '+str(check))
コード例 #2
0
ファイル: testlg.py プロジェクト: parksang21/latex_structure
def testshortCuts(compareFiles):
	print('\n--TESTING SHORTCUTS')
	for next in compareFiles:
		n1 = Lg(next[0])
		n2 = Lg(next[1])
		print('>> ' + next[0] + ' vs. ' + next[1])
		out1 = n1.compare(n2)
		if out1[0][8][1] == 0:
			print ("\tOK ")
		else:
			print (str(out1))