<commit_before>module Beatport
  module Support
    def self.constantize(string)
      Beatport.const_get(string.capitalize)      
    end
  end
end<commit_msg>Add camelize and underscore functions for future usage<commit_after>module Beatport
  module Support
    def self.constantize(string)
      Beatport.const_get(string.capitalize)      
    end
    
    def self.camelize(lower_case_and_underscored_word, first_letter_in_uppercase = true)
      if first_letter_in_uppercase
        lower_case_and_underscored_word.to_s.gsub(/\/(.?)/) { "::#{$1.upcase}" }.gsub(/(?:^|_)(.)/) { $1.upcase }
      else
        lower_case_and_underscored_word.to_s[0].chr.downcase + camelize(lower_case_and_underscored_word)[1..-1]
      end
    end    
    
    def self.underscore(camel_cased_word)
      word = camel_cased_word.to_s.dup
      word.gsub!(/::/, '/')
      word.gsub!(/([A-Z]+)([A-Z][a-z])/,'\1_\2')
      word.gsub!(/([a-z\d])([A-Z])/,'\1_\2')
      word.tr!("-", "_")
      word.downcase!
      word
    end
  end
end
{'fraction_non_alphanumeric': 0.15264187866927592, 'fraction_numerical': 0.008806262230919765, 'mean_word_length': 2.845864661654135, 'pattern_counts': {'":': 1, '<': 3, '<?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': '5488906', 'n_tokens_mistral': 398, 'n_tokens_neox': 388, 'n_words': 52}