<commit_before>-- Copyright (C) 2006 <NAME> <<EMAIL>>
-- Licensed under so called MIT license.

-- print "hello from sample.lua!\n"

-- All these values are treated as Lua patterns, 
-- except the map_to and custom_map_func fields.
-- In map_to these have special meaning:
--
-- "="			map to tools_root .. "/" .. path
-- "=/some/path"	map to tools_root .. "/some/path" .. "/" .. path
-- nil			no mapping, use straight
--
-- Any other value is prepended to path (map_to .. "/" .. path).
-- 
-- The rules are exported from this file to the main.lua engine
-- by putting them all into export_rules table variable.
-- They will be evaluated in the order they are listed there.
-- Also the files matching parts/*.lua are sorted alphabetically
-- and used in that order.
--
-- custom_map_func allows you to specify your own path mapping logic.
-- The function takes these parameters: 
-- function(binary_name, func_name, work_dir, real_path, path, rule) 
-- and is expected to return the mapped path. rule argument contains
-- the rule which triggered the function invocation.

default_rule1 = {
	binary = ".*",
	func_name = ".*",
	func_param = nil,
	path = "^/bin",
	map_to = "=",
	custom_map_func = nil
}

default_rule2 = {
	binary = ".*",
	func_name = "^exec",
	func_param = nil,
	path = "^/usr/bin",
	map_to = "=",
	custom_map_func = nil
}

default_rule3 = {
	binary = ".*",
	func_name = ".*",
	func_param = nil,
	path = "^/scratchbox",
	map_to = nil,
	custom_map_func = nil
}

default_rule4 = {
	binary = ".*",
	func_name = ".*",
	func_param = nil,
	path = "^/[^/]*$",
	map_to = nil,
	custom_map_func = nil
}

export_rules = {
	default_rule1,
	default_rule2,
	default_rule3,
	default_rule4
}
<commit_msg>* handle home directory correctly<commit_after>-- Copyright (C) 2006 <NAME> <<EMAIL>>
-- Licensed under so called MIT license.

-- print "hello from sample.lua!\n"

-- All these values are treated as Lua patterns, 
-- except the map_to and custom_map_func fields.
-- In map_to these have special meaning:
--
-- "="			map to tools_root .. "/" .. path
-- "=/some/path"	map to tools_root .. "/some/path" .. "/" .. path
-- nil			no mapping, use straight
--
-- Any other value is prepended to path (map_to .. "/" .. path).
-- 
-- The rules are exported from this file to the main.lua engine
-- by putting them all into export_rules table variable.
-- They will be evaluated in the order they are listed there.
-- Also the files matching parts/*.lua are sorted alphabetically
-- and used in that order.
--
-- custom_map_func allows you to specify your own path mapping logic.
-- The function takes these parameters: 
-- function(binary_name, func_name, work_dir, real_path, path, rule) 
-- and is expected to return the mapped path. rule argument contains
-- the rule which triggered the function invocation.

default_rule1 = {
	binary = ".*",
	func_name = ".*",
	func_param = nil,
	path = "^/bin",
	map_to = "=",
	custom_map_func = nil
}

default_rule2 = {
	binary = ".*",
	func_name = "^exec",
	func_param = nil,
	path = "^/usr/bin",
	map_to = "=",
	custom_map_func = nil
}

default_rule3 = {
	binary = ".*",
	func_name = ".*",
	func_param = nil,
	path = "^/scratchbox",
	map_to = nil,
	custom_map_func = nil
}

default_home = {
	binary = ".*",
	func_name = ".*",
	func_param = nil,
	path = "^/home",
	map_to = nil,
	custom_map_func = nil
}

default_rootdir = {
	binary = ".*",
	func_name = ".*",
	func_param = nil,
	path = "^/[^/]*$",
	map_to = nil,
	custom_map_func = nil
}

export_rules = {
	default_rule1,
	default_rule2,
	default_rule3,
	default_rootdir,
	default_home
}

{'fraction_non_alphanumeric': 0.14601398601398602, 'fraction_numerical': 0.006153846153846154, 'mean_word_length': 3.153310104529617, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '5808394', 'n_tokens_mistral': 1272, 'n_tokens_neox': 1238, 'n_words': 394}