<commit_before>module TabBarHelper

  def tab_li(thing, options = {})
    thing = thing.to_s if thing.is_a?(Symbol)
    current = options.delete :current
    current ||= controller.controller_name == thing
    key = options.delete :translate
    key ||= (thing + '_tab').to_sym
    named_path = (thing + '_path').to_sym
    if options.empty? and respond_to?(named_path)
      target = send named_path
    else
      target = options
    end
    li_class = current ? 'current' : ''
    content_tag(:li, :class => li_class) do
      link_to I18n.t(key).upcase, target
    end
  end

  def action_tab_li(thing, options = {})
    thing = thing.to_s if thing.is_a?(Symbol)<commit_msg>some docs for tab_bar helper<commit_after>module TabBarHelper

  # thing is what this contents of this tab
  # thing usually is controller name, but can be anything if :current option is set
  # thing + "_tab" is used as an I18n.t key for the text, when :translate option is blank
  # thing + "_path" is used for url when :controller or :action options are blank
  # options:
  #   :translate - the name of the I18n.t key for the text
  #   :action, :controller, :id, :other_param - used for linking
  #   :current - if this options is true, then this tab will be active
  def tab_li(thing, options = {})
    thing = thing.to_s if thing.is_a?(Symbol)
    current = options.delete :current
    current ||= controller.controller_name == thing
    key = options.delete :translate
    key ||= (thing + '_tab').to_sym
    named_path = (thing + '_path').to_sym
    if options.empty? and respond_to?(named_path)
      target = send named_path
    else
      target = options
    end
    li_class = current ? 'current' : ''
    content_tag(:li, :class => li_class) do
      link_to I18n.t(key).upcase, target
    end
  end

  # thing is a name of the action
  # the tab will be active if params[:action] is same as thing
  # see tab_li for other options
  def action_tab_li(thing, options = {})
    thing = thing.to_s if thing.is_a?(Symbol)
{'fraction_non_alphanumeric': 0.10144206862257583, 'fraction_numerical': 0.003978120338140228, 'mean_word_length': 3.139917695473251, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '6586250', 'n_tokens_mistral': 638, 'n_tokens_neox': 636, 'n_words': 215}