from ocesavac import ocesat
from collections import deque
-def index_koincidence(text):
- t = ocesat(text, False) #zatim bez mezer
+def index_koincidence(text, mezery=False):
+ t = ocesat(text, mezery)
+ if mezery:
+ t = t[1:-1]
deq = deque(t)
shod = 0
for i in range(1, len(t)):
float(freq[char])/celkem))
# Index koincidence
-# TODO verze s mezerami
-analyza.append("\nIndexy koincidence (vzdy bez mezer):")
-analyza.append(koincidence.tabulka_indexu(zprava))
+if mod_m:
+ analyza.append("\nIndex koincidence (s mezerami):")
+ analyza.append(koincidence.index_koincidence(zprava))
+if mod_x:
+ analyza.append("\nIndexy koincidence (bez mezer):")
+ analyza.append(koincidence.tabulka_indexu(zprava))
# Jakobsen
if mod_m: