<commit_before>#
class PhoneNumber
  def initialize(vars)
    @num = vars.split(/[ \-()\.]/).join('')
  end

  def number
    return '0000000000' if @num =~ /\D+/
    return '0000000000' if @num.length < 10 || @num.length > 11
    if @num.length == 11
      @num = (@num[0] == '1') ? @num[1..@num.length] : '0000000000'
    end
    @num
  end

  def area_code
    number[0..2]
  end

  def to_s
    "(#{area_code}) #{number[3..5]}-#{number[6..10]}"
  end
end<commit_msg>Phone number refactoredsolution<commit_after>#
class PhoneNumber
  def initialize(vars)
    @num = vars.split(/[ \-()\.]/).join('')
  end

  def number
    bad_number = '0000000000'
    return bad_number if @num =~ /\D+/
    return bad_number if @num.length < 10 || @num.length > 11
    if @num.length == 11
      @num = (@num[0] == '1') ? @num[1..@num.length] : bad_number
    end
    @num
  end

  def area_code
    number[0..2]
  end

  def to_s
    "(#{area_code}) #{number[3..5]}-#{number[6..10]}"
  end
end
{'fraction_non_alphanumeric': 0.19653767820773932, 'fraction_numerical': 0.07331975560081466, 'mean_word_length': 2.535971223021583, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 4, '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': '799392', 'n_tokens_mistral': 438, 'n_tokens_neox': 383, 'n_words': 91}