1 | <?php |
||
7 | class ListItemMatchStrategy implements MatchStrategyInterface |
||
8 | { |
||
9 | /** |
||
10 | * @var int |
||
11 | */ |
||
12 | protected $similarityThreshold; |
||
13 | |||
14 | /** |
||
15 | * @var float |
||
16 | */ |
||
17 | protected $lengthRatioThreshold; |
||
18 | |||
19 | /** |
||
20 | * @var float |
||
21 | */ |
||
22 | protected $commonTextRatioThreshold; |
||
23 | |||
24 | /** |
||
25 | * ListItemMatchStrategy constructor. |
||
26 | * |
||
27 | * @param int $similarityThreshold |
||
28 | * @param float $lengthRatioThreshold |
||
29 | * @param float $commonTextRatioThreshold |
||
30 | */ |
||
31 | public function __construct($similarityThreshold = 80, $lengthRatioThreshold = 0.1, $commonTextRatioThreshold = 0.6) |
||
37 | |||
38 | /** |
||
39 | * @param string $a |
||
40 | * @param string $b |
||
41 | * |
||
42 | * @return bool |
||
43 | */ |
||
44 | public function isMatch($a, $b) |
||
93 | } |
||
94 |