<commit_before>class Location < ActiveRecord::Base
  has_many :events
  
  def to_s
    location
  end
end<commit_msg>Add instance method for locations to resolve themselves<commit_after>class Location < ActiveRecord::Base
  has_many :events
  
  def to_s
    location
  end

  def resolve_location
    loc = LocationResolver.new(location).resolve
    unless loc.empty?
      self.latitude = loc['latitude']
      self.longitude = loc['longitude']
      binding.pry
      save
    end
  end
end
{'fraction_non_alphanumeric': 0.06882591093117409, 'fraction_numerical': 0.0, 'mean_word_length': 3.194915254237288, 'pattern_counts': {'":': 0, '<': 5, '<?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': '2811541', 'n_tokens_mistral': 149, 'n_tokens_neox': 147, 'n_words': 40}