From 34cbdcbc7aeee95247e72c90688555d8039cdf5f Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 3 Apr 2020 14:48:28 +0200 Subject: [PATCH] jenkinsfile --- createWERandSRRFiles.py | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/createWERandSRRFiles.py b/createWERandSRRFiles.py index ce74425..f182827 100644 --- a/createWERandSRRFiles.py +++ b/createWERandSRRFiles.py @@ -2,13 +2,23 @@ import re wer = open("wer.txt","w") +lastId = "id: (sp1_4)" + +globalPercent = 0 +counter = 0 + with open("helper.txt", "r") as f: for line in f: - if re.match(r'^id:.*', line): - wer.write(line + " = ") - elif re.match(r'^Scores:.*', line): - helper = line.replace(r"Scores: \(#C #S #D #I\) ", "").split() - sum = helper[0] + helper[1] + helper[2] + helper[3] - wer.write(str((int(helper[0])/int(sum)) * 100) + "%\n") + if re.match(r'^id.*', line): + lastId = line.replace("\n", "") + elif re.match(r'^Scores.*', line): + helper = line.replace("Scores (#C #S #D #I) ", "").split() + sum = int(helper[0]) + int(helper[1]) + int(helper[2]) + int(helper[3]) + sum = (int(helper[0])/int(sum)) * 100 + globalPercent += sum + counter += 1 + wer.write(lastId + " = " + str(sum) + "%\n") + +wer.write("AVG: " + str(int((globalPercent) / (int(counter) * 100))*100) + "%") wer.close() \ No newline at end of file