Beispiel #1
0
    def __iter__ (self) :
        normalized_score_values = normalized(score.score for score in self.unnormalized_scores)

        for unnormalized_score, normalized_score_value in zip(self.unnormalized_scores, normalized_score_values) :
            normalized_score = Score(object=unnormalized_score.object, score=normalized_score_value)

            yield normalized_score
Beispiel #2
0
    def _calculate_subscores (self, scores) :
        for scoring_function in self.weighted_scoring_functions :
            unnormalized_subscores = (scoring_function(self.object, score.object)
                                      for score in scores)

            normalized_subscores = normalized(unnormalized_subscores)

            for score, normalized_subscore in zip(scores, normalized_subscores) :
                score.subscores[scoring_function] = scoring_function.adjust_orientation(normalized_subscore)