From 06c2fa39c7fdb1f21b9d09281b756bf2ac72882d Mon Sep 17 00:00:00 2001 From: mokaddem Date: Fri, 23 Aug 2019 15:30:33 +0200 Subject: [PATCH] chg: [decaying:effectiveRatio] Tags not having numerical_value doesn't impact effective taxonomy ration anymore --- app/Model/DecayingModelsFormulas/Base.php | 4 ++-- .../DecayingModels/View/basescore_computation_steps.ctp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Model/DecayingModelsFormulas/Base.php b/app/Model/DecayingModelsFormulas/Base.php index 79145fb24..7d70a98c0 100644 --- a/app/Model/DecayingModelsFormulas/Base.php +++ b/app/Model/DecayingModelsFormulas/Base.php @@ -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; } } diff --git a/app/View/Elements/DecayingModels/View/basescore_computation_steps.ctp b/app/View/Elements/DecayingModels/View/basescore_computation_steps.ctp index db5d73c8f..db961e9c6 100644 --- a/app/View/Elements/DecayingModels/View/basescore_computation_steps.ctp +++ b/app/View/Elements/DecayingModels/View/basescore_computation_steps.ctp @@ -7,7 +7,7 @@ - +