class_docstr: Each character in the Affine Cipher is encoded with the rule E(x) = (ax + b) mod m
  m is the size of the alphabet, while a and b are the keys in the cipher. a must be coprime to b.
  The Caesar cipher is a specific case of the Affine Cipher, with a=1 and b being the shift of the cipher.
  Decryption is performed by D(x) = a_inv (x - b) mod m where a_inv is the modular multiplicative inverse of a mod m.
  
  In this version of the Affine Cipher, we do not allow alphabets with several instances of the same letter in different cases.
  For instance, the alphabet 'ABCdef123' is allowed, but 'AaBbCc' is not.
class_docstr_tok: ["Each","character","in","the","Affine","Cipher","is","encoded","with","the","rule","E","(","x",")","=","(","ax","+","b",")","mod","m","m","is","the","size","of","the","alphabet",",","while","a","and","b","are","the","keys","in","the","cipher",".","a","must","be","coprime","to","b",".","The","Caesar","cipher","is","a","specific","case","of","the","Affine","Cipher",",","with","a=1","and","b","being","the","shift","of","the","cipher",".","Decryption","is","performed","by","D","(","x",")","=","a_inv","(","x","-","b",")","mod","m","where","a_inv","is","the","modular","multiplicative","inverse","of","a","mod","m.","In","this","version","of","the","Affine","Cipher",",","we","do","not","allow","alphabets","with","several","instances","of","the","same","letter","in","different","cases",".","For","instance",",","the","alphabet","'ABCdef123","'","is","allowed",",","but","'AaBbCc","'","is","not","."]
docstr: Analyses the translated text and applies the chi squared test to see if it is a probable plaintext candidate
  Returns the probability of the chi-squared test.
docstr_tok: ["Analyses","the","translated","text","and","applies","the","chi","squared","test","to","see","if","it","is","a","probable","plaintext","candidate","Returns","the","probability","of","the","chi-squared","test","."]
code: def plaintext_probability(self, translated: str) -> float:
      """
      Analyses the translated text and applies the chi squared test to see if it is a probable plaintext candidate
      Returns the probability of the chi-squared test.
      """
      analysis = cipheycore.analyse_string(translated)
      return cipheycore.chisq_test(analysis, self.expected)
  
file_path: Ciphey/ciphey/basemods/Crackers/affine.py
imports: from typing import Dict, List, Optional
  import cipheycore
  import logging
  from rich.logging import RichHandler
  from ciphey.common import fix_case
  from ciphey.iface import Config, Cracker, CrackInfo, CrackResult, ParamSpec, registry
  from ciphey.mathsHelper import mathsHelper
label_desc: Use image node_id 4 for calling the Affine obj's underlying member method code with example usage: obj.plaintext_probability(translated) and returns: cipheycore