<commit_before># -*- coding: utf-8 -*-

require "yaml"
require "sequel"

module PBDB
  DIR      = File.expand_path("~/.pbdb") unless defined? DIR
  CONFIG   = YAML.load_file(File.join(DIR, 'config'))
  PID_FILE = File.join(DIR, 'pid') # TODO: check config
  DB       = Sequel.sqlite(File.join(DIR, 'db'))

  require 'pbdb/clip'
  require 'pbdb/clip_logger'
  require 'pbdb/server'

  class << self
    def start
      # TODO: deamonize
      puts "## PBDB has started ##"

      File.open(PID_FILE, 'w') { |f| f << Process.pid }

      at_exit do
        PBDB::ClipLogger.stop!
        puts "## PBDB has ended ##"
      end<commit_msg>modify a comment<commit_after># -*- coding: utf-8 -*-

require "yaml"
require "sequel"

module PBDB
  DIR      = File.expand_path("~/.pbdb") unless defined? DIR
  CONFIG   = YAML.load_file(File.join(DIR, 'config')) # TODO: check config
  PID_FILE = File.join(DIR, 'pid')
  DB       = Sequel.sqlite(File.join(DIR, 'db'))

  require 'pbdb/clip'
  require 'pbdb/clip_logger'
  require 'pbdb/server'

  class << self
    def start
      # TODO: deamonize
      puts "## PBDB has started ##"

      File.open(PID_FILE, 'w') { |f| f << Process.pid }

      at_exit do
        PBDB::ClipLogger.stop!
        puts "## PBDB has ended ##"
      end
{'fraction_non_alphanumeric': 0.15239591516103693, 'fraction_numerical': 0.0015710919088766694, 'mean_word_length': 2.6296296296296298, 'pattern_counts': {'":': 0, '<': 11, '<?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': '6287995', 'n_tokens_mistral': 478, 'n_tokens_neox': 465, 'n_words': 111}