summaryrefslogtreecommitdiff
blob: d92b3e76871df1da10c4e4ab6a62ec56e610adbd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?php

namespace MediaWiki\Extension\Translate\Utilities\StringComparators;

/**
 * An interface to be implemented by comparators that will compare percentage
 * of similarity between strings.
 */
interface StringComparator {
	/**
	 * Compares the two messages and returns a similarity percentage
	 *
	 * @param string $a
	 * @param string $b
	 * @return float 0-1 with 1 being an exact match
	 */
	public function getSimilarity( $a, $b );
}

class_alias( StringComparator::class, '\MediaWiki\Extensions\Translate\StringComparator' );