<commit_before>module Score
  class DoubleEventResultRow < Struct.new(:entity)
    include Draper::Decoratable
    attr_reader :result_rows

    def add_result_row result_row
      @result_rows ||= []
      @result_rows.push(result_row)
    end

    def sum_stopwatch_time
      @sum_time ||= begin
        time = @result_rows.map(&:best_stopwatch_time).map(&:time).sum
        StopwatchTime.aggregated_time(time)        
      end
    end

    def time_from result
      @result_rows.select { |row| row.result == result }.map(&:best_stopwatch_time).first
    end<commit_msg>D-Cup-Einzelwertung: Zweikampfanzeige korrigieren (refs #31)<commit_after>module Score
  class DoubleEventResultRow < Struct.new(:entity)
    include Draper::Decoratable
    attr_reader :result_rows

    def add_result_row result_row
      @result_rows ||= []
      @result_rows.push(result_row)
    end

    def sum_stopwatch_time
      @sum_time ||= begin
        time = @result_rows.map(&:best_stopwatch_time).map(&:time).sum
        StopwatchTime.aggregated_time(time)        
      end
    end

    def time
      sum_stopwatch_time
    end

    def time_from result
      @result_rows.select { |row| row.result == result }.map(&:best_stopwatch_time).first
    end
{'fraction_non_alphanumeric': 0.09485530546623794, 'fraction_numerical': 0.001607717041800643, 'mean_word_length': 3.0686274509803924, 'pattern_counts': {'":': 0, '<': 5, '<?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': '2878903', 'n_tokens_mistral': 416, 'n_tokens_neox': 402, 'n_words': 73}