<commit_before>require 'rubygems'
require 'spec'
gem 'activerecord', '=2.3.5'
require 'active_record'

$:.unshift((File.join(File.dirname(__FILE__), '..', 'lib')))
require 'spatial_adapter'

include GeoRuby::SimpleFeatures

def postgis_connection
  ActiveRecord::Base.establish_connection(
    :adapter => 'postgresql',
    :database => 'spatial_adapter'
  )
end

class GeometryFactory
  class << self
    def point
      Point.from_x_y(1, 2, 4326)
    end
    
    def line_string
      LineString.from_coordinates([[1.4,2.5],[1.5,6.7]], 4326)
    end
    
    def polygon
      Polygon.from_coordinates([[[12.4,-45.3],[45.4,41.6],[4.456,1.0698],[12.4,-45.3]],[[2.4,5.3],[5.4,1.4263],[14.46,1.06],[2.4,5.3]]], 4326)
    end
    
    def multi_point
      MultiPoint.from_coordinates([[12.4,-123.3],[-65.1,123.4],[123.55555555,123]], 4326)
    end<commit_msg>Don't need to require active_record again<commit_after>require 'rubygems'
require 'spec'
gem 'activerecord', '=2.3.5'

$:.unshift((File.join(File.dirname(__FILE__), '..', 'lib')))
require 'spatial_adapter'

include GeoRuby::SimpleFeatures

def postgis_connection
  ActiveRecord::Base.establish_connection(
    :adapter => 'postgresql',
    :database => 'spatial_adapter'
  )
end

class GeometryFactory
  class << self
    def point
      Point.from_x_y(1, 2, 4326)
    end
    
    def line_string
      LineString.from_coordinates([[1.4,2.5],[1.5,6.7]], 4326)
    end
    
    def polygon
      Polygon.from_coordinates([[[12.4,-45.3],[45.4,41.6],[4.456,1.0698],[12.4,-45.3]],[[2.4,5.3],[5.4,1.4263],[14.46,1.06],[2.4,5.3]]], 4326)
    end
    
    def multi_point
      MultiPoint.from_coordinates([[12.4,-123.3],[-65.1,123.4],[123.55555555,123]], 4326)
    end
{'fraction_non_alphanumeric': 0.1910569105691057, 'fraction_numerical': 0.12311265969802555, 'mean_word_length': 3.682065217391304, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '1505958', 'n_tokens_mistral': 809, 'n_tokens_neox': 683, 'n_words': 98}