Thiemo Mättig (WMDE) has uploaded a new change for review. https://gerrit.wikimedia.org/r/177215
Change subject: Delete unused TermMatchScoreCalculator ...................................................................... Delete unused TermMatchScoreCalculator Change-Id: Id4dca502e0b5794029d88ebeae125c5ad965b274 --- D lib/includes/store/TermMatchScoreCalculator.php 1 file changed, 0 insertions(+), 61 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/15/177215/1 diff --git a/lib/includes/store/TermMatchScoreCalculator.php b/lib/includes/store/TermMatchScoreCalculator.php deleted file mode 100644 index d0e7b62..0000000 --- a/lib/includes/store/TermMatchScoreCalculator.php +++ /dev/null @@ -1,61 +0,0 @@ -<?php - -namespace Wikibase; - -/** - * Calculates and stores score for term search - * - * @since 0.3 - * - * @licence GNU GPL v2+ - * @author Jens Ohlig < jens.oh...@wikimedia.de > - * @author John Erling Blad < jeb...@gmail.com > - * @author Tobias Gritschacher < tobias.gritschac...@wikimedia.de > - */ - -class TermMatchScoreCalculator { - - protected $entry; - protected $searchLength; - - /** - * Constructor - * - * @since 0.3 - * - * @param array $entry - * @param string $search - */ - public function __construct( array $entry, $search ) { - $this->entry = $entry; - $this->searchLength = strlen( $search ); - } - - /** - * Calculate score - * - * @since 0.3 - * - * @return integer $score - */ - public function calculateScore() { - $score = 0; - - if ( isset( $this->entry['label'] ) ) { - $score = $this->searchLength / strlen( $this->entry['label'] ); - } - - if ( isset( $this->entry['aliases'] ) ) { - foreach ( $this->entry['aliases'] as $alias ) { - $aliasScore = $this->searchLength / strlen( $alias ); - - if ( $aliasScore > $score ) { - $score = $aliasScore; - } - } - } - - return $score; - } - -} -- To view, visit https://gerrit.wikimedia.org/r/177215 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id4dca502e0b5794029d88ebeae125c5ad965b274 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Thiemo Mättig (WMDE) <thiemo.maet...@wikimedia.de> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits