<commit_before><?php
require_once "database.php";
require_once "semanticsimilarity.php";

use \Desertlion\semanticsimilarity as SS;
?>
<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Semantic Web &raquo; Using Wordnet Database</title>
	<style>
		* { margin: 0 auto; padding: 0;	}
		body { font-family: sans-serif; font-size: 14px; padding: 35px; background: #333; }
		#container { background: #efefef; width: 70%; padding: 20px; border-radius: 5px; box-shadow: 0 2px 3px rgba(0,0,0,.3); }
		table { width: 100%; border-collapse: collapse; }
		td { border: 1px solid #ddd; padding: 5px 7px; vertical-align: top; }
	</style>
</head>
<body>
	<div id="container">
		<?php 
		$word = new SS('memory'); 
		$kata[0][wordid] = $word->getWordId();
		$kata[0][synsetid] = $word->getSynsetId($kata[0][wordid]);
		$kata[0][definition] = $word->getDefinition($kata[0][synsetid]);
		$kata[0][hypernim] = $word->getHypernim($kata[0][wordid]);
		?><commit_msg>Tambah Testing 11 item di index.php, lihat waktu loadingnya<commit_after><?php
require_once "database.php";
require_once "semanticsimilarity.php";

use \Desertlion\semanticsimilarity as SS;
?>
<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Semantic Web &raquo; Using Wordnet Database</title>
	<style>
		* { margin: 0 auto; padding: 0;	}
		body { font-family: sans-serif; font-size: 14px; padding: 35px; background: #333; }
		#container { background: #efefef; width: 70%; padding: 20px; border-radius: 5px; box-shadow: 0 2px 3px rgba(0,0,0,.3); }
		table { width: 100%; border-collapse: collapse; }
		td { border: 1px solid #ddd; padding: 5px 7px; vertical-align: top; }
	</style>
</head>
<body>
	<div id="container">
		<?php 
		function waktunyo()
		{
			$mtime = microtime(); 
		    $mtime = explode(" ",$mtime); 
		    $mtime = $mtime[1] + $mtime[0]; 
		    return $mtime;
		}

		$starttime = waktunyo();
		$word[0] = new SS('memory'); 
		$kata[0][wordid] = $word[0]->getWordId();
		$kata[0][synsetid] = $word[0]->getSynsetId($kata[0][wordid]);
		$kata[0][hypernim] = $word[0]->getHypernim($kata[0][wordid]);

		$kata2 = array('memory','flashdisk','computer','earphone','printer','headphone','speaker','headset','power','case');
		$i=1;
		foreach($kata2 as $Kata):
			$word[$i] = new SS($Kata);
			$kata[$i][wordid] = $word[$i]->getWordId();
			if(count($kata[$i][wordid])>0):
				$kata[$i][synsetid] = $word[$i]->getSynsetId($kata[$i][wordid]);
				$kata[$i][hypernim] = $word[$i]->getHypernim($kata[$i][wordid]);
			else:
				$kata[$i][hypernim] = array();
			endif;
			$i++;
		endforeach;
		?>
		<pre>
			<?php var_dump($kata); ?>
		</pre>
		<?php
		$endtime = waktunyo(); 
		$totaltime = ($endtime - $starttime); 
		echo "Execution time ".number_format($totaltime,7,",",".")." seconds"; 
		?>
{'fraction_non_alphanumeric': 0.21533500537441777, 'fraction_numerical': 0.029021855965603725, 'mean_word_length': 4.853249475890985, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 44, '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': '4567438', 'n_tokens_mistral': 1253, 'n_tokens_neox': 1107, 'n_words': 223}