本文整理匯總了PHP中Definition::searchMultipleWords方法的典型用法代碼示例。如果您正苦於以下問題:PHP Definition::searchMultipleWords方法的具體用法?PHP Definition::searchMultipleWords怎麽用?PHP Definition::searchMultipleWords使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Definition
的用法示例。
在下文中一共展示了Definition::searchMultipleWords方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: smarty_assign
smarty_assign('results', $searchResults);
}
// Normal search
if ($searchType == SEARCH_INFLECTED) {
$lexems = Lexem::searchInflectedForms($cuv, $hasDiacritics, true);
if (count($lexems) == 0) {
$cuv_old = StringUtil::tryOldOrthography($cuv);
$lexems = Lexem::searchInflectedForms($cuv_old, $hasDiacritics, true);
}
if (count($lexems) == 0) {
$searchType = SEARCH_MULTIWORD;
$words = preg_split('/[ .-]+/', $cuv);
if (count($words) > 1) {
$ignoredWords = array_slice($words, 5);
$words = array_slice($words, 0, 5);
$definitions = Definition::searchMultipleWords($words, $hasDiacritics, $sourceId, $exclude_unofficial);
smarty_assign('ignoredWords', $ignoredWords);
}
}
if (count($lexems) == 0 && empty($definitions)) {
$searchType = SEARCH_APPROXIMATE;
$lexems = Lexem::searchApproximate($cuv, $hasDiacritics, true);
if (count($lexems) == 1) {
FlashMessage::add("Ați fost redirecționat automat la forma „{$lexems[0]->formNoAccent}”.");
} else {
if (!count($lexems)) {
FlashMessage::add("Niciun rezultat relevant pentru „{$cuv}”.");
}
}
}
if (count($lexems) == 1 && $cuv != $lexems[0]->formNoAccent) {