chinese-journal/yii/protected/views/site/_dictionaryResultView.php

75 lines
1.3 KiB
PHP

<?php
/* @var $this SiteController */
$this->pageTitle=Yii::t('app', Yii::app()->name);
?>
<hr>
<p>
<?=str_replace('{nounNominative}', $data["nominativeSingularForm"], Yii::t('dict', 'Most likely, original word is <b>{nounNominative}</b>'))?>
</p>
<p>
<?php
$animateSuffix = "";
if ($data["animated"] === "true")
{
$animateSuffix = "ANIMATE";
}
else
{
$animateSuffix = "INANIMATE";
}
$genderSuffix = "";
if ($data["animated"] !== "true" && $data["count"] === "NC_SINGULAR")
{
if ($data["gender"] === "0")
{
$genderSuffix = "_MALE";
}
else if ($data["gender"] === "1")
{
$genderSuffix = "_FEMALE";
}
else
{
$genderSuffix = "_NEUTER";
}
}
if ($data["grammaticalCase"] === "NGC_P4_ACCUSATIVE")
{
$combinedStr = $data["grammaticalCase"] . "_" . $data["count"] . "_" . $animateSuffix . $genderSuffix;
echo str_replace('{noun}', $request, Yii::t('dict', $combinedStr)) . "<BR>";
}
else if ($data["grammaticalCase"] === "NGC_P1_NOMINATIVE")
{
$combinedStr = $data["grammaticalCase"] . "_" . $data["count"] . $genderSuffix;
echo str_replace('{noun}', $request, Yii::t('dict', $combinedStr)) . "<BR>";
}
else
{
$combinedStr = $data["grammaticalCase"] . "_" . $data["count"];
echo str_replace('{noun}', $request, Yii::t('dict', $combinedStr)) . "<BR>";
}
echo Yii::t('dict', $animateSuffix) . "<BR>";
?>
</p>