<commit_before>class JermController < ApplicationController
  before_filter :login_required
  before_filter :is_user_admin_auth
  before_filter :jerm_enabled

  @@harvesters=nil

  def index
    
  end

  def fix_titles
    @assets=Asset.find(:all).select{|a| a.contributor.nil? && a.resource.title.include?("'")}
    respond_to do |format|
      format.html
    end
  end

  def update_titles
    included_keys = params.keys.select{|k| k.start_with?("include_")}
    @assets=[]
    included_keys.each do |included|
      asset_id=included.gsub("include_","").to_i
      asset=Asset.find(asset_id)
      new_title=params["proposed_#{asset_id}"]
      asset.resource.update_attribute(:title,new_title)
      @assets << asset
    end
    respond_to do |format|
      format.html
    end
  end

  def download
    asset = Asset.find(params[:id])
    download_jerm_resource asset.resource
  end

  def fetch
    Sop.destroy_all
    project_id=params[:project]

    @project=Project.find(project_id)<commit_msg>removed code that deletes all Sops for testing purposes<commit_after>class JermController < ApplicationController
  before_filter :login_required
  before_filter :is_user_admin_auth
  before_filter :jerm_enabled

  @@harvesters=nil

  def index
    
  end

  def fix_titles
    @assets=Asset.find(:all).select{|a| a.contributor.nil? && a.resource.title.include?("'")}
    respond_to do |format|
      format.html
    end
  end

  def update_titles
    included_keys = params.keys.select{|k| k.start_with?("include_")}
    @assets=[]
    included_keys.each do |included|
      asset_id=included.gsub("include_","").to_i
      asset=Asset.find(asset_id)
      new_title=params["proposed_#{asset_id}"]
      asset.resource.update_attribute(:title,new_title)
      @assets << asset
    end
    respond_to do |format|
      format.html
    end
  end

  def download
    asset = Asset.find(params[:id])
    download_jerm_resource asset.resource
  end

  def fetch
    #Sop.destroy_all
    project_id=params[:project]

    @project=Project.find(project_id)
{'fraction_non_alphanumeric': 0.10754257907542579, 'fraction_numerical': 0.0, 'mean_word_length': 3.579064587973274, 'pattern_counts': {'":': 0, '<': 9, '<?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': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2995178', 'n_tokens_mistral': 706, 'n_tokens_neox': 677, 'n_words': 123}