chg: [decaying:effectiveRatio] Tags not having numerical_value doesn't

impact effective taxonomy ration anymore
pull/5032/head
mokaddem 2019-08-23 15:30:33 +02:00
parent b67f3879e3
commit 06c2fa39c7
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
2 changed files with 3 additions and 3 deletions

View File

@ -23,13 +23,13 @@ abstract class DecayingModelBase
$total_score = 0.0;
foreach ($tags as $tag) {
$namespace_predicate = explode(':', $tag['Tag']['name'])[0];
if (isset($taxonomy_base_ratio[$namespace_predicate])) {
if (isset($taxonomy_base_ratio[$namespace_predicate]) && is_numeric($tag['Tag']['numerical_value'])) {
$total_score += floatval($taxonomy_base_ratio[$namespace_predicate]);
}
}
foreach ($tags as $i => $tag) {
$namespace_predicate = explode(':', $tag['Tag']['name'])[0];
if (isset($taxonomy_base_ratio[$namespace_predicate])) {
if (isset($taxonomy_base_ratio[$namespace_predicate]) && is_numeric($tag['Tag']['numerical_value'])) {
$ratioScore[$namespace_predicate] = floatval($taxonomy_base_ratio[$namespace_predicate]) / $total_score;
}
}

View File

@ -7,7 +7,7 @@
<th rowspan="2" style="vertical-align: middle;"><?php echo __('Result') ?></th>
</tr>
<tr>
<th style="padding: 0px; width: 50px;" title="<?php echo __('Taxonomy ratio') ?>"><?php echo __('Ratio') ?></th>
<th style="padding: 0px; width: 50px;" title="<?php echo __('Taxonomy effective ratio') ?>"><?php echo __('Ratio') ?></th>
<th></th>
<th style="padding: 0px; width: 50px;" title="<?php echo __('Tag numerical value') ?>"><?php echo __('Value') ?></th>
</tr>