本文整理匯總了PHP中Timer::set方法的典型用法代碼示例。如果您正苦於以下問題:PHP Timer::set方法的具體用法?PHP Timer::set怎麽用?PHP Timer::set使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Timer
的用法示例。
在下文中一共展示了Timer::set方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Fsaa
$fsaa = new Fsaa('../dict/lort_acc_full.fsa');
$fsas = new Fsas('../dict/lort_acc_full.fsa');
$fsal = new Fsal('../dict/llems_full.fsa');
$pspell_config = pspell_config_create("pl");
pspell_config_ignore($pspell_config, 4);
pspell_config_mode($pspell_config, PSPELL_FAST);
pspell_config_runtogether($pspell_config, false);
$pspell_link = pspell_new_config($pspell_config);
// uruchomienie stopera, rozpoczêcie zbierania danych czasowych
$stoper = new Timer();
// pobierz zbiór wyników
$res = $db->query("SELECT * FROM comment_{$cfg_tab} WHERE type = 'OK' ORDER BY id");
while ($row = $res->fetch_row()) {
list($id, $comment, $type) = $row;
//echo $comment;
$stoper->set('query');
// sprawdzenie email i WWW
if (Validation::findEmail($comment) || Validation::findWWW($comment)) {
echo 'E' . $id . '--' . $comment . '===' . implode(', ', $tok_comment) . "\n";
$stoper->set('email');
continue;
}
$stoper->set('email');
// docelowa tablica s³ów
$tok_comment = array();
// tokenizacja
$tok_comment1 = $tokenizer->tokenize($comment);
// zdjêcie informacji o potencjalnych wulgaryzmach
$prop_vulg = intval(array_pop($tok_comment1));
$stoper->set('tokens');
/* foreach ($tok_comment1 as $w) {
示例2: foreach
}
} else {
foreach ($pclassifiers as $k => $v) {
$classifiers[$k] = $v[$_POST['set']];
if ($suppressThreshold) {
$classifiers[$k]['threshold'] = 0.0;
}
}
}
// utwórz obiekty klasyfikatorów, obiekty czasomierzy a nastêpnie klasyfikuj
foreach ($classifiers as $k => $v) {
$tmpc = new ReflectionClass($k);
$classObj[$k] = $tmpc->newInstance($db, $dictionaries, $_POST['set'], false, $v);
$time = new Timer();
if (is_null($prepText)) {
$time->set('start');
$prepText = $classObj[$k]->doPreparation($_POST['comment']);
$time->set('doPreparation');
$prepResult['time'] = '<b>' . $time->format($time->get('doPreparation')) . '</b>';
if ($prepText === false) {
break;
}
}
$time->set('start');
$results[$k] = $classObj[$k]->doClassify($prepText, true);
$time->set('doClassify');
$times[$k] = $time->format($time->get('doClassify'));
}
unset($classObj);
$prepResult['org'] = $_POST['comment'];
?>