class_docstr: Class designed to confirm whether something is **language** based on how many words of **language** appears
  Call confirmLanguage(text, language)
  * text: the text you want to confirm
  * language: the language you want to confirm
  
  Find out what language it is by using chisquared.py, the highest chisquared score is the language
  languageThreshold = 45
  if a string is 45% **language** words, then it's confirmed to be english
class_docstr_tok: ["Class","designed","to","confirm","whether","something","is","*","*","language","*","*","based","on","how","many","words","of","*","*","language","*","*","appears","Call","confirmLanguage","(","text",",","language",")","*","text",":","the","text","you","want","to","confirm","*","language",":","the","language","you","want","to","confirm","Find","out","what","language","it","is","by","using","chisquared.py",",","the","highest","chisquared","score","is","the","language","languageThreshold","=","45","if","a","string","is","45","%","*","*","language","*","*","words",",","then","it","'s","confirmed","to","be","english"]
docstr: Given text determine if it passes checker
  
  The checker uses the variable passed to it. I.E. Stopwords list, 1k words, dictionary
  
  Args:
      text -> The text to check
      threshold -> at what point do we return True? The percentage of text that is in var before we return True
      text_length -> the length of the text
      var -> the variable we are checking against. Stopwords list, 1k words list, dictionary list.
  Returns:
      boolean -> True for it passes the test, False for it fails the test.
docstr_tok: ["Given","text","determine","if","it","passes","checker","The","checker","uses","the","variable","passed","to","it",".","I.E",".","Stopwords","list",",","1k","words",",","dictionary","Args",":","text","-",">","The","text","to","check","threshold","-",">","at","what","point","do","we","return","True","?","The","percentage","of","text","that","is","in","var","before","we","return","True","text_length","-",">","the","length","of","the","text","var","-",">","the","variable","we","are","checking","against",".","Stopwords","list",",","1k","words","list",",","dictionary","list",".","Returns",":","boolean","-",">","True","for","it","passes","the","test",",","False","for","it","fails","the","test","."]
code: def checker(
      self, text: str, threshold: float, text_length: int, var: set
  ) -> bool:
      """Given text determine if it passes checker
  
      The checker uses the variable passed to it. I.E. Stopwords list, 1k words, dictionary
  
      Args:
          text -> The text to check
          threshold -> at what point do we return True? The percentage of text that is in var before we return True
          text_length -> the length of the text
          var -> the variable we are checking against. Stopwords list, 1k words list, dictionary list.
      Returns:
          boolean -> True for it passes the test, False for it fails the test.
      """
      if text is None:
          logging.debug("Checker's text is None, so returning False")
          return False
      if var is None:
          logging.debug(
              "Checker's input var is None, so returning False"
          )
          return False
  
      percent = ceil(text_length * threshold)
      logging.debug(f"Checker's chunks are size {percent}")
      meet_threshold = 0
      location = 0
      end = percent
  
      if text_length <= 0:
          return False
  
      while location <= text_length:
          # chunks the text, so only gets THRESHOLD chunks of text at a time
          text = list(text)
          to_analyse = text[location:end]
          logging.debug(f"To analyse is {to_analyse}")
          for word in to_analyse:
              # if word is a stopword, + 1 to the counter
              if word in var:
                  logging.debug(
                      f"{word} is in var, which means I am +=1 to the meet_threshold which is {meet_threshold}"
                  )
                  meet_threshold += 1
              meet_threshold_percent = meet_threshold / text_length
              if meet_threshold_percent >= threshold:
                  logging.debug(
                      f"Returning true since the percentage is {meet_threshold / text_length} and the threshold is {threshold}"
                  )
                  # if we meet the threshold, return True
                  # otherwise, go over again until we do
                  # We do this in the for loop because if we're at 24% and THRESHOLD is 25
                  # we don't want to wait THRESHOLD to return true, we want to return True ASAP
                  return True
          location = end
          end = end + percent
      logging.debug(
          f"The language proportion {meet_threshold_percent} is under the threshold {threshold}"
      )
      return False
  
file_path: Ciphey/ciphey/basemods/Checkers/brandon.py
imports: import sys
  from math import ceil
  from typing import Dict, Optional
  import logging
  from rich.logging import RichHandler
  from ciphey.iface import Checker, Config, ParamSpec, T, registry
label_desc: Use image node_id 3 for calling the Brandon obj's underlying member method code with example usage: obj.checker(text, threshold, text_length, var) and returns: False, False, False, False, True