<commit_before>
require 'net/http'
require 'uri'

class Tide

  POST_URL      = 'http://www.waterlevels.gc.ca/cgi-bin/tide-shc.cgi'
  TIDE_REGEX    = /#\sDate;Time;Height<br>(.*)<br><\/p><\/td>/
  STATION_REGEX = /#\sStation\s:\s(.*)\s\(\d+\).*/
  INIT_DEFAULTS = { :station => 610, :timezone => 'AST', :date => Time.now }

  attr_reader :location

  # Create new tide table.
  def initialize(options = {})
    options     = INIT_DEFAULTS.merge(options)
    @station    = options[:station]
    @timezone   = options[:timezone]
    @date       = options[:date]
    @location   = data.match(STATION_REGEX)[1]
  end

  # Shortcut for station lookup
  def self.station(sid)
    new(:station => sid)
  end<commit_msg>Moved init defaults out of constant, into init method<commit_after>
require 'net/http'
require 'uri'

class Tide

  POST_URL      = 'http://www.waterlevels.gc.ca/cgi-bin/tide-shc.cgi'
  TIDE_REGEX    = /#\sDate;Time;Height<br>(.*)<br><\/p><\/td>/
  STATION_REGEX = /#\sStation\s:\s(.*)\s\(\d+\).*/

  attr_reader :location

  # Create new tide table.
  def initialize(options = {})
    options     = { :station => 610, :timezone => 'AST', :date => Time.now }.merge(options)
    @station    = options[:station]
    @timezone   = options[:timezone]
    @date       = options[:date]
    @location   = data.match(STATION_REGEX)[1]
  end

  # Shortcut for station lookup
  def self.station(sid)
    new(:station => sid)
  end
{'fraction_non_alphanumeric': 0.17597765363128492, 'fraction_numerical': 0.00558659217877095, 'mean_word_length': 3.0027932960893855, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '3039630', 'n_tokens_mistral': 546, 'n_tokens_neox': 524, 'n_words': 102}