'I', 'You', 'He/she/it', 'We', 'You', 'They'); $persObj = array(1 => 'me', 'you', 'him/her/it', 'us', 'you', 'them'); $bePresent = array(1 => 'am', 'are', 'is', 'are', 'are', 'are'); $bePast = array(1 => 'was', 'were', 'was', 'were', 'were', 'were'); $words = explode(' ', $verb); // if there is a preposition after the verb $question = "Please translate to Persian: ".$persons[$person].' '; srand((float)microtime() * 1000000); switch ($qtype) { case 1: // 'I would do'/'I would not do' $question .= 'would '; if ($negative) $question .= 'not '; $question .= $words[0]; break; case 2: // 'I used to do'/'I did not use to do' if ($negative) $question .= 'did not use to '; else $question .= 'used to '; $question .= $words[0]; break; case 3: // 'I was (not) in the habit of regularly doing' $question .= $bePast[$person]." "; if ($negative) $question .= "not "; $question .= "in the habit of regularly ".verbParticipleI($words[0]); break; case 4: $question = "Change from the Present Indicative to the Imperfect: ". Conjugate($pastStem, $presStem, $presStemTrans, ($negative?17:7), $person); break; case 5: // 'I was (not) supposed to do' case 9: $question .= $bePast[$person]." "; if ($negative) $question .= "not "; $question .= "supposed to ".$words[0]; break; case 6: // 'I had (not) to do' case 10: $question .= "had "; if ($negative) $question .= "not "; $question .= "to ".$words[0]; break; case 7: // 'I should (not) have done' case 11: $question .= "should "; if ($negative) $question .= "not "; $question .= ($person==3?"has ":"have ").verbPast($words[0], true); break; case 8: // 'It was (not) necessary for me to do' case 12: $question = "Please translate to Persian: It was "; if ($negative) $question .= "not "; $question .= "necessary for ".$persObj[$person]." to ".$words[0]; break; // case 4: // 'I am (not) used to doing' // $question .= $bePresent[$person]." "; // if ($negative) $question .= "not "; // $question .= "used to ".verbParticipleI($words[0]); // break; default: break; } if ($qtype!=4) for ($i=1; $i Imperfect Test \n

Tenses

\n"; print "

You have answered all questions correctly. Try to conjugate another verb.\n"; exit("

Back to the Persian Tests"); } print "\n"; } else { print "\n"; } ?>

Tenses

"> ".GetQuestion($persons[$i-1], $neg[$i-1], $verbs[$i-1][3], $qtype[$i-1]); print ""; print ""; print "
".Answer($i, 0)."
".Answer($i, 1)."
".Answer($i, 2)."
"; } print "

"; function Answer($q, $a) { global $pastStem, $presStem, $presStemTrans, $wronganswertype, $questions, $persons, $neg, $isPersScript, $qtype; switch ($wronganswertype[$q-1][$a]) { case 0: $t = ($neg[$q-1]) ? 13 : 2; if ($qtype[$q-1]>4) { if ($qtype[$q-1]<9) $ret = ($isPersScript) ? "باید " : "bāyad "; else $ret = ($isPersScript) ? "بایستی " : "bāyesti "; if ($neg[$q-1]) { // e.g. nabaayad/nabaayesti mikardam = I was not supposed to go $ret = ($isPersScript ? "ن" : "na").$ret; } return $ret . Conjugate($pastStem, $presStem, $presStemTrans, 2, $questions[$q-1][$a]); } return Conjugate($pastStem, $presStem, $presStemTrans, $t, $questions[$q-1][$a]); break; case 1: $t = $questions[$q-1][$a]; if ($neg[$q-1]==0) { $t = ($t==12) ? 1 : 6; } return Conjugate($pastStem, $presStem, $presStemTrans, $t, $persons[$q-1]); break; case 2: $t = ($neg[$q-1]) ? 13 : 2; return Conjugate($pastStem, $presStem, $presStemTrans, $t, $questions[$q-1][$a]); break; case 3: $s = Conjugate($pastStem, $presStem, $presStemTrans, 13, $persons[$q-1]); if (strpos($s, ' ')) { $s = explode(' ', $s); $s = $s[0].' '.substr($s[1], 0, 2).($isPersScript?'ه ':' ').substr($s[1], 2); } else { $s = substr($s, 0, 2).($isPersScript?'ه ':' ').substr($s, 2); } return $s; break; case 4: $t = ($neg[$q-1]==1) ? 13 : 2; $s = explode('|', $questions[$q-1][$a]); return Conjugate(substr($s[0], 0, strlen($s[0])-2), $s[1], $s[2], $t, $persons[$q-1]); break; default: break; } } ?>


Persian Verb Conjugator

Back to the Persian Tests