<commit_before>module Refinery
  module News
    module ItemsHelper
      def news_item_archive_widget
        items = Refinery::News::Item.select('publish_date').all_previous
        return nil if items.blank?

        render :partial => "/refinery/news/items/widgets/news_archive", :locals => { :items => items }
      end
      alias_method :news_archive_list, :news_archive_widget

      def next_or_previous?(item)
        item.next.present? or item.prev.present?
      end

      def news_item_teaser_enabled?
        Refinery::News::Item.teasers_enabled?
      end

      def news_item_teaser(item)
        if item.respond_to?(:custom_teaser) && item.custom_teaser.present?
          item.custom_teaser.html_safe
        else
          truncate(item.body, {
            :length => Refinery::Setting.find_or_set(:news_item_teaser_length, 250),
            :preserve_html_tags => true
          }).html_safe
        end
      end

      def news_item_archive_link(item)
        if item.publish_date >= Time.now.end_of_year.advance(:years => -3)
          post_date = item.publish_date.strftime('%m/%Y')
          year = post_date.split('/')[1]<commit_msg>Alias the correct method name.<commit_after>module Refinery
  module News
    module ItemsHelper
      def news_item_archive_widget
        items = Refinery::News::Item.select('publish_date').all_previous
        return nil if items.blank?

        render :partial => "/refinery/news/items/widgets/news_archive", :locals => { :items => items }
      end
      alias_method :news_archive_list, :news_item_archive_widget

      def next_or_previous?(item)
        item.next.present? or item.prev.present?
      end

      def news_item_teaser_enabled?
        Refinery::News::Item.teasers_enabled?
      end

      def news_item_teaser(item)
        if item.respond_to?(:custom_teaser) && item.custom_teaser.present?
          item.custom_teaser.html_safe
        else
          truncate(item.body, {
            :length => Refinery::Setting.find_or_set(:news_item_teaser_length, 250),
            :preserve_html_tags => true
          }).html_safe
        end
      end

      def news_item_archive_link(item)
        if item.publish_date >= Time.now.end_of_year.advance(:years => -3)
          post_date = item.publish_date.strftime('%m/%Y')
          year = post_date.split('/')[1]
{'fraction_non_alphanumeric': 0.10461144321093083, 'fraction_numerical': 0.004269854824935952, 'mean_word_length': 2.615740740740741, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, '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': '4926599', 'n_tokens_mistral': 740, 'n_tokens_neox': 713, 'n_words': 123}