-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathspimi.php
More file actions
44 lines (32 loc) · 795 Bytes
/
Copy pathspimi.php
File metadata and controls
44 lines (32 loc) · 795 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
error_reporting(0);
ini_set('max_execution_time', 1500);
$time_start = microtime(true);
include('vars.php');
include('functions.php');
$docID = 21;
foreach($reuters as $val)
{
$doc = parseDocument($val);
$tokensResult = Array();
if(is_array($doc))
{
$tokensResult = makeTokens($doc[1],$doc[2]);
$saved = saveToFile($tokensResult,$docID);
if($saved == true)
echo $docID.".json file saved <br />";
else
echo "Failed saving data to file <br />";
$docID = $docID + 1;
}
else
echo "Invalid Data.";
}
if(mergeBlocks())
echo "Merging done and final index is saved";
else
echo "Issue with merging. Try again";
$time_end = microtime(true);
$time = $time_end - $time_start;
echo "Parsing execution time is : <b> ".round($time)." microseconds</b>";
?>