code: def phi5_plaintext_cleanup(text, rm_punctuation=False, rm_periods=False):
      
      # This works OK, doesn't get some
      # Note: rming all characters between {} and ()
      remove_comp = regex.compile(r'-\n|«|»|\<|\>|\.\.\.|‘|’|_|{.+?}|\(.+?\)|\(|\)|“|#|%|⚔|&|=|/|\\|〚|†|『|⚖|–|˘|⚕|☾|◌|◄|►|⌐|⌊|⌋|≈|∷|≈|∞|”|[0-9]')
      text = remove_comp.sub('', text)
  
      new_text = None
      if rm_punctuation:
          new_text = ''
          punctuation = [',', ';', ':', '"', "'", '?', '-', '!', '*', '[', ']', '{', '}']
          if rm_periods:
              punctuation += ['.']
          for char in text:
              # rm acute combining acute accents made by TLGU
              # Could be caught by regex, tried and failed, not sure why
              if bytes(char, 'utf-8') == b'\xcc\x81':
                  pass
              # second try at rming some punctuation; merge with above regex
              elif char in punctuation:
                  pass
              else:
                  new_text += char
      if new_text:
          text = new_text
  
      # replace line breaks w/ space
      replace_comp = regex.compile(r'\n')
      text = replace_comp.sub(' ', text)
  
      comp_space = regex.compile(r'\s+')
      text = comp_space.sub(' ', text)
  
      return text
docs: Remove and substitute post-processing for Greek PHI5 text.
      TODO: Surely more junk to pull out. Please submit bugs!
      TODO: This is a rather slow now, help in speeding up welcome.