<commit_before>module Linear
	class Function
		attr_reader :slope, :y_intercept, :power
		def initialize(slope, y_intercept, power=1)
			@slope, @y_intercept, @power = slope, y_intercept, power
		end
		def execute(x)
			raise ArgumentError unless x.kind_of? Numeric
			return slope * x ** power + y_intercept
		end
		def to_s
			string = "f(x) = "
			string << case slope
				when 1 then String.new
				when -1 then ?-
			else
				slope
			end
			string << ?x
			string << power_string unless power == 1
			string << " + #{@y_intercept}" unless y_intercept.zero?
			return string
		end
		private
		def power_string
			final = String.new
			final += "\u207b" if @power < 0
			final << case @power
				when 0 then "\u2070"
				when 1 then "\u00b9"
				when 2 then "\u00b2"
				when 3 then "\u00b3"
				when 4 then "\u2074"
				when 5 then "\u2075"
				when 6 then "\u2076"
				when 7 then "\u2077"
				when 8 then "\u2078"
				when 9 then "\u2079"
			end
		end
	end<commit_msg>Update function.rb<commit_after>module Linear
	class Function
		attr_reader :slope, :y_intercept, :power
		def initialize(slope, y_intercept, power=1)
			@slope, @y_intercept, @power = slope, y_intercept, power
		end
		def execute(x)
			raise ArgumentError unless x.kind_of? Numeric
			return slope * x ** power + y_intercept
		end
		def to_s
			string = "f(x) = "
			string << case slope
				when 1 then String.new
				when -1 then ?-
			else
				slope
			end
			string << ?x
			string << power_string unless power == 1
			string << " + #{@y_intercept}" unless y_intercept.zero?
			return string
		end
		private
		def power_string
			final = String.new
			final += "\u207b" if @power < 0
			final << case @power
				when 0 then "\u2070"
				when 1 then "\u00b9"
				when 2 then "\u00b2"
				when 3 then "\u00b3"
				when 4 then "\u2074"
				when 5 then "\u2075"
				when 6 then "\u2076"
				when 7 then "\u2077"
				when 8 then "\u2078"
				when 9 then "\u2079"
			end
			return final
		end
	end
{'fraction_non_alphanumeric': 0.10299340436326737, 'fraction_numerical': 0.05580923389142567, 'mean_word_length': 2.55956678700361, 'pattern_counts': {'":': 0, '<': 25, '<?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': '1965171', 'n_tokens_mistral': 942, 'n_tokens_neox': 715, 'n_words': 240}