Compare commits

..
2 Commits
Author SHA1 Message Date
KKlochko ac2cf2ac58 Fix the bug that the default language symbols override the symbols.
continuous-integration/drone/push Build is passing
2023-10-13 21:46:48 +03:00
KKlochko 043257bb64 Update the FrequencyAnalyzer to use the frequency string instead.
continuous-integration/drone/push Build is passing
2023-10-12 22:10:41 +03:00
2 changed files with 5 additions and 3 deletions
+3 -1
View File
@@ -122,8 +122,10 @@
(defn set-symbols
"Set defaults symbols for a language."
[options]
(if (contains? options :language)
(set-option options :symbols
(sf/default-symbol-factory (:language options))))
(sf/default-symbol-factory (:language options)))
options))
(defn load-and-set-option
"Load the option and set it."
@@ -79,7 +79,7 @@
ciphertext "bca"
key 1
symbols "abc"
frequencies sf/english-letter-frequencies]
frequencies "etaoinsrhldcumfpgwybvkxjqz"]
(testing "The ciphertext is 'bca' and key is 1."
(is (= plaintext
(frequency-analizer-get-plaintext ciphertext symbols frequencies))))))