<commit_before># Provide a notation that confirms that the proper class is being used,
# but which a normal human can actually read.

class BigDecimal
  def inspect
    # Sign
    sign = self < 0 ? '-' : ''

    # Math
    integer  = self > 0 ? floor.to_i : ceil.to_i
    fraction = (self - integer).abs

    # Commas
    int_part = integer \
      .abs \
      .to_s \
      .reverse \
      .scan(/(?:\d*\.)?\d{1,3}-?/) \
      .join(',') \
      .reverse

    # Trailing decimals, if any
    dec_part = \
      if fraction.zero?
        ''
      else
        fraction.to_s \<commit_msg>Simplify lookbehind assertion<commit_after># Provide a notation that confirms that the proper class is being used,
# but which a normal human can actually read.

class BigDecimal
  def inspect
    # Sign
    sign = self < 0 ? '-' : ''

    # Math
    integer  = self > 0 ? floor.to_i : ceil.to_i
    fraction = (self - integer).abs

    # Commas
    int_part = integer \
      .abs \
      .to_s \
      .reverse \
      .scan(/(?:\.)?\d{1,3}-?/) \
      .join(',') \
      .reverse

    # Trailing decimals, if any
    dec_part = \
      if fraction.zero?
        ''
      else
        fraction.to_s \
{'fraction_non_alphanumeric': 0.12762384550797648, 'fraction_numerical': 0.006717044500419815, 'mean_word_length': 1.709090909090909, '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': '3940547', 'n_tokens_mistral': 412, 'n_tokens_neox': 390, 'n_words': 114}