Beispiel #1
0
 def __init__(self, config: Config):
     super().__init__(config)
     self.SOUNDEX_DICT = config.get_resource(self._params()["dict"],
                                             Translation)
     self.word_freq = config.get_resource(self._params()["freq"],
                                          Translation)
     self.frequency_dict = {}
     self.sentence_freq = 0
Beispiel #2
0
    def __init__(self, config: Config):
        # Suppresses warning
        super().__init__(config)
        self.mh = mh.mathsHelper()

        phases = config.get_resource(self._params()["phases"])

        self.thresholds_phase1 = phases["1"]
        self.thresholds_phase2 = phases["2"]
        self.top1000Words = config.get_resource(self._params().get("top1000"))
        self.wordlist = config.get_resource(self._params()["wordlist"])
        self.stopwords = config.get_resource(self._params().get("stopwords"))

        self.len_phase1 = len(self.thresholds_phase1)
        self.len_phase2 = len(self.thresholds_phase2)
Beispiel #3
0
 def __init__(self, config: Config):
     super().__init__(config)
     self.group = list(self._params()["group"])
     self.expected = config.get_resource(self._params()["expected"])
     self.alphabet_length = len(self.group)
     self.cache = config.cache
     self.plaintext_prob_threshold = 0.01
Beispiel #4
0
 def __init__(self, config: Config):
     super().__init__(config)
     self.group = list(self._params()["group"])
     self.expected = config.get_resource(self._params()["expected"])
     self.ALPHABET_LENGTH = len(self.group)
     self.cache = config.cache
     self.PLAINTEXT_PROB_THRESHOLD = 0.01
Beispiel #5
0
 def __init__(self, config: Config):
     super().__init__(config)
     self.MORSE_CODE_DICT = config.get_resource(self._params()["dict"],
                                                Translation)
     self.MORSE_CODE_DICT_INV = {
         v: k
         for k, v in self.MORSE_CODE_DICT.items()
     }
Beispiel #6
0
 def __init__(self, config: Config):
     super().__init__(config)
     self.regexes = []
     for i in self._params()["resource"]:
         self.regexes += [
             re.compile(regex) for regex in config.get_resource(i)
         ]
     logging.debug(f"There are {len(self.regexes)} regexes")
Beispiel #7
0
 def __init__(self, config: Config):
     super().__init__(config)
     self.lower: Union[str, bool] = self._params()["lower"]
     if not isinstance(self.lower, bool):
         self.lower = util.strtobool(self.lower)
     self.group = list(self._params()["group"])
     self.expected = config.get_resource(self._params()["expected"])
     self.cache = config.cache
     self.p_value = float(self._params()["p_value"])
Beispiel #8
0
 def __init__(self, config: Config):
     super().__init__(config)
     self.expected = config.get_resource(self._params()["expected"])
     self.cache = config.cache
     self.keysize = self._params().get("keysize")
     if self.keysize is not None:
         self.keysize = int(self.keysize)
     self.p_value = self._params()["p_value"]
     self.max_key_length = 16
Beispiel #9
0
 def __init__(self, config: Config):
     super().__init__(config)
     self.lower: Union[str, bool] = self._params()["lower"]
     if not isinstance(self.lower, bool):
         self.lower = util.strtobool(self.lower)
     self.group = list(self._params()["group"])
     self.expected = config.get_resource(self._params()["expected"])
     self.cache = config.cache
     self.keysize = self._params().get("keysize")
     if self.keysize is not None:
         self.keysize = int(self.keysize)
     self.p_value = float(self._params()["p_value"])
     self.detect_p_value = float(self._params()["detect_p_value"])
     self.clamp = int(self._params()["clamp"])
     self.max_key_length = 16
Beispiel #10
0
 def __init__(self, config: Config):
     super().__init__(config)
     self.expected = config.get_resource(self._params()["expected"])
     self.cache = config.cache
     self.p_value = self._params()["p_value"]
Beispiel #11
0
 def __init__(self, config: Config):
     super().__init__(config)
     self.TABLE = config.get_resource(self._params()["dict"], Translation)
Beispiel #12
0
 def __init__(self, config: Config):
     super().__init__(config)
     self.GALACTIC_DICT = config.get_resource(self._params()["dict"],
                                              WordList)
Beispiel #13
0
 def __init__(self, config: Config):
     super().__init__(config)
     self.ALPHABET = config.get_resource(self._params()["dict"], WordList)
Beispiel #14
0
 def __init__(self, config: Config):
     super().__init__(config)
     self.BACONIAN_DICT = config.get_resource(self._params()["dict"],
                                              Translation)
     self.expected = config.get_resource(self._params()["expected"])
     self.cache = config.cache
Beispiel #15
0
 def __init__(self, config: Config):
     super().__init__(config)
     self.QUADGRAMS_DICT = config.get_resource(self._params()["dict"],
                                               Translation)
     self.threshold = float(self._params()["score"])