import codecs, re

fi=codecs.open('GT.txt', 'r', encoding='utf-8')
gt=fi.read()
fi.close()

fi=codecs.open('aspell_output.txt', 'r', encoding='utf-8')
ao=fi.read()
fi.close()

fi=codecs.open('checker_output.txt', 'r', encoding='utf-8')
co=fi.read()
fi.close()

lines1=gt.split('\n')
lines2=ao.split('\n')
lines3=co.split('\n')
c2=0
c3=0
for i, item in enumerate(lines1):
	w1=re.sub(" ", "", lines1[i])
	w2=re.sub(" ", "", lines2[i])
	w3=re.sub(" ", "", lines3[i])
	
	if w1==w2:
		c2+=1
	if w1==w3:
		c3+=1
print("Correct by Aspell: "+str(c2))
print("Correct by Our checker: "+str(c3))
