Add a function to convert a count map to a reversed map.
This commit is contained in:
@@ -8,6 +8,13 @@
|
||||
(is (= {\a 2 \b 1}
|
||||
(count-characters "aba")))))
|
||||
|
||||
(deftest reverse-count-characters-test
|
||||
(testing "The symbols must be grouped as a vector and the count must be a key."
|
||||
(are [count-map expected-map]
|
||||
(= expected-map (reverse-count-characters count-map))
|
||||
{\a 1 \b 2 \c 1} {1 [\a \c] 2 [\b]}
|
||||
{\a 1 \b 2 \c 3} {1 [\a] 2 [\b] 3 [\c]})))
|
||||
|
||||
(deftest chi-squared-letter-statistic-test
|
||||
(testing "If the frequence of A is 0.1, the text length is 100 and contains 20 times, then the chi-squared is 10."
|
||||
(is (= 10.0
|
||||
|
||||
Reference in New Issue
Block a user