1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* |
5
|
|
|
* @Name : similar-text |
6
|
|
|
* @Programmer : Akpé Aurelle Emmanuel Moïse Zinsou |
7
|
|
|
* @Date : 2019-04-01 |
8
|
|
|
* @Released under : https://github.com/manuwhat/similar-text/blob/master/LICENSE |
9
|
|
|
* @Repository : https://github.com/manuwhat/similar |
10
|
|
|
* |
11
|
|
|
**/ |
12
|
|
|
namespace{ |
13
|
|
|
use EZAMA\similar_text; |
14
|
|
|
use EZAMA\commonTextSimilarities; |
15
|
|
|
|
16
|
|
|
function SimilarText( |
17
|
|
|
$firstString, |
18
|
|
|
$secondString, |
19
|
|
|
$round = 2, |
20
|
|
|
$insensitive = true, |
21
|
|
|
&$stats = false, |
22
|
|
|
$getParts = false, |
23
|
|
|
$checkposition=false |
|
|
|
|
24
|
|
|
) { |
25
|
|
|
return similar_text::similarText( |
26
|
|
|
$firstString, |
27
|
|
|
$secondString, |
28
|
|
|
$round, |
29
|
|
|
$insensitive, |
30
|
|
|
$stats, |
31
|
|
|
$getParts |
32
|
|
|
); |
33
|
|
|
} |
34
|
|
|
|
35
|
|
|
function areAnagrams($a, $b) |
36
|
|
|
{ |
37
|
|
|
return commonTextSimilarities::areAnagrams($a, $b); |
38
|
|
|
} |
39
|
|
|
|
40
|
|
|
function similarButNotEqual($a, $b) |
41
|
|
|
{ |
42
|
|
|
return commonTextSimilarities::similarButNotEqual($a, $b); |
43
|
|
|
} |
44
|
|
|
|
45
|
|
|
function aIsSuperStringOfB($a, $b) |
46
|
|
|
{ |
47
|
|
|
return commonTextSimilarities::aIsSuperStringOfB($a, $b); |
48
|
|
|
} |
49
|
|
|
|
50
|
|
|
function haveSameRoot($a, $b) |
51
|
|
|
{ |
52
|
|
|
return commonTextSimilarities::haveSameRoot($a, $b); |
53
|
|
|
} |
54
|
|
|
|
55
|
|
|
function wordsReorderOccured($a, $b, $considerPunctuation=true) |
56
|
|
|
{ |
57
|
|
|
return commonTextSimilarities::wordsReorderOccured($a, $b, $considerPunctuation); |
58
|
|
|
} |
59
|
|
|
|
60
|
|
|
function punctuactionChangesOccured($a, $b, $considerSpace=true) |
61
|
|
|
{ |
62
|
|
|
return commonTextSimilarities::punctuactionChangesOccured($a, $b, $considerSpace); |
63
|
|
|
} |
64
|
|
|
|
65
|
|
|
function areStems($a, $b) |
66
|
|
|
{ |
67
|
|
|
return commonTextSimilarities::areStems($a, $b); |
68
|
|
|
} |
69
|
|
|
|
70
|
|
|
function strippedUrl($a, $b) |
71
|
|
|
{ |
72
|
|
|
return commonTextSimilarities::strippedUrl($a, $b); |
73
|
|
|
} |
74
|
|
|
|
75
|
|
|
function acronymOrExpanded($a, $b) |
76
|
|
|
{ |
77
|
|
|
return commonTextSimilarities::acronymOrExpanded($a, $b); |
78
|
|
|
} |
79
|
|
|
|
80
|
|
|
function wordsAddedOrRemoved($a, $b) |
81
|
|
|
{ |
82
|
|
|
return commonTextSimilarities::wordsAddedOrRemoved($a, $b); |
83
|
|
|
} |
84
|
|
|
} |
85
|
|
|
|
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.