本文整理汇总了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) {