<commit_before>module CouplesHelper

  # Formats a single cell for the {Couple}, {SubRound}, and {Adjudicator}.
  #
  # @param [Couple] couple The couple. Its {Couple#marks marks} association
  #   should contain only {Mark}s for `sub_round`.
  # @param [SubRound] sub_round The sub round.
  # @param [Adjudicator] adjudicator The adjudicator.
  #
  # @return [String] A FontAwesome check mark if `sub_round` is part of a
  #   preliminary {Round} and the `adjudicator` marked the `couple`, an integer
  #   (as a string) if the {Round} was final, or and empty string, if the
  #   adjudicator did not mark the couple.
  def format_cell(couple, sub_round, adjudicator)
    mark = Mark.find_by(adjudicator: adjudicator,
                        sub_round_id: sub_round.id,
                        couple: couple)
    if mark
      text = content_tag(:span, 'Mark', class: 'hidden')
      (mark.placement == 0) ? fa_icon('check', text: text) : mark.placement.to_s
    else
      content_tag(:span, 'No mark', class: 'hidden')
    end
  end

  # Compute the classes to use for a mark cell.
  #
  # @return [Array<String>] Array of strings in which the first element is the encoded
  def mark_cell_classes(sub_round, adjudicator)
    ['mark_cell',
     dance_to_class_name(sub_round.sub_event.dance),
     'adjudicator_col',
     "adjudicator_#{adjudicator.shorthand}_col"]
  end

  # Compute the classes to use for a result cell.
  def result_cell_classes(round)
    ['result_cell',
     'recalled_col']
  end
end<commit_msg>Add `data_cell` class to results table cells<commit_after>module CouplesHelper

  # Formats a single cell for the {Couple}, {SubRound}, and {Adjudicator}.
  #
  # @param [Couple] couple The couple. Its {Couple#marks marks} association
  #   should contain only {Mark}s for `sub_round`.
  # @param [SubRound] sub_round The sub round.
  # @param [Adjudicator] adjudicator The adjudicator.
  #
  # @return [String] A FontAwesome check mark if `sub_round` is part of a
  #   preliminary {Round} and the `adjudicator` marked the `couple`, an integer
  #   (as a string) if the {Round} was final, or and empty string, if the
  #   adjudicator did not mark the couple.
  def format_cell(couple, sub_round, adjudicator)
    mark = Mark.find_by(adjudicator: adjudicator,
                        sub_round_id: sub_round.id,
                        couple: couple)
    if mark
      text = content_tag(:span, 'Mark', class: 'hidden')
      (mark.placement == 0) ? fa_icon('check', text: text) : mark.placement.to_s
    else
      content_tag(:span, 'No mark', class: 'hidden')
    end
  end

  # Compute the classes to use for a mark cell.
  #
  # @return [Array<String>] Array of strings in which the first element is the encoded
  def mark_cell_classes(sub_round, adjudicator)
    ['mark_cell',
     'data_cell',
     dance_to_class_name(sub_round.sub_event.dance),
     'adjudicator_col',
     "adjudicator_#{adjudicator.shorthand}_col"]
  end

  # Compute the classes to use for a result cell.
  def result_cell_classes(round)
    ['result_cell',
     'data_cell',
     'recalled_col']
  end
end
{'fraction_non_alphanumeric': 0.1016403988420714, 'fraction_numerical': 0.000643293663557414, 'mean_word_length': 3.2661179698216736, 'pattern_counts': {'":': 0, '<': 5, '<?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': '4527121', 'n_tokens_mistral': 1027, 'n_tokens_neox': 1000, 'n_words': 321}