/**
 * Load the forms to display for a model when a lexem already exists. This code is specific to each LOC version.
 */
function getExistingForms($lexemId, $locVersion)
{
    if ($locVersion >= '5.0') {
        return InflectedForm::loadByLexemIdMapByInflectionRank($lexemId);
    } else {
        return InflectedForm::loadByLexemIdMapByInflectionId($lexemId);
    }
}
예제 #2
0
    }
}
$conjugations = NULL;
$declensions = NULL;
if ($searchType == SEARCH_INFLECTED || $searchType == SEARCH_LEXEM_ID || $searchType == SEARCH_FULL_TEXT || $searchType == SEARCH_MULTIWORD) {
    smarty_assign('results', $searchResults);
    // Maps lexems to arrays of inflected forms (some lexems may lack inflections)
    // Also compute the text of the link to the paradigm div,
    // which can be 'conjugări', 'declinări' or both
    if (!empty($lexems)) {
        $ifMaps = array();
        $conjugations = false;
        $declensions = false;
        foreach ($lexems as $l) {
            if ($showParadigm) {
                $ifMaps[] = InflectedForm::loadByLexemIdMapByInflectionRank($l->id);
            }
            if ($l->modelType == 'V' || $l->modelType == 'VT') {
                $conjugations = true;
            } else {
                $declensions = true;
            }
        }
        $declensionText = $conjugations ? $declensions ? 'conjugări / declinări' : 'conjugări' : 'declinări';
        $hasUnrecommendedForms = false;
        foreach ($ifMaps as $ifMap) {
            foreach ($ifMap as $rank => $ifs) {
                foreach ($ifs as $if) {
                    $hasUnrecommendedForms |= !$if->recommended;
                }
            }