<commit_before>module HTML
  class Pipeline
    class BungoFilter < TextFilter
      def call
        html = @text
        html = ruby_fliter(html)
        html = emph_dot_fliter(html)
        html = bold_fliter(html)
        html.rstrip!
        html
      end

      private

      def ruby_fliter(text)
        text.gsub(/:([^:]+?)\(([^:]+?)\)/) do |match|
          "<ruby><rb>#{$1}</rb><rp>(</rp><rt>#{$2}</rt><rp>)</rp></ruby>"
        end
      end

      def emph_dot_fliter(text)
        text.gsub(/:([^:]+?)\.\./) do |match|
          ww = $1.split(//).map{|s| "<span class='boten'>#{s}</span>"}
          "<span class='botenparent'>#{ww.join}</span>"
        end
      end

      def bold_fliter(text)
        text.gsub(/:([^:]+?)\!/) do |match|
          "<b>#{$1}</b>"
        end
      end
    end
  end
end
<commit_msg>change var<commit_after>module HTML
  class Pipeline
    class BungoFilter < TextFilter
      def call
        html = @text
        html = ruby_fliter(html)
        html = emph_dot_fliter(html)
        html = bold_fliter(html)
        html.rstrip!
        html
      end

      private

      def ruby_fliter(text)
        text.gsub(/:([^:]+?)\(([^:]+?)\)/) do |match|
          "<ruby><rb>#{$1}</rb><rp>(</rp><rt>#{$2}</rt><rp>)</rp></ruby>"
        end
      end

      def emph_dot_fliter(text)
        text.gsub(/:([^:]+?)\.\./) do |match|
          literals = $1.split(//).map{|l| "<span class='boten'>#{s}</span>"}
          "<span class='botenparent'>#{literals.join}</span>"
        end
      end

      def bold_fliter(text)
        text.gsub(/:([^:]+?)\!/) do |match|
          "<b>#{$1}</b>"
        end
      end
    end
  end
end

{'fraction_non_alphanumeric': 0.20989862850327967, 'fraction_numerical': 0.004770423375074538, 'mean_word_length': 1.8344594594594594, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 35, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4878116', 'n_tokens_mistral': 631, 'n_tokens_neox': 603, 'n_words': 107}