<commit_before>#生成全站
require 'fileutils'

require_relative './scan'
require_relative './compiler'
require_relative './util'
require_relative './store'
require_relative './setup'

class Generator
    def initialize
        scan = Scan.new
        scan.execute

        @store = Store.new scan.files
        @util = Util.instance
        @setup = Setup.instance

        @compiler = Compiler.new
        @page_size = @setup.get_merged_config['page_size'] || 10<commit_msg>生成时强行删除目标<commit_after>#生成全站
require 'fileutils'

require_relative './scan'
require_relative './compiler'
require_relative './util'
require_relative './store'
require_relative './setup'

class Generator
    def initialize
        @util = Util.instance
        @setup = Setup.instance

        #删除目标目录
        FileUtils.rmtree @setup.target_dir

        #扫描文件
        scan = Scan.new
        scan.execute

        #存储文件
        @store = Store.new scan.files

        @compiler = Compiler.new
        @page_size = @setup.get_merged_config['page_size'] || 10
{'fraction_non_alphanumeric': 0.1073170731707317, 'fraction_numerical': 0.003902439024390244, 'mean_word_length': 2.6382978723404253, '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': '4691755', 'n_tokens_mistral': 327, 'n_tokens_neox': 319, 'n_words': 68}