<commit_before>require_relative "../importers/solicitor_parser"

namespace :import do
  desc "Import Kent members list from CSV"
  task kent_members: :environment do
    organisation_attrs = Importers::SolicitorParser.new(File.join(Rails.root, "fixtures", "kent_members_list.csv")).import!

    Importers::SolicitorImporter.create_from_attributes(organisation_attrs)
  end
end
<commit_msg>Take file path as an argument to the task<commit_after>require_relative "../importers/solicitor_parser"
require_relative "../importers/solicitor_importer"

namespace :import do
  desc "Import Kent members list from CSV"
  task :kent_members, [:file_path] => :environment do |t, args|
    organisation_attrs = Importers::SolicitorParser.new(File.join(Rails.root, args[:file_path])).import!

    Importers::SolicitorImporter.create_from_attributes(organisation_attrs)
  end
end

{'fraction_non_alphanumeric': 0.10173410404624278, 'fraction_numerical': 0.0, 'mean_word_length': 6.401709401709402, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '5792565', 'n_tokens_mistral': 274, 'n_tokens_neox': 268, 'n_words': 58}