<commit_before>require 'lovely_rufus'

module Signore
  # rubocop:disable Metrics/BlockLength
  Signature = Struct.new(:text, :author, :source, :subject, :tags) do
    def self.from_h(hash)
      new(hash.map { |key, value| [key.to_sym, value] }.to_h)
    end

    def initialize(author: '', source: '', subject: '', tags: [], text: '')
      super text, author, source, subject, tags
    end

    def empty?
      to_s.empty?
    end

    undef text if defined?(:text)
    def text
      self[:text] or ''
    end

    def to_h
      super.map { |key, val| { key.to_s => val } }.reduce({}, :merge)
           .compact.reject { |_, val| val.empty? }
    end

    def to_s<commit_msg>Drop Signature#text<commit_after>require 'lovely_rufus'

module Signore
  # rubocop:disable Metrics/BlockLength
  Signature = Struct.new(:text, :author, :source, :subject, :tags) do
    def self.from_h(hash)
      new(hash.map { |key, value| [key.to_sym, value] }.to_h)
    end

    def initialize(author: '', source: '', subject: '', tags: [], text: '')
      super text, author, source, subject, tags
    end

    def empty?
      to_s.empty?
    end

    def to_h
      super.map { |key, val| { key.to_s => val } }.reduce({}, :merge)
           .compact.reject { |_, val| val.empty? }
    end

    def to_s
{'fraction_non_alphanumeric': 0.15015479876160992, 'fraction_numerical': 0.0, 'mean_word_length': 2.6628895184135977, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '1969783', 'n_tokens_mistral': 464, 'n_tokens_neox': 448, 'n_words': 117}