<commit_before>#!/usr/bin/env ruby
require 'pathname'
require 'csv'

require_relative './conf'

confpath = Pathname.new(__FILE__).dirname.realdirpath
home = Pathname.new(Dir.home)

home.join('.bin', 'conf').open("w") do |f|
  f.write("#!/bin/sh\n")
  f.write("ruby #{confpath.join("conf.rb")} \"$@\"\n")
end
home.join('.bin', 'conf').chmod(0755)

csv = open(confpath.join('config-files.list')) {|f| CSV.parse(f, headers: true)}
original, inrel = csv.headers

mount = []

csv.each do |row|
  orig = Pathname.new(row[original])
  in_path = confpath.join((row[inrel])).realdirpath
  if orig.relative?
    orig = home.join(orig).realdirpath
  end
  FileUtils.ln_s(in_path, orig) unless orig.exist?
end
<commit_msg>Force overwriting old config files<commit_after>#!/usr/bin/env ruby
require 'pathname'
require 'csv'

require_relative './conf'

confpath = Pathname.new(__FILE__).dirname.realdirpath
home = Pathname.new(Dir.home)

home.join('.bin', 'conf').open("w") do |f|
  f.write("#!/bin/sh\n")
  f.write("ruby #{confpath.join("conf.rb")} \"$@\"\n")
end
home.join('.bin', 'conf').chmod(0755)

csv = open(confpath.join('config-files.list')) {|f| CSV.parse(f, headers: true)}
original, inrel = csv.headers

mount = []

csv.each do |row|
  orig = Pathname.new(row[original])
  in_path = confpath.join((row[inrel])).realdirpath
  if orig.relative?
    orig = home.join(orig).realdirpath
  end
  FileUtils.ln_sf(in_path, orig)
end

{'fraction_non_alphanumeric': 0.19817287420941673, 'fraction_numerical': 0.005621925509486999, 'mean_word_length': 4.741935483870968, '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': '2902351', 'n_tokens_mistral': 569, 'n_tokens_neox': 546, 'n_words': 102}