<commit_before>module PluginsHelper

  def plugins_product_tabs
    @plugins.dispatch(:product_tabs, @product).map do |tab|
      {:title => tab[:title], :id => tab[:id], :content => instance_exec(&tab[:content])}
    end
  end

  def plugins_article_toolbar_actions
    @plugins.dispatch(:article_toolbar_actions, @page).collect { |content| instance_exec(&content) }.join ""
  end

  def plugins_catalog_search_extras_begin
    @plugins.dispatch(:catalog_search_extras_begin).map do |content|
      instance_exec(&content)
    end.join
  end

  def plugins_catalog_search_extras_end
    @plugins.dispatch(:catalog_search_extras_end).map do |content|
      instance_exec(&content)
    end.join
  end

  def plugins_catalog_autocomplete_item_extras product
    @plugins.dispatch(:catalog_autocomplete_item_extras, product).map do |content|
      instance_exec(&content)
    end.join
  end

  def plugins_search_order asset
    @plugins.dispatch_first :search_order, asset
  end

  def plugins_search_pre_contents
    @plugins.dispatch(:search_pre_contents).map do |content|
      instance_exec(&content)
    end.join
  end

end<commit_msg>Allow plugins to add contents after search results<commit_after>module PluginsHelper

  def plugins_product_tabs
    @plugins.dispatch(:product_tabs, @product).map do |tab|
      {:title => tab[:title], :id => tab[:id], :content => instance_exec(&tab[:content])}
    end
  end

  def plugins_article_toolbar_actions
    @plugins.dispatch(:article_toolbar_actions, @page).collect { |content| instance_exec(&content) }.join ""
  end

  def plugins_catalog_search_extras_begin
    @plugins.dispatch(:catalog_search_extras_begin).map do |content|
      instance_exec(&content)
    end.join
  end

  def plugins_catalog_search_extras_end
    @plugins.dispatch(:catalog_search_extras_end).map do |content|
      instance_exec(&content)
    end.join
  end

  def plugins_catalog_autocomplete_item_extras product
    @plugins.dispatch(:catalog_autocomplete_item_extras, product).map do |content|
      instance_exec(&content)
    end.join
  end

  def plugins_search_order asset
    @plugins.dispatch_first :search_order, asset
  end

  def plugins_search_pre_contents
    @plugins.dispatch(:search_pre_contents).map do |content|
      instance_exec(&content)
    end.join
  end
  
  def plugins_search_post_contents
    @plugins.dispatch(:search_post_contents).map do |content|
      instance_exec(&content)
    end.join
  end

end
{'fraction_non_alphanumeric': 0.0934199837530463, 'fraction_numerical': 0.0, 'mean_word_length': 4.547297297297297, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '1854623', 'n_tokens_mistral': 764, 'n_tokens_neox': 745, 'n_words': 146}