"; $isSpoken = isset($_GET['spoken']); $isPersScript = false; $isLowerRegister = 0; $pastStem = ""; $params = array(); if (!empty($_GET["verb"])) { $pastStem = str_replace("aa", "ā", $_GET['verb']); // $params[] = "verb=$pastStem"; } $verb_id = -1; if (!empty($_GET['id'])) { $verb_id = intval($_GET['id']); // $params[] = "id=$verb_id"; } $main_verb_id = $verb_id; $forceSnd = isset($_GET['snd']); if ($forceSnd) { if ($_GET['snd']==='0') { $forceSnd = 0; } } if (isset($_GET['opt']) && $_GET['opt']=='list') { $params[] = "opt=list"; } $snt_id = -1; if (isset($_GET['snt'])) { $snt_id = intval($_GET['snt']); } include "vars.php"; include "conjugate.php"; $link = mysql_connect("localhost", $login, $pass) or die("Could not connect: " . mysql_error()); mysql_select_db($db) or die("Could not select database"); mysql_query("SET NAMES utf8;"); $alphabet = 'ابپتثجچحخدذرزسشصضطظعغفقكگلمنوهيَُِآةکیءىۀئؤًّ،؛؟٪‍‌'; if (!empty($pastStem)) { $script = 'trans'; for ($i=0; $i<=strlen($alphabet)/2; $i++) { if (strpos($pastStem, substr($alphabet,$i,2))) { $isPersScript = true; $script = 'pers'; break; } } } $UpperLinks = ""; $CurLink = ""; $LowerLinks = ""; $infCompound = ""; $styleVerbs = array(); if ($verb_id!=-1) $r = mysql_query("SELECT * FROM $table WHERE id=$verb_id;"); else $r = mysql_query("SELECT * FROM $table WHERE ".$script."_inf='".addslashes($pastStem)."' AND style=".($isSpoken?1:0).";"); if ($r) { if (mysql_num_rows($r)==0) { $i = strrpos($pastStem, " "); if ($i!==false) { $infCompound = substr($pastStem, 0, $i+1); $pastStem = substr($pastStem, $i+1); $r = mysql_query("SELECT * FROM $table WHERE ".$script."_inf='".addslashes($pastStem)."' AND style=".($isSpoken?1:0).";"); } } if (mysql_num_rows($r)==1) { if ($line = mysql_fetch_assoc($r)) { if (empty($infCompound)) { $main_verb_id = $line['id']; } else { $main_verb_id = -1; } if ($line['style']==0) { if ($r = mysql_query("SELECT * FROM $table WHERE style_id=$line[id]")) { if (mysql_num_rows($r)>0) { $isSpoken = false; } } // spoken } elseif ($line['style_id']!=-1) { if ($r = mysql_query("SELECT * FROM $table WHERE id=$line[style_id]")) { if (mysql_num_rows($r)==1) { $isSpoken = true; // if the verb is in the lexicon (not calculated as compound from existed simple verb) if (empty($infCompound)) { $styleVerbs[] = array($verb_id, urlencode($line[$script.'_inf']), $line['style']); // search for upper style verbs for ($i=0; $i<10; $i++) { $break = true; if ($style_verb = mysql_fetch_array($r)) { array_unshift($styleVerbs, array($style_verb['id'], urlencode($style_verb[$script.'_inf']), $style_verb['style'])); if ($style_verb['style_id']!=-1) { if ($r = mysql_query("SELECT * FROM $table WHERE id=$style_verb[style_id]")) { if (mysql_num_rows($r)==1) { $break = false; } } } } if ($break) break; } // search for lower style verbs $style_verb = $line; for ($i=0; $i<10; $i++) { $break = true; if ($r = mysql_query("SELECT * FROM $table WHERE style_id=$style_verb[id]")) { if (mysql_num_rows($r)==1) { if ($style_verb = mysql_fetch_array($r)) { $styleVerbs[] = array($style_verb['id'], urlencode($style_verb[$script.'_inf']), $style_verb['style']); $break = false; } } } if ($break) break; } // search for Default Spoken verb $defSpoken = 0; for ($i=count($styleVerbs)-1; $i>=0; $i--) { if ($styleVerbs[$i][2]==2) { $defSpoken = $i-1; } } for ($i=0; $i3+$defSpoken) { $LinkTitle .= " ".($i-1-$defSpoken); } } if ($styleVerbs[$i][0]==$verb_id) { $styleVerbs[$i] = $LinkTitle; if ($i>1) $isLowerRegister = $i-1; // if ($i>1+$defSpoken) $isLowerRegister = $i-1-$defSpoken; // print ""; } else { $styleVerbs[$i] = "$LinkTitle"; } } $styleVerbs = array_reverse($styleVerbs); // if ($written = mysql_fetch_array($r)) { // $params[] = "id=".$written['id']; // $params[] = "verb=".urlencode($written[$script.'_inf']); // // // Lower Register // if ($written['style']==1) { // $params[] = "spoken"; // $isLowerRegister = true; // $LowerRegisterLink = "Lower Register >> "; // // if ($r = mysql_query("SELECT * FROM $table WHERE id=$written[style_id]")) { // if (mysql_num_rows($r)==1) { // if ($written = mysql_fetch_array($r)) { // $WrittenLink = " >> Written Style"; // } // } // } // } else { // $SpokenLink = "Default Spoken Style >> "; // // if ($r = mysql_query("SELECT * FROM $table WHERE style_id=$line[id]")) { // if (mysql_num_rows($r)==1) { // if ($lower = mysql_fetch_array($r)) { // $LowerRegisterLink = "Lower Register >> "; // } // } // } // } // } } else { $main_verb_id = -1; } } } } } } } // Recover the compound verb $pastStem = $infCompound.$pastStem; $title = "Persian Verb Conjugator"; if ($isLowerRegister) $title .= " (Lower Register)"; elseif ($isSpoken) $title .= " (Spoken Style)"; if ($isSpoken) { if (!isset($_SESSION['spsound'])) $_SESSION['spsound'] = $forceSnd; if (!isset($_GET['snd'])) $forceSnd = $_SESSION['spsound']; else $_SESSION['spsound'] = $forceSnd; } else { if (!isset($_SESSION['wrsound'])) $_SESSION['wrsound'] = $forceSnd; if (!isset($_GET['snd'])) $forceSnd = $_SESSION['wrsound']; else $_SESSION['wrsound'] = $forceSnd; } //======================================================== // HTML Page Beginning ?> .css"> 0) print "

