<commit_before>--
-- Written by xphh 2015 with 'MIT License'
--
local req = http.req

local page = config.webpage_root..req.uri_path
local f = io.open(page, "rb")
if f == nil then
	http.exit(404)
	return
end

local ext = ""
local pos = string.find(req.uri_path, ".")
if pos ~= nil then
	ext = string.sub(req.uri_path, pos + 1)
end
<commit_msg>parse file ext bug<commit_after>--
-- Written by xphh 2015 with 'MIT License'
--
local req = http.req

local page = config.webpage_root..req.uri_path
local f = io.open(page, "rb")
if f == nil then
	http.exit(404)
	return
end

local ext = ""
local pos = string.find(req.uri_path, "%.")
if pos ~= nil then
	ext = string.sub(req.uri_path, pos + 1)
end

{'fraction_non_alphanumeric': 0.14884393063583815, 'fraction_numerical': 0.023121387283236993, 'mean_word_length': 3.5, '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': '3293189', 'n_tokens_mistral': 278, 'n_tokens_neox': 263, 'n_words': 81}