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

152 lines
3.0 KiB
PHP
Raw Normal View History

2014-11-26 20:18:59 +00:00
<?php
/* @var $this SiteController */
$this->pageTitle=Yii::t('app', Yii::app()->name);
?>
<hr>
<p>
2014-12-09 12:30:16 +00:00
<?php
$wordType = $data["word"];
$nounData = null;
$adjectiveData = null;
if ($wordType === "noun")
{
$nounData = $data["noun"];
echo str_replace('{nominative}', $nounData["nominativeSingularForm"], Yii::t('dict', 'Most likely, original word is <b>{nominative}</b><BR>'));
echo Yii::t('dict', "This is noun") . "<BR>";
}
if ($wordType === "adjective")
{
$adjectiveData = $data["adjective"];
echo str_replace('{nominative}', $adjectiveData["nominativeSingularForm"], Yii::t('dict', 'Most likely, original word is <b>{nominative}</b><BR>'));
echo Yii::t('dict', "This is adjective") . "<BR>";
}
?>
2014-11-26 20:18:59 +00:00
</p>
<p>
2014-12-01 07:22:08 +00:00
<?php
2014-11-26 20:18:59 +00:00
2014-12-09 12:30:16 +00:00
if ($wordType === "noun")
{
2014-12-01 07:22:08 +00:00
$animateSuffix = "";
2014-12-09 12:30:16 +00:00
if ($nounData["animated"] === "true")
2014-12-01 07:22:08 +00:00
{
$animateSuffix = "ANIMATE";
}
else
{
$animateSuffix = "INANIMATE";
}
$genderSuffix = "";
2014-12-09 12:30:16 +00:00
if ($nounData["count"] === "NC_SINGULAR")
2014-12-01 07:22:08 +00:00
{
2014-12-09 12:30:16 +00:00
if ($nounData["gender"] === "0")
2014-12-01 07:22:08 +00:00
{
$genderSuffix = "_MALE";
}
2014-12-09 12:30:16 +00:00
else if ($nounData["gender"] === "1")
2014-12-01 07:22:08 +00:00
{
$genderSuffix = "_FEMALE";
}
else
{
$genderSuffix = "_NEUTER";
}
}
2014-12-09 12:30:16 +00:00
if ($nounData["grammaticalCase"] === "NGC_P4_ACCUSATIVE")
{
$combinedStr = $nounData["grammaticalCase"] . "_" . $nounData["count"] . "_" . $animateSuffix . $genderSuffix;
echo str_replace('{noun}', $request, Yii::t('dict', $combinedStr)) . "<BR>";
}
else if ($nounData["grammaticalCase"] === "NGC_P1_NOMINATIVE")
{
$combinedStr = $nounData["grammaticalCase"] . "_" . $nounData["count"] . $genderSuffix;
echo str_replace('{noun}', $request, Yii::t('dict', $combinedStr)) . "<BR>";
}
else
{
$combinedStr = $nounData["grammaticalCase"] . "_" . $nounData["count"] . $genderSuffix;
echo str_replace('{noun}', $request, Yii::t('dict', $combinedStr)) . "<BR>";
}
echo Yii::t('dict', $animateSuffix) . "<BR>";
}
if ($wordType === "adjective")
{
$animateSuffix = "";
if ($adjectiveData["animated"] === "true")
{
$animateSuffix = "ANIMATE";
}
else
{
$animateSuffix = "INANIMATE";
}
$genderSuffix = "";
if ($adjectiveData["count"] === "NC_SINGULAR")
{
if ($adjectiveData["gender"] === "0")
{
$genderSuffix = "_MALE";
}
else if ($adjectiveData["gender"] === "1")
{
$genderSuffix = "_FEMALE";
}
else
{
$genderSuffix = "_NEUTER";
}
}
if ($adjectiveData["grammaticalCase"] === "NGC_P4_ACCUSATIVE")
2014-12-01 07:22:08 +00:00
{
2014-12-09 12:30:16 +00:00
$combinedStr = $adjectiveData["grammaticalCase"] . "_" . $adjectiveData["count"] . "_" . $animateSuffix . $genderSuffix;
2014-12-01 07:22:08 +00:00
echo str_replace('{noun}', $request, Yii::t('dict', $combinedStr)) . "<BR>";
}
2014-12-09 12:30:16 +00:00
else if ($adjectiveData["grammaticalCase"] === "NGC_P1_NOMINATIVE")
2014-12-01 07:22:08 +00:00
{
2014-12-09 12:30:16 +00:00
$combinedStr = $adjectiveData["grammaticalCase"] . "_" . $adjectiveData["count"] . $genderSuffix;
2014-12-01 07:22:08 +00:00
echo str_replace('{noun}', $request, Yii::t('dict', $combinedStr)) . "<BR>";
}
else
{
2014-12-09 12:30:16 +00:00
$combinedStr = $adjectiveData["grammaticalCase"] . "_" . $adjectiveData["count"] . $genderSuffix;
2014-12-01 07:22:08 +00:00
echo str_replace('{noun}', $request, Yii::t('dict', $combinedStr)) . "<BR>";
}
echo Yii::t('dict', $animateSuffix) . "<BR>";
2014-12-09 12:30:16 +00:00
echo Yii::t('dict', $genderSuffix) . "<BR>";
}
2014-12-01 07:22:08 +00:00
?>
2014-11-26 20:18:59 +00:00
</p>
2014-12-09 12:30:16 +00:00