You can enter a Persian verb in transcription

Infinitive: onkeypress="PersianKeyPress(event)" onkeyup="ShiftKeyUp(event);" onkeydown="ShiftKeyDown(event);PersianKeyDown(event)"> Note: aa=ā

Keyboard layout, unshifted  

normal keys
Depress the Shift button to see the shift keys while cursor is in text area.


Copyright (c) 2006-2010 Artyom Lukanin
The online version was inspired by Ali Jahanshiri\'s original downloadable PVC for Windows which is now also available as an online version.Control Panel

Redirected from Persian in Texas

'; //======================================================== // List of verbs in the lexicon if (isset($_GET['opt']) && $_GET['opt']=='list') { print "

Type a verb and press Enter to see its conjugation.

"; print "

See the list of verbs with translations: Simple Verbs, Compound Verbs.

"; exit($footer); $r = mysql_query("SELECT * FROM $table WHERE isnew<>1 AND style=".($isSpoken?1:0)." ORDER BY trans_inf;"); if (!$r) { exit("

The list of verbs does not exist.

\n"); } ?> "; } print "
Persian Transcription
{$verb['pers_inf']}{$verb['trans_inf']}

See also Boyle's Patterns

"; exit($footer); } $noBeInSubjunctive = 0; $hasSound = 0; $hasSimpleSound = 0; $hasTestSound = 0; $disabled_forms = ''; if (!empty($pastStem)) { print "

See the list of verbs with translations: Simple Verbs, Compound Verbs.

"; // if ($isPersScript) print '

This is the Persian script'; if ($verb_id!=-1) $r = mysql_query("SELECT * FROM $table WHERE id=$verb_id;"); else $r = mysql_query("SELECT * FROM $table WHERE ".$script."_inf='".addslashes($pastStem)."' AND style=".($isSpoken?1:0).";"); $infCompound = ""; if ($r) { $i = strrpos($pastStem, " "); if ($i!==false) { $infCompound = substr($pastStem, 0, $i+1); $pastStem = substr($pastStem, $i+1); } if (mysql_num_rows($r)==0) { if ($i!==false) { $r = mysql_query("SELECT * FROM $table WHERE ".$script."_inf='".addslashes($pastStem)."' AND style=".($isSpoken?1:0).";"); } } if (mysql_num_rows($r)>1) { print "There can be several present stems for this infinitive. Choose one: "; $line = mysql_fetch_assoc($r); print " ".$infCompound.$line[$script.'_presstem'].""; while ($line = mysql_fetch_assoc($r)) { if ($isPersScript) print "،"; else print ","; print " ".$infCompound.$line[$script.'_presstem'].""; } exit($footer); } elseif (mysql_num_rows($r)==1) { if ($line = mysql_fetch_array($r)) { // print ""; $hasSound = $line['hassnd']; $hasSimpleSound = $hasSound; $hasTestSound = $line['hassndtest']; // if ($forceSnd) $hasSound = 1; if (empty($infCompound) || "$infCompound$pastStem"==$line[$script.'_inf']) { $translation = $line['translation']; $tags = $line['tags']; $presStem = $line[$script.'_presstem']; } else { $presStem = $infCompound.$line[$script.'_presstem']; $hasSound = 0; } $presStemTrans = $line['trans_presstem']; if ($line['isnew']==1) print "

