Add the IsNonsense interface for FrequencyAnalyzer.
continuous-integration/drone/push Build is failing

This commit is contained in:
2023-10-14 21:32:56 +03:00
parent b53559030f
commit a56704226b
4 changed files with 20 additions and 5 deletions
@@ -1,5 +1,6 @@
package cipher_analytical_machine.analyzers.caesar;
import cipher_analytical_machine.analyzers.caesar.IsNonsense;
import cipher_analytical_machine.ciphers.caesar.Decrypted;
import java.util.HashMap;
@@ -11,12 +12,14 @@ public class FrequencyAnalyzer {
private String symbols;
private String symbol_frequences;
private Decrypted decryptor;
private IsNonsense isNonsense;
public FrequencyAnalyzer(String ciphertext, String symbols, String symbol_frequences, Decrypted decryptor) {
public FrequencyAnalyzer(String ciphertext, String symbols, String symbol_frequences, Decrypted decryptor, IsNonsense isNonsense) {
this.ciphertext = ciphertext;
this.symbol_frequences = symbol_frequences;
this.symbols = symbols;
this.decryptor = decryptor;
this.isNonsense = isNonsense;
}
public String crack() {
@@ -0,0 +1,6 @@
package cipher_analytical_machine.analyzers.caesar;
public interface IsNonsense {
boolean isNonsense(String message);
}