<commit_before>class String
  def humanize
    self.split(/_|-| /).join(' ')
  end
  
  def titleize
    self.split(/_|-| /).each{|word| word[0...1] = word[0...1].upcase}.join(' ')
  end
  
  def empty?
    self.length < 1
  end
  
  def pluralize
    Inflector.inflections.pluralize self
  end
  
  def singularize
    Inflector.inflections.singularize self
  end
end

# Inflector is a singleton class that helps
# singularize, pluralize and other-thing-ize
# words. It is very much based on the Rails
# ActiveSupport implementation or Inflector
class Inflector
  def self.instance
    @__instance__ ||= new
  end
  
  def initialize
    reset
  end
  
  def reset
    @plurals = [
      [/^(.*)ee$/i, '\1ees'],     # attendee => attendees
      [/^(.*)us$/i, '\1i'],       # alumnus  => alumni
      [/^(.*s)$/i, '\1es'],       # pass     => passes
      [/^(.*)$/, '\1s']           # normal   => normals
    ]

    @singulars = [
      [/^(.*)ees$/i, '\1ee'],     # attendees  => attendee
      [/^(.*)es$/i, '\1'],        # passes     => pass
      [/^(.*)i$/i, '\1us'],       # alumni     => alumnus
      [/^(.*)s$/i, '\1']          # normals    => normal
    ]
    
    @irregulars = [
      ['person', 'people'],
      ['people', 'person']
    ]
    
    @uncountables = [
      'fish',
      'sheep'
    ]
  end
  
  attr_reader :plurals, :singulars, :uncountables, :irregulars
  
  def self.inflections
    if block_given?
      yield Inflector.instance
    else
      Inflector.instance
    end
  end
      
  def uncountable(word)<commit_msg>Added child => children irregular because it crops up so often.<commit_after>class String
  def humanize
    self.split(/_|-| /).join(' ')
  end
  
  def titleize
    self.split(/_|-| /).each{|word| word[0...1] = word[0...1].upcase}.join(' ')
  end
  
  def empty?
    self.length < 1
  end
  
  def pluralize
    Inflector.inflections.pluralize self
  end
  
  def singularize
    Inflector.inflections.singularize self
  end
end

# Inflector is a singleton class that helps
# singularize, pluralize and other-thing-ize
# words. It is very much based on the Rails
# ActiveSupport implementation or Inflector
class Inflector
  def self.instance
    @__instance__ ||= new
  end
  
  def initialize
    reset
  end
  
  def reset
    @plurals = [
      [/^(.*)ee$/i, '\1ees'],     # attendee => attendees
      [/^(.*)us$/i, '\1i'],       # alumnus  => alumni
      [/^(.*s)$/i, '\1es'],       # pass     => passes
      [/^(.*)$/, '\1s']           # normal   => normals
    ]

    @singulars = [
      [/^(.*)ees$/i, '\1ee'],     # attendees  => attendee
      [/^(.*)es$/i, '\1'],        # passes     => pass
      [/^(.*)i$/i, '\1us'],       # alumni     => alumnus
      [/^(.*)s$/i, '\1']          # normals    => normal
    ]
    
    @irregulars = [
      ['person', 'people'],
      ['people', 'person'],
      ['children', 'child'],
      ['child', 'children']
    ]
    
    @uncountables = [
      'fish',
      'sheep'
    ]
  end
  
  attr_reader :plurals, :singulars, :uncountables, :irregulars
  
  def self.inflections
    if block_given?
      yield Inflector.instance
    else
      Inflector.instance
    end
  end
      
  def uncountable(word)
{'fraction_non_alphanumeric': 0.16573383084577115, 'fraction_numerical': 0.00808457711442786, 'mean_word_length': 1.929872495446266, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 20, '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': '2937078', 'n_tokens_mistral': 1180, 'n_tokens_neox': 1109, 'n_words': 264}