<commit_before>module ApplicationHelper
  def current_project
    require 'ostruct'
    project = OpenStruct.new
    project.name = "ESMA"
    project
  end

  def current_document
    require 'ostruct'
    document = OpenStruct.new
    document.name = "Fundamentos"
    document
  end

  def single_project_view?
    params.has_key? :project_id
  end

  def day_from(lemma)
    /^\[.{2}\:(\d{1,2})\/(\d{1,2})\/(\d{1,4})/.match(lemma)[1]
  end

  def month_from(lemma)
    /^\[.{2}\:(\d{1,2})\/(\d{1,2})\/(\d{1,4})/.match(lemma)[2]
  end

  def year_from(lemma)
    /^\[.{2}\:(\d{1,2})\/(\d{1,2})\/(\d{1,4})/.match(lemma)[3]
  end

  def named_entity_link(ne)
    "/documents/#{ne.document_id}/comb#"
  end

  def active_on_documents
    controller_name == "documents" ? 'active' : nil
  end

  def active_on_projects
    controller_name == "projects" ? 'active' : nil
  end

  def show_count(documents=nil, results=nil)
    if results.nil?
      link_to t("all_documents") + " (#{@documents.count})", documents_path
    else
      link_to 'Resultados' + " (#{@results.count})", documents_path
    end
  end

  def can_delete?(document)
    document.completed? || JobsService.working_on?(document)
  end
end<commit_msg>[aphrodite] Non processing documents can be removed<commit_after>module ApplicationHelper
  def current_project
    require 'ostruct'
    project = OpenStruct.new
    project.name = "ESMA"
    project
  end

  def current_document
    require 'ostruct'
    document = OpenStruct.new
    document.name = "Fundamentos"
    document
  end

  def single_project_view?
    params.has_key? :project_id
  end

  def day_from(lemma)
    /^\[.{2}\:(\d{1,2})\/(\d{1,2})\/(\d{1,4})/.match(lemma)[1]
  end

  def month_from(lemma)
    /^\[.{2}\:(\d{1,2})\/(\d{1,2})\/(\d{1,4})/.match(lemma)[2]
  end

  def year_from(lemma)
    /^\[.{2}\:(\d{1,2})\/(\d{1,2})\/(\d{1,4})/.match(lemma)[3]
  end

  def named_entity_link(ne)
    "/documents/#{ne.document_id}/comb#"
  end

  def active_on_documents
    controller_name == "documents" ? 'active' : nil
  end

  def active_on_projects
    controller_name == "projects" ? 'active' : nil
  end

  def show_count(documents=nil, results=nil)
    if results.nil?
      link_to t("all_documents") + " (#{@documents.count})", documents_path
    else
      link_to 'Resultados' + " (#{@results.count})", documents_path
    end
  end

  def can_delete?(document)
    JobsService.not_working_on?(document)
  end
end
{'fraction_non_alphanumeric': 0.17338217338217338, 'fraction_numerical': 0.019536019536019536, 'mean_word_length': 3.2379310344827585, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4253074', 'n_tokens_mistral': 953, 'n_tokens_neox': 925, 'n_words': 162}