<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1" />
<link rel="stylesheet" type="text/css" href="style.css" media="all" />
<title>Italian Text Compressor</title>
</head>
<body>
<center>
<div style="width: 80%; position:absolute; left:10%; top:0%; z-index:1">
<br />
<div class="tabArea" align="center">
<a class="tab" href="ar_example.php">Arabic Example</a>
<a class="tab" href="en_example.php">English Example</a>
<a class="tab" href="fr_example.php">French Example</a>
<a class="tab" href="gr_example.php">German Example</a>
<a class="tab" href="it_example.php">Italian Example</a>
<a class="tab" href="sp_example.php">Spanish Example</a>
<a class="tab" href="about.html">About</a>
</div>
<div class="Paragraph">
<?php
include('ItZipStr.class.php');
$obj = new ItZipStr();
$file = 'it_example.txt';
$fh = fopen($file, 'r');
$str = fread($fh, filesize($file));
fclose($fh);
$zip = $obj->compress($str);
$before = strlen($str);
$after = strlen($zip);
$rate = round($after*100/$before);
echo "String size before was: $before Byte<br>";
echo "Compressed string size after is: $after Byte<br>";
echo "Rate $rate %<hr>";
$str = $obj->decompress($zip);
$word = 'governo';
if($obj->search($zip, $word)){
echo "Search for $word in zipped string and find it<hr>";
}else{
echo "Search for $word in zipped string and do not find it<hr>";
}
$len = $obj->length($zip);
echo "Original length of zipped string is $len Byte<hr>";
?>
<div align="justify">
<?=nl2br($str); ?>
</div>
</div>
</center>
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-1268287-1";
urchinTracker();
</script>
</body>
</html>
|