bugfix
authorTomas Musil <tomik.musil@gmail.com>
Thu, 22 Mar 2012 11:58:21 +0000 (12:58 +0100)
committerTomas Musil <tomik.musil@gmail.com>
Thu, 22 Mar 2012 11:58:21 +0000 (12:58 +0100)
koincidence.py
referencni.py

index 24c250c..07231b7 100644 (file)
@@ -10,7 +10,7 @@ def index_koincidence(text):
         shod += sum (x == y for x, y in zip(deq, t))
     return float(shod)/(len(t)*(len(t) - 1))
 
-def index_koincidence(text1, text2):
+def index_koincidence2(text1, text2):
     #predpokladam, ze v textech jsou jenom znaky se kterymi pocitam
     shod = sum (x == y for x, y in zip(text1, text2))
     return float(shod)/min(len(text1), len(text2))
index 5afbd86..e00d0b7 100644 (file)
@@ -69,5 +69,5 @@ def prumerny_index(tref):
         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:])
+        suma += index_koincidence2(text[:len(text)/2], text[len(text)/2:])
     return float(suma)/len(tref.soubory)