def clean
      return unless text
      remove_all_newlines
      replace_double_newlines
      replace_newlines
      replace_escaped_newlines

      @text.apply(HTML::All)

      replace_punctuation_in_brackets
      @text.apply(InlineFormattingRule)
      clean_quotations
      clean_table_of_contents
      check_for_no_space_in_between_sentences
      clean_consecutive_characters
    end
def clean
      return unless text
      remove_all_newlines
      replace_double_newlines
      replace_newlines
      replace_escaped_newlines

      @text.apply(HTML::All)

      replace_punctuation_in_brackets
      @text.apply(InlineFormattingRule)
      clean_quotations
      clean_table_of_contents
      check_for_no_space_in_between_sentences
      clean_consecutive_characters
    end
Clean text of unwanted formatting

 Example:
   >> text = "This is a sentence\ncut off in the middle because pdf."
   >> PragmaticSegmenter::Cleaner(text: text).clean
   => "This is a sentence cut off in the middle because pdf."

 Arguments:
    text:       (String)  *required
    language:   (String)  *optional
                (two character ISO 639-1 code e.g. 'en')
    doc_type:   (String)  *optional
                (e.g. 'pdf')