<commit_before># encoding: utf-8
require 'sinatra'
require 'haml'

get "/" do
  haml :index
end

post "/encrypt" do
  @encrypted_text = encrypt
  @http_get_url = http_get_url
  haml :index
end

get "/encrypt" do
  @encrypted_text = encrypt
  @http_get_url = http_get_url
  haml :index
end

private
def encrypt
  result = ""

  case params[:algorithm]
  when "tanuki"
    result = tanuki(params[:text])
  end

  result
end

def tanuki(text)
  text.gsub(/(.{2})/) {|match| "た#{match}" }.unshift("た")
end

def http_get_url
  "#{url}?#{URI.encode_www_form(params)}"
end
<commit_msg>Fix a encrypt pattern<commit_after># encoding: utf-8
require 'sinatra'
require 'haml'

get "/" do
  haml :index
end

post "/encrypt" do
  @encrypted_text = encrypt
  @http_get_url = http_get_url
  haml :index
end

get "/encrypt" do
  @encrypted_text = encrypt
  @http_get_url = http_get_url
  haml :index
end

private
def encrypt
  result = ""

  case params[:algorithm]
  when "tanuki"
    result = tanuki(params[:text])
  end

  result
end

def tanuki(text)
  text.gsub(/(.{2})/) {|match| "#{match}た" }
end

def http_get_url
  "#{url}?#{URI.encode_www_form(params)}"
end

{'fraction_non_alphanumeric': 0.13814074717636837, 'fraction_numerical': 0.0034752389226759338, 'mean_word_length': 3.987012987012987, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2521680', 'n_tokens_mistral': 472, 'n_tokens_neox': 465, 'n_words': 114}