<commit_before># from https://github.com/jfromaniello/joseoncodecom/raw/master/_plugins/tag_gen.rb
module Jekyll
  class TagIndex < Page
    def initialize(site, base, dir, tag, subtag, subtag_list)
      @site = site
      @base = base
      @dir = "../"
      @name = dir + '.html'

      self.process(@name)
      self.read_yaml(File.join(base, '_layouts'), 'tag_index.html')
      if subtag != nil
        self.data['tag'] = tag['tag']
        self.data['subtag'] = subtag['subtag']
        self.data['title'] = "#{tag['name']}: #{subtag['name']}"
        self.data['subtags'] = nil
      else
        self.data['tag'] = tag
        self.data['subtag'] = nil
        self.data['title'] = tag.capitalize
        self.data['subtags'] = subtag_list
      end
    end
  end

  class TagGenerator < Generator
    safe true
    def generate(site)
      if site.layouts.key? 'tag_index'
        dir = site.config['tag_dir'] || 'tags'
        site.tags.keys.each do |tag|
          site.data['classes'].each do |clazz|
            if clazz['tag'] == tag
              write_tag_index(site, File.join(dir, tag), tag, nil, clazz['subclasses'])
              if clazz['subclasses'] != nil
                clazz['subclasses'].each do |subclazz|
                  write_tag_index(site, File.join(dir, "#{clazz['tag']}-#{subclazz['subtag']}"), clazz, subclazz, nil)
                end
              end
            end
          end
        end
      end
    end
    def write_tag_index(site, dir, tag, subtag, subtag_list)
      index = TagIndex.new(site, site.source, dir, tag, subtag, subtag_list)
      index.render(site.layouts, site.site_payload)
      index.write(site.dest)
      site.pages << index
    end
  end
end<commit_msg>plugins/tag_gen: regenerate subtagless nonclass tags<commit_after># from https://github.com/jfromaniello/joseoncodecom/raw/master/_plugins/tag_gen.rb
module Jekyll
  class TagIndex < Page
    def initialize(site, base, dir, tag, subtag, subtag_list)
      @site = site
      @base = base
      @dir = "../"
      @name = dir + '.html'

      self.process(@name)
      self.read_yaml(File.join(base, '_layouts'), 'tag_index.html')
      if subtag != nil
        self.data['tag'] = tag['tag']
        self.data['subtag'] = subtag['subtag']
        self.data['title'] = "#{tag['name']}: #{subtag['name']}"
        self.data['subtags'] = nil
      else
        self.data['tag'] = tag
        self.data['subtag'] = nil
        self.data['title'] = tag.capitalize
        self.data['subtags'] = subtag_list
      end
    end
  end

  class TagGenerator < Generator
    safe true
    def generate(site)
      if site.layouts.key? 'tag_index'
        dir = site.config['tag_dir'] || 'tags'
        site.tags.keys.each do |tag|
          site.data['classes'].each do |clazz|
            found = false
            if clazz['tag'] == tag
              found = true
              write_tag_index(site, File.join(dir, tag), tag, nil, clazz['subclasses'])
              if clazz['subclasses'] != nil
                clazz['subclasses'].each do |subclazz|
                  write_tag_index(site, File.join(dir, "#{clazz['tag']}-#{subclazz['subtag']}"), clazz, subclazz, nil)
                end
              end
            end
            if found == false
              write_tag_index(site, File.join(dir, tag), tag, nil, nil)
            end
          end
        end
      end
    end
    def write_tag_index(site, dir, tag, subtag, subtag_list)
      index = TagIndex.new(site, site.source, dir, tag, subtag, subtag_list)
      index.render(site.layouts, site.site_payload)
      index.write(site.dest)
      site.pages << index
    end
  end
end
{'fraction_non_alphanumeric': 0.14238952536824878, 'fraction_numerical': 0.0, 'mean_word_length': 2.139554794520548, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '5067923', 'n_tokens_mistral': 1189, 'n_tokens_neox': 1178, 'n_words': 255}