<commit_before>require 'tempfile'
require 'shellwords'
require 'open3'
require 'csv'


module Mdb
  class Database
    
    
    
    def initialize(file, options={})
      raise FileDoesNotExistError, "\"#{file}\" does not exist" unless File.exist?(file)
      
      @file = file
      @delimiter = options.fetch :delimiter, '|'
    end
    
    
    
    attr_reader :file, :delimiter<commit_msg>[improvement] Allowed Mdb.open to accept things that know how to represent themselves as paths (1m)<commit_after>require 'tempfile'
require 'shellwords'
require 'open3'
require 'csv'


module Mdb
  class Database
    
    
    
    def initialize(file, options={})
      file = file.to_path if file.respond_to?(:to_path)
      raise FileDoesNotExistError, "\"#{file}\" does not exist" unless File.exist?(file)
      
      @file = file
      @delimiter = options.fetch :delimiter, '|'
    end
    
    
    
    attr_reader :file, :delimiter
{'fraction_non_alphanumeric': 0.10638297872340426, 'fraction_numerical': 0.0031914893617021275, 'mean_word_length': 2.8097165991902835, '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': '7348769', 'n_tokens_mistral': 301, 'n_tokens_neox': 299, 'n_words': 81}