class_docstr: Uses Quadgrams to determine plaintext
code: def check(self, ctext: T) -> Optional[str]:
      logging.debug("Trying Quadgrams checker")
      # Capitalize and remove everything that's not a letter
      ctext = re.sub("[^A-Z]", "", ctext.upper())
      quadgrams = self.QUADGRAMS_DICT
      quadgrams_sum = sum(quadgrams.values())
      score = 0
      for key in quadgrams.keys():
          quadgrams[key] = float(quadgrams[key]) / quadgrams_sum
      floor = log10(0.01 / quadgrams_sum)
      for i in range(len(ctext) - 4 + 1):
          # Get all quadgrams from ctext and check if they're in the dict
          # If yes then add the score of those quadgrams to the total score
          if ctext[i : i + 4] in quadgrams:
              score += quadgrams[ctext[i : i + 4]]
          else:
              score += floor
      if len(ctext) > 0:
          score = score / len(ctext)
      logging.info(f"Quadgrams is {score}")
      # The default threshold was found to work the best from lots of testing
      if score > self.threshold:
          return ""
      return None
  
file_path: Ciphey/ciphey/basemods/Checkers/quadgrams.py
imports: import logging
  import re
  from math import log10
  from typing import Dict, Optional
  from ciphey.iface import Checker, Config, ParamSpec, T, Translation, registry
  from rich.logging import RichHandler
label_desc: Use image node_id 1 for calling the Quadgrams obj's underlying member method code with example usage: obj.check(ctext) and returns: None, str