$vaypatuSel = True; } else { $vaypatuSel = $_POST['vaypatuSel'] == $vaypatu; } if ($todaiSel && $letterCountSel && $matraCountSel && $vaypatuSel) { $matchList[] = $word; } } $matchListTalai = []; $bonds = ""; # Check for Linkage if ($_POST['talaiSel'] == "all") { $matchListTalai = $matchList; } else { foreach ($matchList as $word) { @($ptree = new ProsodyParseTree(lat2tam($source) . " " . $word, "", "")); $bond = trim($ptree->WordBond[0]['bond']); $talaiSel = strpos($bond, $_POST['talaiSel']) !== False; # $bonds .= $bond." "; if ($talaiSel) { $matchListTalai[] = $word; } } } echo "பொருத்தமான சொற்கள் : " . count($matchListTalai) . "<br/><br/>"; echo "<div class=\"result\">"; #echo $bonds."<br/><br/>"; foreach ($matchListTalai as $word) { echo "<span class=\"resultWord\">" . $word . " |</span>"; } echo "</div>";
<!-- <strong> <span class="ner-asai">நேரசை</span> </strong><?php echo $ptree->ner; ?> <strong><span class="nirai-asai">நிரையசை</span> </strong><?php echo $ptree->nirai; ?> </p> --> <?php if ($ptree->MetreType != NULL) { echo "<span class=\"uiTrant\">" . lancon(lat2tam($ptree->MetreType), $lang) . "</span>"; } else { // Translate below echo "<span class=\"uiTrant\">" . lancon(lat2tam("_e_nta pA vakYyu_m poru_ntavi_llY"), $lang) . "</span>"; } // Translate // this ?> <!-- <span style="float: left; padding-right:1em"><a href="/save" target="_blank"><span class="uiTran"><?php echo lanconTrnL("சேமி", $_SESSION['lang']); ?> </span></a></span> --> <span style="float: right;margin-left:15px;"><a href="/xml" target="_blank"><span class="uiTran"><?php echo lanconTrnL("XML வடிவில் காண", $_SESSION['lang']); ?>
public function DisplayTodaiElements($TodaiArray, $Lines, $TodaiType, $TodaiClass) { $TodadiPatternName = array("12" => "_iNY", "13" => "poZi_ppu", "14" => "_orU_u", "123" => "kUZY", "134" => "mE_RkatuvA_y", "124" => "kI_Z_kkatuvA_y", "1234" => "mu_RRu"); $TodaiExists = FALSE; $Ornament = array(); for ($LineIndex = 0; $LineIndex < count($TodaiArray); $LineIndex++) { if ($TodaiClass == "Line") { echo "<em><span class=\"uiTran\">" . lanconTrnL("அடி", $this->Lang) . "</span> </em>" . ($LineIndex + 1) . " | "; echo "<span class=\"todailine uiTrant\">"; echo lancon(lat2tam($Lines[$LineIndex]), $this->Lang); echo "</span>" . "<br/><br/>"; } $TodaiLine = $TodaiArray[$LineIndex]; $LineWordCount = count(explode(" ", trim($Lines[$LineIndex]))); foreach ($TodaiLine as $TodaiSeer) { if (count($TodaiSeer) > 1) { $TodaiExists = true; for ($TodaiIndex = 0; $TodaiIndex < count($TodaiSeer); $TodaiIndex++) { foreach ($TodaiSeer[$TodaiIndex] as $Index => $Word) { } echo "<span class=\"todaiindex\">"; echo $Index + 1 . " "; echo "</span>"; $TodaiPattern = $TodaiPattern . ($Index + 1); if ($TodaiType == "mOVY") { $Ornament[$LineIndex][0][$Index] = lancon(lat2tam($Word), $this->Lang); echo "<span class=\"todaiword uiTrant\">"; echo lancon(lat2tam(substr($Word, 0, 2)), $this->Lang); echo "</span>"; echo "<span class=\"uiTrant\">" . lancon(lat2tam(substr($Word, 2)), $this->Lang) . "</span>" . " "; } if ($TodaiType == "_etukY") { $Ornament[$LineIndex][0][$Index] = lancon(lat2tam($Word), $this->Lang); echo "<span class=\"uiTrant\">" . lancon(lat2tam(substr($Word, 0, 2)), $this->Lang) . "</span>"; echo "<span class=\"todaiword uiTrant\">"; echo lancon(lat2tam(substr($Word, 2, 2)), $this->Lang); echo "</span>"; echo "<span class=\"uiTrant\">" . lancon(lat2tam(substr($Word, 4)), $this->Lang) . "</span>" . " "; } if ($TodaiType == "_iyYpu") { $Ornament[$LineIndex][0][$Index] = lancon(lat2tam($Word), $this->Lang); $Word = trim($Word); echo "<span class=\"uiTrant\">" . lancon(lat2tam(substr($Word, 0, -2)), $this->Lang) . "</span>"; echo "<span class=\"todaiword uiTrant\">"; echo lancon(lat2tam(substr($Word, -2)), $this->Lang); echo "</span>" . " "; } } echo "<span class=\"todaipattern uiTrant\">"; if ($TodadiPatternName[$TodaiPattern] != "" && $TodaiClass == "Line" && $LineWordCount == 4) { echo " | " . lancon(lat2tam($TodadiPatternName[$TodaiPattern] . " " . $TodaiType), $this->Lang); $Ornament[$LineIndex][1] = lancon(lat2tam($TodadiPatternName[$TodaiPattern] . " " . $TodaiType), $this->Lang); } echo "</span>"; echo "<br/>"; $TodaiPattern = ""; } } if (!$TodaiExists) { echo "<span class=\"uiTran\">" . lanconTrnL(lat2tam($TodaiType), $this->Lang) . "</span> " . "<span class=\"uiTran\">" . lanconTrnL("இல்லை", $this->Lang) . "</span></br/>"; } $TodaiExists = FALSE; echo "<br/>"; } return $Ornament; }
if (isset($xml->Ornamentation->Rhyme)) { $type = $xml->Ornamentation->Rhyme['type']; echo lancon(lat2tam('_aTi _etukY'), $lang); echo " : "; if (isset($xml->Ornamentation->Rhyme)) { foreach ($xml->Ornamentation->Rhyme->Match as $match) { echo $match['line'] . " " . $match . " "; } } } echo "\n"; } echo "\n"; } if (isset($options['talai']) || !$showPartial) { echo lancon(lat2tam('taLY'), $lang) . "\n\n"; $footL = array(); foreach ($xml->MetricalLine as $line) { foreach ($line->MetricalFoot as $foot) { $footL[] = $foot; } } for ($i = 0; $i < count($footL) - 1; $i++) { foreach ($footL[$i]->Metreme as $metreme) { echo $metreme; } echo " → "; foreach ($footL[$i + 1]->Metreme as $metreme) { echo $metreme; } echo " : " . $footL[$i + 1]["linkage"] . "\n";
<option value="other">பிற மாத்திரை அளவு</option> </select> <input type="text" id="matraCountSelN" size="2" value="2" style="display:none;"></input> </span> <br/><br/> <big>வாய்ப்பாடு</big> <select id="vaypatuSel"> <option value="all">அனைத்தும்</option> <?php $ptree = new ProsodyParseTree("na na", "", ""); foreach ($ptree->WordType as $key => $value) { echo "<option value=\"" . lat2tam($value) . "\">" . lat2tam($value) . "</option>"; } ?> </select> <big>தளை</big> <select id="talaiSel"> <option value="all">அனைத்தும்</option> <option value="ேரொன்றிய ஆசிரியத்தள">நேரொன்றிய ஆசிரியத்தளை</option> <option value="நிரையொன்றிய ஆசிரியத்தளை">நிரையொன்றிய ஆசிரியத்தளை</option> <option value="ஆசிரியத்தளை">எல்லா ஆசிரியத்தளைகளும்</option> <option value="இயற்சீர் வெண்டளை">இயற்சீர் வெண்டளை</option> <option value="இயற்சீர் வெண்டளை">வெண்சீர் வெண்டளை</option> <option value="ெண்டளை">எல்லா வெண்டளைகளும்</option> <option value="ஒன்றிய வஞ்சித்தளை">ஒன்றிய வஞ்சித்தளை</option>
Copyright (C) 2013 Vinodh Rajan vinodh@virtualvinodh.com This file is a part of Avalokitam. Avalokitam is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. 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 Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ if (isset($_REQUEST['txt'])) { if ($_REQUEST['lang'] == "en") { echo tam2iso(lat2tam($_REQUEST['txt'])); } else { $txt = str_replace(" ", "+", $_REQUEST['txt']); $txt = str_replace("\n", "", $txt); echo file_get_contents('http://aksharamukha.appspot.com/json?txt=' . $txt . '&source=ISO&target=Tamil&preserve=1'); } } function tam2lat($text) { $tameng = array('அ' => '_a', 'ஆ' => '_A', 'இ' => '_i', 'ஈ' => '_I', 'உ' => '_u', 'ஊ' => '_U', 'எ' => '_e', 'ஏ' => '_E', 'ஐ' => '_Y', 'ஒ' => '_o', 'ஓ' => '_O', 'ஔ' => '_W', 'க' => 'k', 'ங' => 'G', 'ச' => 'c', 'ஜ' => 'j', 'ஞ' => 'J', 'ட' => 'T', 'ண' => 'N', 'த' => 't', 'ந' => 'n', 'ன' => 'V', 'ப' => 'p', 'ம' => 'm', 'ய' => 'y', 'ர' => 'r', 'ற' => 'R', 'ல' => 'l', 'ள' => 'L', 'ழ' => 'Z', 'வ' => 'v', 'ஶ' => 'F', 'ஷ' => 'S', 'ஸ' => 's', 'ஹ' => 'h', 'ா' => 'A', 'ி' => 'i', 'ீ' => 'I', 'ு' => 'u', 'ூ' => 'U', 'ெ' => 'e', 'ே' => 'E', 'ை' => 'Y', 'ொ' => 'o', 'ோ' => 'O', 'ௌ' => 'W', '்' => 'X', 'ஃ' => '_K'); foreach ($tameng as $key => $value) { $text = str_replace($key, $value, $text); } $text = preg_replace('/([kGcJTNtnpmyrlvZLRVjSsh])X/', '_$1', $text); $text = preg_replace('/(?<!_)([kGcJTNtnpmyrlvZLRVjSsh])(?![aAiIuUeEoOYW])/', '$1a', $text); $text = preg_replace('/(_[kGcJTNtnpmyrlvZLRVjSsh])(_[aAiIuUeEoOYW])/', '$1_$2', $text);