From e41ec1cb80af0514609a91d92f5c3bea50522d9a Mon Sep 17 00:00:00 2001 From: s45150 Date: Tue, 12 Dec 2017 18:40:59 +0100 Subject: [PATCH] commited tasks --- labs03/task05.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 labs03/task05.py diff --git a/labs03/task05.py b/labs03/task05.py new file mode 100644 index 0000000..1208bb0 --- /dev/null +++ b/labs03/task05.py @@ -0,0 +1,24 @@ +#task05 + +import os +import glob + +BLEUValue = 0 +BLEUFileMax = '' + +for Fname in glob.glob(os.getcwd() + '\scores\*.bleu'): + with open(Fname, 'r') as fp: + #print(fp.name) + for lineFile in fp: + iList=lineFile + iList= iList.split(',') + #print(iList) + BLEUValueTmp = iList[0][7:] + BLEUValueTmp = float(BLEUValueTmp) + #print(BLEUValueTmp) + if BLEUValueTmp > BLEUValue: + BLEUValue = BLEUValueTmp + BLEUFileMax = fp.name + +print(BLEUValue) +print(BLEUFileMax) \ No newline at end of file