<commit_before>#!/usr/bin/ruby

contents = open("API.txt", "r").read.split("\n")

linuxLib = !ARGV[0].nil?

defaults = Hash.new { |h,k| ["readResponse() as #{k}", "null"] }
defaults["Boolean"] = ["readBoolResponse()", "false"]
defaults["Number"] = ["readFloatResponse()", "0.0"]
defaults["int"] = ["readIntResponse()", "0"]
defaults["uint"] = ["readIntResponse()", "0"]
defaults["String"] = ["readStringResponse()", "\"\""]

num = 0
# skip first line (init) when generating actual functions, since it has a
# special implementation in both libs
skip = (ARGV[0] == "f" or ARGV[0] == "c") ? 0 : 1
contents.drop(skip).each do |line|
	if line.empty? or line[0].chr == "/"
		puts "\t\t#{line}".rstrip
		next
	end

	match = line.match /function ([^(]+)\(([^)]*)\):(.+)/
	($stderr.puts "Invalid line: #{line}"; next) unless match
<commit_msg>Remove obsolete variable.<commit_after>#!/usr/bin/ruby

contents = open("API.txt", "r").read.split("\n")

defaults = Hash.new { |h,k| ["readResponse() as #{k}", "null"] }
defaults["Boolean"] = ["readBoolResponse()", "false"]
defaults["Number"] = ["readFloatResponse()", "0.0"]
defaults["int"] = ["readIntResponse()", "0"]
defaults["uint"] = ["readIntResponse()", "0"]
defaults["String"] = ["readStringResponse()", "\"\""]

num = 0
# skip first line (init) when generating actual functions, since it has a
# special implementation in both libs
skip = (ARGV[0] == "f" or ARGV[0] == "c") ? 0 : 1
contents.drop(skip).each do |line|
	if line.empty? or line[0].chr == "/"
		puts "\t\t#{line}".rstrip
		next
	end

	match = line.match /function ([^(]+)\(([^)]*)\):(.+)/
	($stderr.puts "Invalid line: #{line}"; next) unless match

{'fraction_non_alphanumeric': 0.24939613526570048, 'fraction_numerical': 0.012681159420289856, 'mean_word_length': 5.025454545454545, 'pattern_counts': {'":': 0, '<': 3, '<?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': '2593896', 'n_tokens_mistral': 611, 'n_tokens_neox': 585, 'n_words': 150}