?> </span> <?php } } if ($PRESENTATION == "TABLE") { echo "</TABLE>"; } //preprint_r($UTHMANI_TO_SIMPLE_LOCATION_MAP); //preprint_r($UTHMANI_TO_SIMPLE_WORD_MAP_AND_VS); } ////### EXTRACTING PHRASE TERMS USING NGRAMS if ($GENERATE_PHRASE_TERMS) { $phraseTerms = getNGrams("AR", 2); //$phraseTermsHIST = histogramFromArray($phraseTerms); //echoN( arrayToCSV($phraseTermsHIST)); //preprint_r($phraseTermsHIST); //preprint_r($phraseTerms); echoN("COUNT B4 FILTER:" . count($phraseTerms)); $filteredBiGrams = array(); $filteredBiGramsPOS = array(); $allPOSTags = array(); $allPOSCombinations = array(); $counter = 0; foreach ($phraseTerms as $biGram => $freq) { $wordsArr = preg_split("/ /", $biGram); //if ( $counter++ > 300 ){ break;} $posTagsForCurrentBiGram = ""; $allPosTagsForCurrentBiGramArr = array();
# # You can use Quran Analysis code, framework or corpora in your website # or application (commercial/non-commercial) provided that you link # back to www.qurananalysis.com and sufficient credits are given. # # ==================================================================== require_once "../global.settings.php"; $lang = "AR"; if (isset($_GET['lang'])) { $lang = $_GET['lang']; } loadModels("core,qac", $lang); $parameter = $_GET['parameter']; $grams = $parameter; $nGramesArr = array(); $nGramesArr = getNGrams($lang, $grams); //echoN("N-Grams Avg:".($avgCollocationFreq/($nGramsCount))); //$secondArr = array_slice($nGramesArr, floor($nGramsCount/2), 5); //preprint_r( ($secondArr)); //arrayToCSV($nGramesArr); //$histoArr = histogramFromArray($nGramesArr); //plotHistogram($nGramesArr); /*foreach($histoArr as $key=>$val) { echoN("$key,$val"); }*/ $avgCollocationFreq = array_sum($nGramesArr); $nGramsCount = count($nGramesArr); ?> <table id='ngrams-results-table'>