<commit_before><?php

# Output should be valid for Mobile Web Standards (ie: XHTML1.1 Basic+CSS1)
# There is only one exception concerning RTL support

# HTTP header
header("Content-Type: application/xhtml+xml; charset=UTF-8");
header("Content-Language: ar");

header("Cache-Control: max-age=3600, must-revalidate");
header("Last-Modified: Mon, 13 Oct 2011 00:00:00 GMT");

# Check GET parameters
if (count($_GET)<1) {
		$show_result=False;
	}
	elseif (count($_GET)<2) {
		$search=$_GET["search"];
		$page=1;
		$show_result=True;
	}
	else {
		$search=$_GET["search"];
		$page=$_GET["page"];
		$show_result=True;
	}
if ($show_result) {

# Hidden parameters
$sortedby="mushaf";
$recitation="<NAME>";
$translation="None";
$highlight="css";

# Encode JSON query URL
$query_site = "http://www.alfanous.org/json?";
$query_search = "search=" . urlencode($search);
$query_page = "&page=" . urlencode($page);
$query_string =  "&sortedby=" . urlencode($sortedby)
	. "&recitation=" . urlencode($recitation)
	. "&translation=" . urlencode($translation)
	. "&highlight=" . urlencode($highlight);

# JSON query
$handle = fopen($query_site . $query_search . $query_page . $query_string, "rb");
$contents = stream_get_contents($handle);
fclose($handle);

$json = json_decode($contents);
# test
#var_dump($json);

};

# XHTML header
print('
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN"
    "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

	<title>Alfanous</title>

	<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
	<link rel="shortcut icon" type="image/gif" href="icon.gif" />
');<commit_msg>Add fuzzy search support, mobile wui<commit_after><?php

# Output should be valid for Mobile Web Standards (ie: XHTML1.1 Basic+CSS1)
# There is only one exception concerning RTL support

# HTTP header
header("Content-Type: application/xhtml+xml; charset=UTF-8");
header("Content-Language: ar");

header("Cache-Control: max-age=3600, must-revalidate");
header("Last-Modified: Mon, 13 Oct 2011 00:00:00 GMT");

# Check GET parameters
if (count($_GET)<1) {
		$show_result=False;
	}
	elseif (count($_GET)<2) {
		$search=$_GET["search"];
		$page=1;
		$show_result=True;
	}
	else {
		$search=$_GET["search"];
		$page=$_GET["page"];
		$show_result=True;
	}
if ($show_result) {

# Hidden parameters
$sortedby="mushaf";
$recitation="<NAME>";
$translation="None";
$highlight="css";
$fuzzy="ok";

# Encode JSON query URL
$query_site = "http://www.alfanous.org/json?";
$query_search = "search=" . urlencode($search);
$query_page = "&page=" . urlencode($page);
$query_string =  "&sortedby=" . urlencode($sortedby)
	. "&recitation=" . urlencode($recitation)
	. "&translation=" . urlencode($translation)
	. "&highlight=" . urlencode($highlight)
	. "&fuzzy=" . urlencode($fuzzy);

# JSON query
$handle = fopen($query_site . $query_search . $query_page . $query_string, "rb");
$contents = stream_get_contents($handle);
fclose($handle);

$json = json_decode($contents);
# test
#var_dump($json);

};

# XHTML header
print('
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN"
    "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

	<title>Alfanous</title>

	<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
	<link rel="shortcut icon" type="image/gif" href="icon.gif" />
');
{'fraction_non_alphanumeric': 0.1960268770084721, 'fraction_numerical': 0.02044989775051125, 'mean_word_length': 5.43609022556391, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 6, 'xml': 6}, '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': '1539726', 'n_tokens_mistral': 1335, 'n_tokens_neox': 1235, 'n_words': 248}