Example #1
0
require_once "../uti/StatisticFileReader.php";
// Set the content-type
$sfr = new StatisticFileReader();
$sfr->load("/tmp/xyz_.~books~c~cb_gospel.htm");
//$sfr->load("/tmp/xyz_.~books~e~bible_bbe.htm");
//$sfr->test();
//echo "aaa";
$sfr2 = new StatisticFileReader();
$sfr2->load("/tmp/xyz_.~books~c~cb_ot.htm");
$sfr3 = new StatisticFileReader();
$sfr3->load("/tmp/xyz_.~books~e~daughter - Copy (13).htm");
$sfr4 = new StatisticFileReader();
$sfr4->load("/tmp/xyz_.~books~c~HongLouMeng.htm");
$sfr5 = new StatisticFileReader();
$sfr5->load("/tmp/xyz_.~books~c~SanGuoYanYi.htm");
$sfr6 = new StatisticFileReader();
$sfr6->load("/tmp/xyz_.~books~c~MaoZeDongZhuZhuo.htm");
$ge = new GraphicsEnvironment(4000, 400);
$ge->addColor("black", 0, 0, 0);
$ge->addColor("red", 255, 0, 0);
$ge->addColor("green", 0, 255, 0);
$ge->addColor("blue", 0, 0, 255);
$gobjs = array();
$gobjs[] = new Line("black", 10, 5, 100, 200);
$gobjs[] = new Line("blue", 200, 150, 390, 380);
$gobjs[] = new Line("red", 60, 40, 10, 300);
$gobjs[] = new Line("green", 5, 390, 390, 10);
foreach ($gobjs as $gobj) {
    $gobj->render($ge);
}
$img = "/tmp/test.png";
}
$file0 = setfile(0);
//$_REQUEST["sel_0"];
$file1 = setfile(1);
//$_REQUEST["sel_1"];
//$_SESSION["sel_0"] = $file0;
//$_SESSION["sel_1"] = $file1;
print "{$file0} <=> {$file1} <a href='book_statistic_compareGraph.php'>View Graph</a><br>\r\n";
syslog(0, "file0={$file0},file1={$file1}");
$sc = new StatisticCompare();
$sc->compare($file0, $file1);
$sc->show("statistic_compareGraph.php");
exit(0);
$sfr0 = new StatisticFileReader();
$sfr0->load("/tmp/{$file0}");
$sfr1 = new StatisticFileReader();
$sfr1->load("/tmp/{$file1}");
$stam = new StatisticMatch();
$stam->match2($sfr0->words, $sfr1->words);
$iMax = count($sfr0->statistic);
if ($iMax > count($sfr1->statistic)) {
    $iMax = count($sfr1->statistic);
}
for ($ii = 0; $ii < $iMax; $ii++) {
    if ($stam->IsMatch($ii)) {
        print "*****";
    } else {
        print "- - - -";
    }
    print $sfr0->statistic[$ii] . "===" . $sfr1->statistic[$ii] . "<br>";
}