} if (isArabicString($text)) { $translation = arabicToBuckwalter($text); ?> <div class='buckwalter-trans-result-header'>Buckwalter Transliteration: <b><?php echo $translation; ?> </b> </div> <?php } else { try { $arabicTranslation = buckwalterReverseTransliteration($text); ?> <div class='buckwalter-trans-result-header'>Arabic Presentation: <b><?php echo $arabicTranslation; ?> </b> </div> <?php } catch (Exception $e) { showTechnicalError("Invalid Buckwalter segment [{$text}] !"); exit; } } ?>
# 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); /* echoN("Buckwalter Transliteration:".$buckwalterTransliteration); echoN("Translation:".""); echoN("English Translation:".""); echoN("Word Root:".$wordRoot); echoN("PoS Tags:".join(",", array_keys($posTagsArr)));
require "./analysis.template.start.code.php"; ?> <div id='main-container'> <?php include_once "help-content.php"; ?> <?php $QURAN_TEXT = getModelEntryFromMemory("AR_UTH", "MODEL_CORE", "QURAN_TEXT", ""); if ($lang == "EN") { showTechnicalError("Only Arabic is supported here, you chose English !"); } $initialsVersesWordsArr = array(); $qacPosEntryArr = getModelEntryFromMemory("AR", "MODEL_QAC", "QAC_POS", "INL"); foreach ($qacPosEntryArr as $location => $segmentId) { $qacMasterTableEntry = getModelEntryFromMemory("AR", "MODEL_QAC", "QAC_MASTERTABLE", $location); // get Word, Lema and root $segmentWord = $qacMasterTableEntry[$segmentId - 1]['FORM_AR']; $segmentWordLema = $qacMasterTableEntry[$segmentId - 1]['FEATURES']['LEM']; $segmentWordRoot = $qacMasterTableEntry[$segmentId - 1]['FEATURES']['ROOT']; $verseLocation = substr($location, 0, strlen($location) - 2); //$segmentWord = removeTashkeel($segmentWord); // get word index in verse $wordIndex = getWordIndexFromQACLocation($location); // get simple version of the word index $imla2yWordIndex = getImla2yWordIndexByUthmaniLocation($location);
echoN("SS Tags:".count($ssPoSAggregation)); echoN("Top Tags:".count($topPoSAggregation)); //preprint_r($ssPoSAggregation); foreach($ssPoSAggregation as $pattern=>$freq) { echoN($pattern."|".$freq."|".$ssPoSAggregationCorrespondingSent[$pattern]); } preprint_r($topPoSAggregation); */ if (count($contextArr[$targetPOSorWord]["+1"]) == 0) { showTechnicalError("No data found, make sure the word is found in the Quran"); showTechnicalError("Use proper Simple or Uthmani word "); showTechnicalError("Use Word information tool to convert words or its validity "); exit; } ?> <table id='words-pos-context-table' <?php if ($targetType == "WORD") { echo "style='direction:rtl'"; } ?> > <thead> <tr> <th colspan='<?php echo $contextMaxLevel * 2 + 1; ?>
# 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); $cloudToShow = $_GET['cloudToShow']; if ($cloudToShow != "0" && empty($cloudToShow)) { showTechnicalError("Invalid Cloud Type [{$cloudToShow}]"); exit; } $RESOURCES = getModelEntryFromMemory($lang, "MODEL_CORE", "RESOURCES", ""); $META_DATA = getModelEntryFromMemory($lang, "MODEL_CORE", "META_DATA", ""); $WORDS_FREQUENCY = getModelEntryFromMemory($lang, "MODEL_CORE", "WORDS_FREQUENCY", ""); ?> <?php if ($cloudToShow == "VB") { ?> <fieldset class="word-cloud-fs">