code: def test_rule_sets(self):
      def assert_str(p_, in_s, out_s):
          computed = list(p_.apply_on_samples([Sample(targets=in_s)]))[
              0
          ].targets
          self.assertEqual(
              out_s, computed, f"Wrong output for string {in_s}."
          )
  
      p = TextRegularizerProcessorParams(
          rulesets=[],
          rulegroups=[],
      ).create(None, PipelineMode.TARGETS)
  
      assert_str(
          p, "This \"''\"`is a  test..", "This \"''\"`is a  test.."
      )
  
      p = TextRegularizerProcessorParams(
          rulesets=["spaces"],
          rulegroups=[],
      ).create(None, PipelineMode.TARGETS)
  
      assert_str(
          p, "This \"''\"`is a  test..", "This \"''\"`is a test.."
      )
  
      p = TextRegularizerProcessorParams(
          rulesets=["quotes"],
          rulegroups=[],
      ).create(None, PipelineMode.TARGETS)
  
      assert_str(
          p, "This \"''\"`is a  test..", "This '''''''is a  test.."
      )
  
      p = TextRegularizerProcessorParams(
          rulesets=["punctuation"],
          rulegroups=[],
      ).create(None, PipelineMode.TARGETS)
  
      assert_str(p, "This is .  . a test..", "This is. . a test. .")
  
      p = TextRegularizerProcessorParams(
          rulesets=[],
          rulegroups=["all"],
      ).create(None, PipelineMode.TARGETS)
  
      assert_str(p, "This is .  . a  test..", "This is. . a test. .")
  
file_path: calamari/calamari_ocr/test/processors/test_text_regularizer.py
imports: import unittest
  from tfaip import PipelineMode, Sample
  from calamari_ocr.ocr.dataset.textprocessors import TextRegularizerProcessorParams
label_desc: Use image node_id 3 for calling the TextTextRegularizer obj's underlying member method code with example usage: obj.test_rule_sets() without return types