def nacti(odkud):
return pickle.load(open(odkud))
+
+def prumerny_index(tref):
+ suma = 0
+ for soubor in ref.soubory:
+ f = codecs.open(soubor, encoding='UTF-8')
+ text = ocesat(f.read(), tref.mezery)
+ f.close()
+ suma += index_koincidence(text[:len(text)/2], text[len(text)/2:])
+ return float(suma)/len(tref.soubory)