<commit_before><% prec_opts = { :precision => 1, :delimiter => ',', :strip_insignificant_zeros => true } %>

<p>You have <%= pluralize(Book.count, 'book') %>, <%= pluralize(Video.count, 'video') %> and <%= pluralize(ActsAsTaggableOn::Tag.count, 'tag') %>.</p>

<% unless Book.count.zero? %>
  <p>The oldest book was published on <%= link_to(@oldest_book.published_on, @oldest_book, :target => "_blank") %>
  and the newest book was published <%= link_to(@newest_book.published_on, @newest_book, :target => "_blank") %>.</p>

  <p>The longest book has <%= link_to(pluralize(@longest_book.pages, 'page'), @longest_book, :target => "_blank") %> and the
  shortest has <%= link_to(pluralize(@shortest_book.pages, 'page'), @shortest_book, :target => "_blank") %>.</p>
  <p>Together, your books have <%= pluralize(number_with_precision(Book.sum('pages'), prec_opts), 'page') %>. The average number of pages is <%= number_with_precision(Book.average('pages'), prec_opts) %>, and the most common page count for a book is <%= number_with_precision(Book.average('pages'), prec_opts) %>.</p>
  
  <p>The most popular book in your collection has been opened
  <%= link_to(pluralize(@most_popular_book.opens, 'time'), @most_popular_book, :target => "_blank") %>,
  and the least popular opened <%= link_to(pluralize(@least_popular_book.opens, 'time'), @least_popular_book, :target => "_blank") %>,
  with an average of <%= pluralize(number_with_precision(Book.average('opens'), prec_opts), 'open') %> per book.</p>
  
  <p><%= link_to(pluralize(Book.count(:conditions => 'opens > 0'), 'book has', 'books have'), items_with(:search => 's:read'), :target => "_blank") %>
    been opened at least once, and <%= link_to(pluralize(Book.count(:conditions => 'opens = 0'), 'book has', 'books have'), items_with(:search => 's:unread'), :target => '_blank') %>
  never been opened at all.</p>
<% end %>

<% unless Video.count.zero? %>
  <p>The oldest video was published on <%= link_to(@oldest_video.published_on, @oldest_video, :target => "_blank") %>
  and the newest video was published <%= link_to(@newest_video.published_on, @newest_video, :target => "_blank") %>.</p>
  
  <p>The most popular video in your collection has been opened
  <%= link_to(pluralize(@most_popular_video.opens, 'time'), @most_popular_video, :target => "_blank") %>,
  and the least popular opened <%= link_to(pluralize(@least_popular_video.opens, 'time'), @least_popular_video, :target => "_blank") %>,
  with an average of <%= pluralize(number_with_precision(Video.average('opens'), prec_opts), 'open') %> per video.</p>
  
  <p><%= link_to(pluralize(Video.count(:conditions => 'opens > 0'), 'video has', 'videos have'), items_with(:search => 's:read'), :target => "_blank") %>
  been opened at least once, and <%= link_to(pluralize(Video.count(:conditions => 'opens = 0'), 'video has', 'videos have'), items_with(:search => 's:unread'), :target => '_blank') %>
  never been opened at all.</p>
<% end %>

<!-- add most and least popular tags --><commit_msg>Fix number delimiters, add comma<commit_after><% prec_opts = { :precision => 1, :delimiter => ',', :strip_insignificant_zeros => true } %>

<p>You have <%= pluralize(number_with_delimiter(Book.count), 'book') %>, <%= pluralize(number_with_delimiter(Video.count), 'video') %>, and <%= pluralize(number_with_delimiter(ActsAsTaggableOn::Tag.count), 'tag') %>.</p>

<% unless Book.count.zero? %>
  <p>The oldest book was published on <%= link_to(@oldest_book.published_on, @oldest_book, :target => "_blank") %>
  and the newest book was published <%= link_to(@newest_book.published_on, @newest_book, :target => "_blank") %>.</p>

  <p>The longest book has <%= link_to(pluralize(number_with_delimiter(@longest_book.pages), 'page'), @longest_book, :target => "_blank") %> and the
  shortest has <%= link_to(pluralize(number_with_delimiter(@shortest_book.pages), 'page'), @shortest_book, :target => "_blank") %>.</p>
  <p>Together, your books have <%= pluralize(number_with_precision(Book.sum('pages'), prec_opts), 'page') %>. The average number of pages is <%= number_with_precision(Book.average('pages'), prec_opts) %>, and the most common page count for a book is <%= number_with_precision(Book.average('pages'), prec_opts) %>.</p>
  
  <p>The most popular book in your collection has been opened
  <%= link_to(pluralize(number_with_delimiter(@most_popular_book.opens), 'time'), @most_popular_book, :target => "_blank") %>,
  and the least popular opened <%= link_to(pluralize(number_with_delimiter(@least_popular_book.opens), 'time'), @least_popular_book, :target => "_blank") %>,
  with an average of <%= pluralize(number_with_precision(Book.average('opens'), prec_opts), 'open') %> per book.</p>
  
  <p><%= link_to(pluralize(number_with_delimiter(Book.count(:conditions => 'opens > 0')), 'book has', 'books have'), items_with(:search => 's:read'), :target => "_blank") %>
    been opened at least once, and <%= link_to(pluralize(number_with_delimiter(Book.count(:conditions => 'opens = 0')), 'book has', 'books have'), items_with(:search => 's:unread'), :target => '_blank') %>
  never been opened at all.</p>
<% end %>

<% unless Video.count.zero? %>
  <p>The oldest video was published on <%= link_to(@oldest_video.published_on, @oldest_video, :target => "_blank") %>
  and the newest video was published <%= link_to(@newest_video.published_on, @newest_video, :target => "_blank") %>.</p>
  
  <p>The most popular video in your collection has been opened
  <%= link_to(pluralize(number_with_delimiter(@most_popular_video.opens), 'time'), @most_popular_video, :target => "_blank") %>,
  and the least popular opened <%= link_to(pluralize(number_with_delimiter(@least_popular_video.opens), 'time'), @least_popular_video, :target => "_blank") %>,
  with an average of <%= pluralize(number_with_precision(Video.average('opens'), prec_opts), 'open') %> per video.</p>
  
  <p><%= link_to(pluralize(number_with_delimiter(Video.count(:conditions => 'opens > 0')), 'video has', 'videos have'), items_with(:search => 's:read'), :target => "_blank") %>
  been opened at least once, and <%= link_to(pluralize(number_with_delimiter(Video.count(:conditions => 'opens = 0')), 'video has', 'videos have'), items_with(:search => 's:unread'), :target => '_blank') %>
  never been opened at all.</p>
<% end %>

<!-- add most and least popular tags -->
{'fraction_non_alphanumeric': 0.18957644465438514, 'fraction_numerical': 0.001574555188159345, 'mean_word_length': 6.113101903695409, 'pattern_counts': {'":': 0, '<': 95, '<?xml version=': 0, '>': 149, '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': '5259886', 'n_tokens_mistral': 2224, 'n_tokens_neox': 2033, 'n_words': 512}