<commit_before># encoding: utf-8
class Bubs
  VERSION = '0.0.1'

  # Convert words to ⓌⓄⓇⒹⓈ.
  #
  # Returns a String, but a much cooler string than what you had initially.
  def self.convert(text)
    bubs = {
      :A => :Ⓐ,
      :B => :Ⓑ,
      :C => :Ⓒ,
      :D => :Ⓓ,
      :E => :Ⓔ,
      :F => :Ⓕ,
      :G => :Ⓖ,
      :H => :Ⓗ,
      :I => :Ⓘ,
      :J => :Ⓙ,
      :K => :Ⓚ,
      :L => :Ⓛ,
      :M => :Ⓜ,
      :N => :Ⓝ,
      :O => :Ⓞ,
      :P => :Ⓟ,
      :Q => :Ⓠ,
      :R => :Ⓡ,
      :S => :Ⓢ,
      :T => :Ⓣ,
      :U => :Ⓤ,
      :V => :Ⓥ,
      :W => :Ⓦ,
      :X => :Ⓧ,
      :Y => :Ⓨ,
      :Z => :Ⓩ,
      :a => :ⓐ,
      :b => :ⓑ,
      :c => :ⓒ,
      :d => :ⓓ,
      :e => :ⓔ,
      :f => :ⓕ,
      :g => :ⓖ,
      :h => :ⓗ,
      :i => :ⓘ,
      :j => :ⓙ,
      :k => :ⓚ,
      :l => :ⓛ,
      :m => :ⓜ,
      :n => :ⓝ,
      :o => :ⓞ,
      :p => :ⓟ,
      :q => :ⓠ,
      :r => :ⓡ,
      :s => :ⓢ,
      :t => :ⓣ,
      :u => :ⓤ,
      :v => :ⓥ,
      :w => :ⓦ,
      :x => :ⓧ,
      :y => :ⓨ,
      :z => :ⓩ,
      :'1' => :①,
      :'2' => :②,
      :'3' => :③,
      :'4' => :④,
      :'5' => :⑤,
      :'6' => :⑥,
      :'7' => :⑦,
      :'8' => :⑧,
      :'9' => :⑨,
      :'0' => :⓪
    }

    bubbled = text.split(//).map do |letter|
        bubs[letter.to_sym] || letter
    end.join('')

    `printf "#{bubbled}" | pbcopy` if RUBY_PLATFORM =~ /darwin/
    `printf "#{bubbled}" | xclip`  if RUBY_PLATFORM =~ /linux/
    puts bubbled
  end
end<commit_msg>Do not perform ⒸⓇⒶⓏⓎ `to_sym` convertion on every input char<commit_after># encoding: utf-8
class Bubs
  VERSION = '0.0.1'

  CONVERT_MAP = {
    'A' => 'Ⓐ',
    'B' => 'Ⓑ',
    'C' => 'Ⓒ',
    'D' => 'Ⓓ',
    'E' => 'Ⓔ',
    'F' => 'Ⓕ',
    'G' => 'Ⓖ',
    'H' => 'Ⓗ',
    'I' => 'Ⓘ',
    'J' => 'Ⓙ',
    'K' => 'Ⓚ',
    'L' => 'Ⓛ',
    'M' => 'Ⓜ',
    'N' => 'Ⓝ',
    'O' => 'Ⓞ',
    'P' => 'Ⓟ',
    'Q' => 'Ⓠ',
    'R' => 'Ⓡ',
    'S' => 'Ⓢ',
    'T' => 'Ⓣ',
    'U' => 'Ⓤ',
    'V' => 'Ⓥ',
    'W' => 'Ⓦ',
    'X' => 'Ⓧ',
    'Y' => 'Ⓨ',
    'Z' => 'Ⓩ',
    'a' => 'ⓐ',
    'b' => 'ⓑ',
    'c' => 'ⓒ',
    'd' => 'ⓓ',
    'e' => 'ⓔ',
    'f' => 'ⓕ',
    'g' => 'ⓖ',
    'h' => 'ⓗ',
    'i' => 'ⓘ',
    'j' => 'ⓙ',
    'k' => 'ⓚ',
    'l' => 'ⓛ',
    'm' => 'ⓜ',
    'n' => 'ⓝ',
    'o' => 'ⓞ',
    'p' => 'ⓟ',
    'q' => 'ⓠ',
    'r' => 'ⓡ',
    's' => 'ⓢ',
    't' => 'ⓣ',
    'u' => 'ⓤ',
    'v' => 'ⓥ',
    'w' => 'ⓦ',
    'x' => 'ⓧ',
    'y' => 'ⓨ',
    'z' => 'ⓩ',
    '1' => '①',
    '2' => '②',
    '3' => '③',
    '4' => '④',
    '5' => '⑤',
    '6' => '⑥',
    '7' => '⑦',
    '8' => '⑧',
    '9' => '⑨',
    '0' => '⓪'
  }

  # Convert words to ⓌⓄⓇⒹⓈ.
  #
  # Returns a String, but a much cooler string than what you had initially.
  def self.convert(text)
    bubbled = text.gsub(/[a-z0-9]/i, CONVERT_MAP)

    `printf "#{bubbled}" | pbcopy` if RUBY_PLATFORM =~ /darwin/
    `printf "#{bubbled}" | xclip`  if RUBY_PLATFORM =~ /linux/
    puts bubbled
  end
end
{'fraction_non_alphanumeric': 0.33905723905723906, 'fraction_numerical': 0.010101010101010102, 'mean_word_length': 1.395967741935484, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 127, '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': '3974105', 'n_tokens_mistral': 1740, 'n_tokens_neox': 1712, 'n_words': 352}