/** * Override intialize of the Shell * * @access public */ function initialize() { $this->models = @loadModels(); foreach ($this->models as $model) { $class = Inflector::camelize(r('.php', '', $model)); $this->models[$model] = $class; $this->{$class} =& new $class(); } $this->out('Model classes:'); $this->out('--------------'); foreach ($this->models as $model) { $this->out(" - {$model}"); } }
# GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # # 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", $lang); ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Quran Word Collocation | Quran Analysis</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="description" content="Collocation of words in the Quran"> <meta name="author" content=""> <script type="text/javascript" src="<?php echo $JQUERY_PATH; ?> " ></script> <script type="text/javascript" src="<?php
# This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # # 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"; require_once "../libs/core.lib.php"; loadModels("core,qac", "AR"); $LEMMA_TO_SIMPLE_WORD_MAP = loadLemmaToSimpleMappingTable(); printHTMLPageHeader(); //$qacMasterTableEntryArr2 = getModelEntryFromMemory("AR","MODEL_QAC","QAC_POS",$qacLocation); $qacPoSTagsIterator = getAPCIterator("AR\\/MODEL_QAC\\/QAC_POS\\/.*"); $QURAN_TEXT = getModelEntryFromMemory("AR", "MODEL_CORE", "QURAN_TEXT", ""); $TOTALS = getModelEntryFromMemory("AR", "MODEL_CORE", "TOTALS", ""); $PAUSEMARKS = $TOTALS['PAUSEMARKS']; preprint_r($PAUSEMARKS); foreach ($qacPoSTagsIterator as $qacPoSTagsIteratorCursor) { $POS_ARR = $qacPoSTagsIteratorCursor['value']; $key = $qacPoSTagsIteratorCursor['key']; $POS = getEntryKeyFromAPCKey($key); if ($POS == "N" || $POS == "PN" || $POS == "ADJ") { continue; }
if ($isInTestScript) { $query = $testQuery; } $originalQuery = $query; $script = $_GET['script']; if (empty($script)) { $script = "simple"; } ///DETEDCT LANGUAGE //LOCATION SIGNIFICANT if (isArabicString($query)) { $lang = "AR"; $direction = "rtl"; } //echoN(memory_get_peak_usage()); //echoN(time()); loadModels("core,search,qac,ontology", $lang); //echoN(time()); $RESOURCES = getModelEntryFromMemory($lang, "MODEL_CORE", "RESOURCES", ""); $META_DATA = getModelEntryFromMemory($lang, "MODEL_CORE", "META_DATA", ""); $significantWords = array(); //echoN($query);exit; //echoN(memory_get_peak_usage()); //$TRANSLATION_MAP_EN_TO_AR = apc_fetch("WORDS_TRANSLATIONS_EN_AR"); //preprint_r($TRANSLATION_MAP_EN_TO_AR); $isPhraseSearch = false; $isQuestion = false; $isColumnSearch = false; $columnSearchType = null; $columnSearchKeyValParams = null; $noDerivationsConstraint = false; $noOntologyExtentionConstraint = false;
require_once "../libs/core.lib.php"; require_once "../libs/search.lib.php"; $lang = "AR"; if (isset($_GET['lang'])) { $lang = $_GET['lang']; } $word = $_GET['word']; $word = html_entity_decode($word); if (empty($word)) { exit; } if (isArabicString($word)) { loadModels("core", "AR"); $lang = "AR"; } else { loadModels("core", "EN"); $lang = "EN"; } $similarWordsArr = getSimilarWords($lang, array($word)); ?> <br> <b>Similar Words (Character Similarity)</b> <ul> <?php $i = 0; foreach ($similarWordsArr as $similarWord => $score) { if ($i++ > 20) { break; } ?>
# GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # # 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']; $nGramesArr = array(); $posPatternString = trim($parameter); $nGramesArr = getPoSNGrams($posPatternString); $avgCollocationFreq = array_sum($nGramesArr); $nGramsCount = count($nGramesArr); ?> <table id='ngrams-results-table'> <thead> <tr> <td colspan='2'> Number of N-Grams:<b><?php echo addCommasToNumber($nGramsCount);
# This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # # 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"; loadModels("", $lang); $QURAN_TEXT = getModelEntryFromMemory($lang, "MODEL_CORE", "QURAN_TEXT", ""); preprint_r($QURAN_TEXT[1][1]); $location = "1:1:1"; $qacMasterTableEntry = getModelEntryFromMemory("AR", "MODEL_QAC", "QAC_MASTERTABLE", $location); preprint_r($qacMasterTableEntry); $qaOntologyConceptsIterator = getAPCIterator("ALL\\/MODEL_QA_ONTOLOGY\\/CONCEPTS\\/.*"); foreach ($qaOntologyConceptsIterator as $conceptsCursor) { $conceptNameID = getEntryKeyFromAPCKey($conceptsCursor['key']); $conceptArr = $conceptsCursor['value']; $conceptLabelAR = $conceptArr['label_ar']; $conceptLabelEN = $conceptArr['label_en']; $conceptFrequency = $conceptArr['frequency']; $conceptWeight = $conceptArr['weight']; preprint_r($conceptArr); break;
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # # 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"; require_once "../libs/search.lib.php"; //only arabic is supported here, english $lang spoils the functions $lang = "AR"; loadModels("core,search,qac", $lang); $WORDS_TRANSLATIONS_EN_AR = apc_fetch("WORDS_TRANSLATIONS_EN_AR"); $WORDS_TRANSLATIONS_AR_EN = apc_fetch("WORDS_TRANSLATIONS_AR_EN"); $WORDS_TRANSLITERATION = apc_fetch("WORDS_TRANSLITERATION"); $word = $_GET['word']; $wordInfoArr = getWordInfo($word, $MODEL_CORE, $MODEL_SEARCH, $MODEL_QAC); if (empty($wordInfoArr)) { showTechnicalError("Word not found"); $suggestionsArr = getSimilarWords($lang, array($word)); if (!empty($suggestionsArr)) { $suggestionsArr = array_slice($suggestionsArr, 0, 10); echoN("<b>Do you mean</b>:<br>" . join(", ", array_keys($suggestionsArr))); } exit; } //preprint_r($wordInfoArr);
require_once "../libs/graph.lib.php"; $direction = "ltr"; $lang = $_GET['lang']; $presentation = $_GET['presentation']; if (empty($lang)) { $lang = "AR"; } if (empty($presentation)) { $presentation = "TREE"; } if ($lang == "AR") { $lang = "AR"; $direction = "rtl"; } //echoN(time()); loadModels("core,ontology", $lang); //echoN(time()); ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Full Quran Ontology Graph | Quran Analysis</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="description" content="Full Quran Ontology Visualization Graph"> <meta name="author" content=""> <script type="text/javascript" src="<?php echo $JQUERY_PATH; ?> " ></script>
# GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # # 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 "../global.settings.php"; require_once dirname(__FILE__) . "/../libs/core.lib.php"; if (isDevEnviroment()) { printHTMLPageHeader(); } $cacheInfo = apc_cache_info('user'); echoN("CACHE MEM BEFROE:" . $cacheInfo['mem_size']); apc_clear_cache(); $cacheInfo = apc_cache_info('user'); echoN("CACHE MEM AFTER CLEAR:" . $cacheInfo['mem_size']); loadModels("core,search,qac,qurana,wordnet", "EN"); $cacheInfo = apc_cache_info('user'); echoN("CACHE MEM AFTER RELOAD:" . $cacheInfo['mem_size']); preprint_r($cacheInfo); echoN("DONE"); ?>
# This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # # 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"; require_once "../libs/core.lib.php"; loadModels("core,ontology", "AR"); $LEMMA_TO_SIMPLE_WORD_MAP = loadLemmaToSimpleMappingTable(); function showExcludeFor($type, $value, $secIndex = 1, $savedValue = null) { ?> <div id='<?php echo $type . "_" . $secIndex; ?> '> <h2><?php echo $value; ?> </h2> <?php if ($type == "images") { ?>
require_once "../libs/core.lib.php"; require_once "../libs/microsoft.translator.api.lib.php"; require_once "../libs/pos.tagger.lib.php"; require_once "../libs/ontology.lib.php"; require_once "../libs/custom.translation.table.lib.php"; require_once "../libs/graph.lib.php"; require_once "../libs/owllib/OWLLib.php"; require_once "../libs/owllib/reader/OWLReader.php"; require_once "../libs/owllib/memory/OWLMemoryOntology.php"; require_once "../libs/owllib/writer/OWLWriter.php"; $ONTOLOGY_EXTRACTION_FOLDER = "../data/ontology/extraction/"; $lang = "AR"; if (isset($_GET['lang'])) { $lang = $_GET['lang']; } loadModels("core,search,qac,qurana,wordnet", $lang); //$UTHMANI_TO_SIMPLE_WORD_MAP_AND_VS = loadUthmaniToSimpleMappingTable(); //preprint_r($UTHMANI_TO_SIMPLE_WORD_MAP_AND_VS);exit; //$UTHMANI_TO_SIMPLE_LOCATION_MAP = apc_fetch("UTHMANI_TO_SIMPLE_LOCATION_MAP"); //$LEMMA_TO_SIMPLE_WORD_MAP = loadLemmaToSimpleMappingTable(); $pauseMarksArr = getPauseMarksArrByFile($pauseMarksFile); $WORDS_TRANSLATIONS_EN_AR = apc_fetch("WORDS_TRANSLATIONS_EN_AR"); $WORDS_TRANSLATIONS_AR_EN = apc_fetch("WORDS_TRANSLATIONS_AR_EN"); $WORDS_TRANSLITERATION = apc_fetch("WORDS_TRANSLITERATION"); $CUSTOM_TRANSLATION_TABLE_EN_AR = loadTranslationTable(); ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Quran Analytics | Ontology Extraction </title>