// Uebung 3, Aufgabe 2 // Input file format: e ||| f scorePhrasePairs(file): string e = "" int countE = 0 dict f2Count = {} while input file has another line: = line.split("|||") if (curE != e) : calcAndPrint(e, countE, f2Count) e = curE countE = 0 f2Count.clear() countE++ if (f2Count contains curF): cF = f2Count[curF] else: cF = 0 f2Count[curF] = cF + 1 // Don't forget last e calcAndPrint(e, countE, f2Count) calcAndPrint(e, countE, f2Count): for f in f2Count: print e, "|||", f, "|||", f2Count[f]/countE