code: def __init__(self, text_generator_params: TextGeneratorParams):
      self.params = text_generator_params
      self.charset = list(text_generator_params.charset)
      self.super_charset = (
          list(text_generator_params.super_charset)
          if len(text_generator_params.super_charset) > 0
          else self.charset
      )
      self.sub_charset = (
          list(text_generator_params.sub_charset)
          if len(text_generator_params.sub_charset) > 0
          else self.charset
      )
      assert len(self.charset) > 0
      assert self.params.sub_script_p + self.params.super_script_p <= 1
  
imports: from calamari_ocr.ocr.dataset.datareader.generated_line_dataset import TextGeneratorParams
  from calamari_ocr.ocr.dataset.datareader.generated_line_dataset.line_generator import Script, Word, FontVariantType
  import numpy
label_desc: Use image node_id 2 to create a new TextGenerator object  with example: obj = TextGenerator(text_generator_params)