<commit_before>module LinkHelpers
  
  def build_path(*args)
     [*args].map{ |a| a.name.parameterize }.unshift('').join('/') + '.html'
  end

  def link_to_composer(composer, &block)
    text = block_given? ? capture_html(&block) : composer.name
    link_to text, build_path(composer)
  end

  def link_to_opera(opera, &block)
    text = block_given? ? capture_html(&block) : opera.name
    composer = composer_of_opera(opera)
    link_to text, build_path(composer, opera)
  end
  
  def link_to_aria(aria, &block)
    text = block_given? ? capture_html(&block) : aria.name
    opera = opera_of_aria(aria)
    composer = composer_of_opera(opera)
    link_to text, build_path(composer, opera, aria)
  end
  
  def breadcrumb(*args)
    
    crumbs = []
    args.each_with_index do |arg, index|
      current = args.length - 1 == index
      path = build_path(*args[0..index])
      
      crumbs << content_tag(:li, link_to(arg.name, path), :class => ('current' if current))
      
    end
    
    content_tag :ul, crumbs.join(''), :class => 'breadcrumbs' 
    
  end
  
  def render_callouts(*args)
    
    rows = ''
    
    path_components = args[0..-2]
    items = args[-1]
    
    while items.any?
      rows << partial('partials/callout_row', :locals => { :items => items[0...4], :path_components => path_components })
      items.slice!(0, 4)
    end
    
    rows
    
  end
  
end<commit_msg>set build attributes<commit_after>module LinkHelpers
  
  def build_path(*args)
     [*args].map{ |a| a.name.parameterize }.join('/') + '.html'
  end

  def link_to_composer(composer, &block)
    text = block_given? ? capture_html(&block) : composer.name
    link_to text, build_path(composer)
  end

  def link_to_opera(opera, &block)
    text = block_given? ? capture_html(&block) : opera.name
    composer = composer_of_opera(opera)
    link_to text, build_path(composer, opera)
  end
  
  def link_to_aria(aria, &block)
    text = block_given? ? capture_html(&block) : aria.name
    opera = opera_of_aria(aria)
    composer = composer_of_opera(opera)
    link_to text, build_path(composer, opera, aria)
  end
  
  def breadcrumb(*args)
    
    crumbs = []
    args.each_with_index do |arg, index|
      current = args.length - 1 == index
      path = build_path(*args[0..index])
      
      crumbs << content_tag(:li, link_to(arg.name, path), :class => ('current' if current))
      
    end
    
    content_tag :ul, crumbs.join(''), :class => 'breadcrumbs' 
    
  end
  
  def render_callouts(*args)
    
    rows = ''
    
    path_components = args[0..-2]
    items = args[-1]
    
    while items.any?
      rows << partial('partials/callout_row', :locals => { :items => items[0...4], :path_components => path_components })
      items.slice!(0, 4)
    end
    
    rows
    
  end
  
end
{'fraction_non_alphanumeric': 0.13368983957219252, 'fraction_numerical': 0.006417112299465241, 'mean_word_length': 2.8125, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, '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': '81778', 'n_tokens_mistral': 1009, 'n_tokens_neox': 1004, 'n_words': 205}