protected static function SuggestionHelper::getDelta in Autocomplete Search Suggestions 3.0.x
Same name and namespace in other branches
- 8.2 src/SuggestionHelper.php \Drupal\suggestion\SuggestionHelper::getDelta()
- 8 src/SuggestionHelper.php \Drupal\suggestion\SuggestionHelper::getDelta()
Estimate the performance.
Parameters
float $delta: The current performance remainder.
int $n: The summation N - 1.
Return value
float The suggestion's remainder summation.
1 call to SuggestionHelper::getDelta()
- SuggestionHelper::calculateDensity in src/
SuggestionHelper.php - Calculate the ngram's density.
File
- src/
SuggestionHelper.php, line 380
Class
- SuggestionHelper
- Provides helper methods for suggestions.
Namespace
Drupal\suggestionCode
protected static function getDelta($delta, $n) {
if ($delta < self::MIN || !$n) {
return 0;
}
$x = pow($delta, self::EXP);
return $x + self::getDelta($delta - $x, $n - 1);
}