WARNING: this verb is not reviewed yet by the administrator.

"; $noBeInSubjunctive = $line['nobeinsubj']; $disabled_forms = $line['disabled_forms']; if ($line['comp_id']!==-1) { $rspl = mysql_query("SELECT * FROM $table WHERE id=$line[comp_id]"); if ($simpleVerb = mysql_fetch_assoc($rspl)) { $hasSimpleSound = $simpleVerb['hassnd']; $hasTestSound = $simpleVerb['hassndtest']; } } // if ($line['style_id']!=-1) { // if ($ros = mysql_query("SELECT * FROM $table WHERE id=$style_id")) { // if ($written = mysql_fetch_assoc($ros)) { // $writtenPresStem = $written[$script.'_presstem']; // } // } // } } } mysql_free_result($r); // mysql_close($link); } $pastStem = $infCompound.$pastStem; $disabled_forms = GetDisabledForms($disabled_forms); //======================================================== // Present Stem derivation rules $pstLen = strlen($pastStem); if (empty($presStem)) { print '

This verb is not in our database, so it can be conjugated incorrectly'; if (!$isPersScript) print ' if you have transcribed it incorrectly'; //print '.
Please, add this verb to our database for review.

'; if ($isPersScript) { switch (substr($pastStem, $pstLen-6, 2)) { case 'ی': // yeh -idan $presStem = substr($pastStem, 0, $pstLen-6); break; case 'و': // vav -udan $presStem = substr($pastStem, 0, $pstLen-6).'ا'; break; case 'ن': // nu:n -ndan case 'ر': // re -rdan $presStem = substr($pastStem, 0, $pstLen-4); break; case 'خ': // -khtan $presStem = substr($pastStem, 0, $pstLen-6).'ز'; break; case 'ش': // -shtan $presStem = substr($pastStem, 0, $pstLen-6).'ر'; break; case 'س': if ($pstLen==8 || substr($pastStem, $pstLen-8, 2)=='ا') { // -stan $presStem = substr($pastStem, 0, $pstLen-6).'ه'; } else { // -estan $presStem = substr($pastStem, 0, $pstLen-6); } break; case 'ف': // -ftan $presStem = substr($pastStem, 0, $pstLen-6).'ب'; break; default: $presStem = substr($pastStem, 0, $pstLen-6).'ن'; } } else { switch (substr($pastStem, $pstLen-4, 1)) { case 'i': // -idan $presStem = substr($pastStem, 0, $pstLen-4); break; case 'u': // -udan $presStem = substr($pastStem, 0, $pstLen-4).'ā'; break; case 'n': // -ndan case 'r': // -rdan $presStem = substr($pastStem, 0, $pstLen-3); break; case 'a': // -adan $presStem = substr($pastStem, 0, $pstLen-3).'n'; break; case 'h': if (substr($pastStem, $pstLen-5, 1)=='k') { // -khtan $presStem = substr($pastStem, 0, $pstLen-5).'z'; } else { // -shtan $presStem = substr($pastStem, 0, $pstLen-5).'r'; } break; case 's': if (substr($pastStem, $pstLen-5, 1)=='e') { // -estan $presStem = substr($pastStem, 0, $pstLen-5); } else { // -stan $presStem = substr($pastStem, 0, $pstLen-4).'h'; } break; case 'f': // -ftan $presStem = substr($pastStem, 0, $pstLen-4).'b'; break; default: if (substr($pastStem, $pstLen-5, 2)=='ā') // -aadan $presStem = substr($pastStem, 0, $pstLen-5); } } } //======================================================== // For compound verbs $compound = ""; $i = strrpos($pastStem, " "); if ($i!==false) { $compound = substr($pastStem, 0, $i+1); $pastStem = substr($pastStem, $i+1); $presStem = substr($presStem, $i+1); $pstLen = strlen($pastStem); } $synonyms = ""; if (isset($line['id']) && $compound.$pastStem==$line[$script.'_inf']) { $verb_id = $line['id']; $r = mysql_query("SELECT * FROM PVCSynonyms WHERE verb1=$verb_id OR verb2=$verb_id"); $synonyms = array(); while ($row = mysql_fetch_array($r)) { if ($row[0]==$verb_id) { $synonyms[] = $row[1]; } else { $synonyms[] = $row[0]; } } $synonyms = implode(",", $synonyms); } $rsnt = mysql_query("SELECT s.* FROM pvc_sentence s INNER JOIN pvc_verb_sentence ON (snt_id=vs_sid AND vs_vid=$main_verb_id) WHERE snt_new=0"); $snt_count = mysql_num_rows($rsnt); if ($snt_count>0) { ?>

 

