function countDefinitionsByLexicon($lexicon) { $query = "select count(*) from Definition where Status = 0 " . "and Lexicon = '{$lexicon}' " . "and SourceId in (1,2,3,4,5,17,21)"; // "and SourceId not in (8)"; return db_fetchInteger(mysql_query($query)); }
function isInflectedForm($form, $baseForm) { $parts = split('[- ]', $form); foreach ($parts as $part) { $part = addslashes($part); $baseForm = addslashes($baseForm); $query = "select count(*) from wordlist, lexems " . "where wl_neaccentuat = '{$part}' " . "and wl_lexem = lexem_id " . "and (lexem_utf8_general = '{$baseForm}' " . "or lexem_neaccentuat = '{$baseForm}')"; if (db_fetchInteger(mysql_query($query))) { return true; } } return false; }