function loadFeminineForm($lexemId) { $query = "select * from wordlist where wl_lexem = {$lexemId} " . "and wl_analyse = 33 and wl_variant = 0"; $dbRow = db_fetchSingleRow(mysql_query($query)); $wl = WordList::createFromDbRow($dbRow); if (!$wl) { return ''; } else { return $wl->unaccented; } }
<?php require_once "../../phplib/util.php"; ini_set('max_execution_time', '3600'); ini_set("memory_limit", "512000000"); print "Running first wordlist query...\n"; $dbResult = mysql_query("select * from wordlist"); print "Building form map...\n"; $formMap = array(); while ($dbRow = mysql_fetch_assoc($dbResult)) { $wl = WordList::createFromDbRow($dbRow); $formMap[$wl->form] = true; } // Hash table of id->description $inflIdDescrMap = buildInflectionMap(); db_init(pref_getDbHost(), pref_getDbUser(), pref_getDbPassword(), 'flexonline'); // Hash table of Radu's inflection id -> Cata's inflection id. $rcInflectionMap = matchInflections($inflIdDescrMap); print "Running second wordlist query...\n"; $query = 'select wl_form, lexem_forma, wl_analyse ' . 'from wordlist, lexems ' . 'where wl_lexem = lexem_id '; $dbResult = mysql_query($query); while ($dbRow = mysql_fetch_assoc($dbResult)) { list($form, $lexem, $inflId) = buildRWordList($dbRow); if (!array_key_exists($form, $formMap)) { print "Form: {$form} (Lexem: {$lexem} / " . $inflIdDescrMap[$rcInflectionMap[$inflId]] . ")\n"; } } /****************************************************************************/ function buildInflectionMap() { $m = array();