Synonyms'; $cols++; } ?> "; } if ($snt_count>0) { print ""; } ?>
Past Stem Present Stem English Translation
2) { // $presStem = substr($presStem, 0, strlen($presStem)-2); // } // // aamad => umad // if (substr($pastStem, 0, 2)=="آ") { // alef with madda // $pastStem = "او".substr($pastStem, 2); // alef+vav // } // // } // } // } print $compound.$pastStem; $AddStems = array(); switch ($pastStem) { case 'bud': $AddStems[7] = array($compound.'hast'); break; case 'بود': $AddStems[7] = array($compound.'هست'); break; } if ($isSpoken) { switch ($pastStem) { case 'gozāsht': // for ($i=1; $i<=20; $i++) { // if (in_array($i, array(7, 8, 17, 18, 20))) { // Present Stem Tenses // $AddStems[$i] = array('zār'); // } elseif (in_array($i, array(2, 4, 12, 13, 14, 15, 16))) { // Past Stem Tenses // $AddStems[$i] = array('zāsht'); // } // } print ", zāsht"; break; case 'گذاشت': print "، ذاشت"; break; } } else { switch ($pastStem) { case 'bāyest': $AddStems[7] = array($compound.'bāy'); $AddStems[17] = array($compound.'bāy'); break; case 'بایست': $AddStems[7] = array($compound.'بای'); $AddStems[17] = array($compound.'بای'); break; } } ?> 0) { $trans_ar[$i-1] .= ';'; } for ($k=0; $k"; if (!empty($synonyms)) { print ''; $r = mysql_query("SELECT * FROM PVCExceptions WHERE id IN ($synonyms) ORDER BY trans_inf"); $i = 0; while ($row = mysql_fetch_assoc($r)) { if ($i>0) print ($script=='pers' ? "، " : ", "); print "".$row[$script.'_inf'].""; $i++; } print "

"; if ($snt_id==-1) { $verbparams = $_SERVER['QUERY_STRING']; print "$snt_count example".($snt_count==1?"":"s")." of usage"; } else { include("pvcsent.php"); } print "

Click here to add a sample of usage!'; $verbparams = $_SERVER['QUERY_STRING']; if (isset($_GET['snd'])) { $verbparams = explode('&', $verbparams); for ($i=0; $iEnable audio, slower page load"; else print " | Disable audio, faster page load"; } elseif ($hasTestSound) { if ($forceSnd) print " | Disable audio, faster page load"; else print " | Enable audio, slower page load"; } } ?> 1'; $rem1 = '1 The imperfect forms with mi- may be heard, or read, occasionally when used for irreal/unlikely/hypothetical conditions; but they are not standard Persian, and should be avoided.

'; $remHast = ' 2'; $rem2 = '2 3rd person singular "hast" is not generally used except for emphasis or euphonics when the meaning is "is". Use it when the meaning is "exists".

'; } } else { // Exceptions if ($pastStem=='bud') { $remImp = ' 1'; $rem1 = '1 The imperfect forms with mi- may be heard, or read, occasionally when used for irreal/unlikely/hypothetical conditions; but they are not standard Persian, and should be avoided.

'; $remHast = ' 2'; $rem2 = '2 3rd person singular "hast" is not generally used except for emphasis or euphonics when the meaning is "is". Use it when the meaning is "exists".

'; } } $pastStem = $compound.$pastStem; $presStem = $compound.$presStem; ?>

Positive Forms

>
  Simple Past Imperfect Perfect Subjunctive Past Progressive