<commit_before>require "linear1/function"
module Linear1
	class SlopeIntercept < Function
		def self.try_convert obj
			converter = case obj
				when ->(obj) {obj.respond_to? :to_slope_intercept} then :to_slope_intercept
				when ->(obj) {obj.respond_to? :to_si} then :to_si
			else fail TypeError, "Could not convert #{obj} to SlopeIntercept" end
			obj.public_send converter
		end
		def initialize(slope, y_intercept)
			super
		end
		def to_s
			super.sub "f(x)", "y"
		end
		def to_standard
			require "linear1/standard"
			Standard.new slope, -1, -y_intercept
		end
		alias to_sf to_standard
	end
	module_function; def SlopeIntercept(*args) # @see SlopeIntercept.new, SlopeIntercept.try_convert
		case args.length
			when 1 then SlopeIntercept.try_convert(*args)
			when 2 then SlopeIntercept.new(*args)
		else fail ArgumentError, "Expected 1..2 arguments. Got #{args.length}" end
	end
end<commit_msg>Update slope_intercept.rb<commit_after>require "linear1/function"
module Linear1
	class SlopeIntercept < Function
		def self.try_convert obj
			converter = case obj
				when ->(obj) {obj.respond_to? :to_slope_intercept} then :to_slope_intercept
				when ->(obj) {obj.respond_to? :to_si} then :to_si
			else fail TypeError, "Could not convert #{obj} to SlopeIntercept" end
			obj.public_send converter
		end
		def initialize(slope, y_intercept)
			super
		end
		def to_s
			super.sub "f(x)", "y"
		end
		def to_ps
			require "linear1/point_slope"
			PointSlope 0, @y_intercept, @slope
		end
		alias to_point_slope
		def to_sf
			require "linear1/standard"
			Standard.new @slope, -1, -@y_intercept
		end
	end
	module_function; def SlopeIntercept(*args) # @see SlopeIntercept.new, SlopeIntercept.try_convert
		case args.length
			when 1 then SlopeIntercept.try_convert(*args)
			when 2 then SlopeIntercept.new(*args)
		else fail ArgumentError, "Expected 1..2 arguments. Got #{args.length}" end
	end
end
{'fraction_non_alphanumeric': 0.09233997901364113, 'fraction_numerical': 0.00944386149003148, 'mean_word_length': 4.182065217391305, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '2465082', 'n_tokens_mistral': 758, 'n_tokens_neox': 670, 'n_words': 186}