<commit_before>require "wiki_fetch/version"
require 'mechanize'

class Wiki
	def initialize()
		@@agent = Mechanize.new
  end

	def fetch(url)
		begin
			page_data = @@agent.get url
			page_data.body
		rescue => e
			e.message
		end
	end
end<commit_msg>lib and format change<commit_after>require "wiki_fetch/version"
require 'mechanize'

class Wiki
	def initialize()
		@@agent = Mechanize.new
  end

	def search(name, format = "json" )
		url = "http://en.wikipedia.org/w/api.php?format=#{format}&action=query&prop=extracts&exsentences=10&titles=#{name}"
		begin
			page_data = @@agent.get url
			return page_data.body
		rescue => e
			e.message
		end
	end
end
{'fraction_non_alphanumeric': 0.11987860394537178, 'fraction_numerical': 0.0030349013657056147, 'mean_word_length': 4.038167938931298, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '760609', 'n_tokens_mistral': 266, 'n_tokens_neox': 237, 'n_words': 55}