本文整理汇总了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'];
?>