<commit_before>require "sartre/version"

module Sartre
  def method_missing name, *arguments
    super name, arguments unless name =~ /\?\Z/
    false unless respond_to? name
    !!send(name)
  end
end

class Object
  def method_missing name, *arguments
    super name, arguments unless name =~ /\?\Z/
    return !!send(name[0..-2]) rescue NoMethodError
    false
  end
end<commit_msg>Organize code a little better.<commit_after>require "sartre/version"

module Sartre
  protected
  def existential?(name)
    name =~ /\?\Z/
  end
  
  def try?(name)
    !!send(name)
  end
end

class Object
  include Sartre
  
  def method_missing name, *arguments
    super unless existential? name
    method = name[0..-2]
    return false unless respond_to? method
    try? method
  end
end
{'fraction_non_alphanumeric': 0.09640102827763496, 'fraction_numerical': 0.005141388174807198, 'mean_word_length': 3.143617021276596, 'pattern_counts': {'":': 0, '<': 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': '5645085', 'n_tokens_mistral': 259, 'n_tokens_neox': 252, 'n_words': 81}