<commit_before># Usage:
# Geocoder.geocode address, (results, status) ->
#   if status == Geocoder.OK
#     console.log results[0].geometry.location
#   else
#     console.log "Error: #{status}"

Darkswarm.service "Geocoder", ->
  new class Geocoder
    OK: google.maps.GeocoderStatus.OK

    geocode: (address, callback) ->
      geocoder = new google.maps.Geocoder()
      geocoder.geocode {'address': address}, callback<commit_msg>Generalise Geocoder service to Geo, add distanceBetween method<commit_after># Usage:
# Geo.geocode address, (results, status) ->
#   if status == Geo.OK
#     console.log results[0].geometry.location
#   else
#     console.log "Error: #{status}"

Darkswarm.service "Geo", ->
  new class Geo
    OK: google.maps.GeocoderStatus.OK

    geocode: (address, callback) ->
      geocoder = new google.maps.Geocoder()
      geocoder.geocode {'address': address}, callback

    distanceBetween: (locatable, location) ->
      latLng = new google.maps.LatLng locatable.latitude, locatable.longitude
      google.maps.geometry.spherical.computeDistanceBetween latLng, results[0].geometry.location
{'fraction_non_alphanumeric': 0.12689901697944594, 'fraction_numerical': 0.002680965147453083, 'mean_word_length': 3.765957446808511, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 10, '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': '7389837', 'n_tokens_mistral': 369, 'n_tokens_neox': 355, 'n_words': 81}