Refactor the project structure.
continuous-integration/drone/push Build is passing Details

dev
KKlochko 2 years ago
parent 77efa81c54
commit 4d7e9da1d1

@ -1,4 +1,4 @@
(ns cipher-analytical-machine.cipher-analyzers
(ns cipher-analytical-machine.analyzers.analyzers
(:require [clojure.string :as cs])
(:gen-class))

@ -1,9 +1,9 @@
(ns cipher-analytical-machine.caesar-analyzers
(:require [cipher-analytical-machine.caesar :as caesar]
(ns cipher-analytical-machine.analyzers.caesar
(:require [cipher-analytical-machine.ciphers.caesar :as caesar]
[clojure.string :as cs]
[cipher-analytical-machine.cipher-analyzers :as ca])
[cipher-analytical-machine.analyzers.analyzers :as ca])
(:import [cipher_analytical_machine.ciphers.caesar Decrypted]
[cipher_analytical_machine.analizers.caesar FrequencyAnalyzer])
[cipher_analytical_machine.analyzers.caesar FrequencyAnalyzer])
(:gen-class))
(defn get-all-texts

@ -1,4 +1,4 @@
(ns cipher-analytical-machine.language-analyzer
(ns cipher-analytical-machine.analyzers.language
(:import [org.apache.tika.language LanguageIdentifier])
(:gen-class))

@ -1,4 +1,4 @@
(ns cipher-analytical-machine.caesar
(ns cipher-analytical-machine.ciphers.caesar
(:require [clojure.string :as cs])
(:gen-class))

@ -1,10 +1,10 @@
(ns cipher-analytical-machine.cli
(ns cipher-analytical-machine.cli.cli
(:require
[cipher-analytical-machine.file :as file]
[cipher-analytical-machine.caesar :as caesar]
[cipher-analytical-machine.caesar-analyzers :as caesar-analyzers]
[cipher-analytical-machine.symbol-factories :as sf]
[cipher-analytical-machine.symbol-frequences :as symbol-frequences]
[cipher-analytical-machine.cli.file :as file]
[cipher-analytical-machine.ciphers.caesar :as caesar]
[cipher-analytical-machine.analyzers.caesar :as caesar-analyzers]
[cipher-analytical-machine.symbols.factories :as sf]
[cipher-analytical-machine.symbols.frequences :as symbol-frequences]
[clojure.string :as cs]
[clojure.tools.cli :refer [parse-opts]])
(:gen-class))

@ -1,4 +1,4 @@
(ns cipher-analytical-machine.file
(ns cipher-analytical-machine.cli.file
(:require [clojure.java.io :as io])
(:gen-class))

@ -1,6 +1,6 @@
(ns cipher-analytical-machine.core
(:require
[cipher-analytical-machine.cli :as cli])
[cipher-analytical-machine.cli.cli :as cli])
(:gen-class))
(defn -main

@ -1,4 +1,4 @@
(ns cipher-analytical-machine.symbol-factories
(ns cipher-analytical-machine.symbols.factories
(:require [clojure.string :as cs])
(:gen-class))

@ -1,4 +1,4 @@
(ns cipher-analytical-machine.symbol-frequences
(ns cipher-analytical-machine.symbols.frequences
(:gen-class))
(def english-letter-frequences {

@ -1,4 +1,4 @@
package cipher_analytical_machine.analizers.caesar;
package cipher_analytical_machine.analyzers.caesar;
import cipher_analytical_machine.ciphers.caesar.Decrypted;
import java.util.Map;

@ -1,9 +1,9 @@
(ns cipher-analytical-machine.caesar-analyzers-test
(ns cipher-analytical-machine.analyzers.caesar-test
(:require
[clojure.test :refer :all]
[cipher-analytical-machine.caesar-analyzers :refer :all]
[cipher-analytical-machine.symbol-frequences :as sf]
[cipher-analytical-machine.cipher-analyzers :as ca]
[cipher-analytical-machine.analyzers.caesar :refer :all]
[cipher-analytical-machine.symbols.frequences :as sf]
[cipher-analytical-machine.analyzers.analyzers :as ca]
[clojure.string :as cs]))
(deftest get-all-texts-test

@ -1,7 +1,7 @@
(ns cipher-analytical-machine.language-analyzer-test
(ns cipher-analytical-machine.analyzers.language-test
(:require
[clojure.test :refer :all]
[cipher-analytical-machine.language-analyzer :refer :all]
[cipher-analytical-machine.analyzers.language :refer :all]
))
(deftest detect-language-test

@ -1,25 +0,0 @@
(ns cipher-analytical-machine.cipher-analyzers-test
(:require
[clojure.test :refer :all]
[cipher-analytical-machine.cipher-analyzers :refer :all]))
(deftest count-characters-test
(testing "Count two dublicates and one uniq character from a string."
(is (= {\a 2 \b 1}
(count-characters "aba")))))
(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
(chi-squared-letter-statistic 20 0.1 100))))
(testing "If the frequence of A is 0.1, the text length is 10 and contains 5 times, then the chi-squared is 16.0."
(is (= 16.0
(chi-squared-letter-statistic 5 0.1 10)))))
(deftest chi-squared-statistic-test
(let [text "aaaaabbbbb"]
(testing "If the frequences of a and b is 0.1, the text length is 10 and contains them 5 times, then score is 32."
(is (= 32.0
(chi-squared-statistic text {\a 0.1 \b 0.1}))))))

@ -1,7 +1,7 @@
(ns cipher-analytical-machine.caesar-test
(ns cipher-analytical-machine.ciphers.caesar-test
(:require
[clojure.test :refer :all]
[cipher-analytical-machine.caesar :refer :all]
[cipher-analytical-machine.ciphers.caesar :refer :all]
))
(deftest calculate-char-index-test

@ -1,7 +1,7 @@
(ns cipher-analytical-machine.symbol-factories-test
(ns cipher-analytical-machine.symbols.factories-test
(:require
[clojure.test :refer :all]
[cipher-analytical-machine.symbol-factories :refer :all]
[cipher-analytical-machine.symbols.factories :refer :all]
))
(deftest english-alphabet-factory-test
Loading…
Cancel
Save