<commit_before>class ApiController < ApplicationController
	before_action :change_query_order, only: :index

	@@order = :id

	def change_query_order
		unless params[:order] == nil
			orders = params[:order].split(",")

			orders.map! do |order|
				order_direction = order.strip.split(".")

				(order_direction.length == 1) ? order_direction[0].to_sym : "#{order_direction[0]} #{order_direction[1]}"
			end

			@@order = orders
		end
	end
end
<commit_msg>Add Query API Method To Be Used By API Controllers<commit_after>class ApiController < ApplicationController
	before_action :change_query_order, :add_querying, only: :index

	@@order = :id
	@@query = nil

	def add_querying
		@@query = "%#{params[:q].downcase}%" unless params[:q] == nil
	end

	def change_query_order
		unless params[:order] == nil
			orders = params[:order].split(",")

			orders.map! do |order|
				order_direction = order.strip.split(".")

				(order_direction.length == 1) ? order_direction[0].to_sym : "#{order_direction[0]} #{order_direction[1]}"
			end

			@@order = orders
		end
	end
end

{'fraction_non_alphanumeric': 0.14245548266166824, 'fraction_numerical': 0.007497656982193065, 'mean_word_length': 4.533678756476684, 'pattern_counts': {'":': 0, '<': 5, '<?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': '2342548', 'n_tokens_mistral': 392, 'n_tokens_neox': 348, 'n_words': 84}