~zorba-coders/zorba/data-cleaning-module

« back to all changes in this revision

Viewing changes to src/com/zorba-xquery/www/modules/data-cleaning/character-based-string-similarity.xq

  • Committer: William Candillon
  • Date: 2012-11-26 17:20:42 UTC
  • mfrom: (41.1.1 data-cleaning)
  • Revision ID: william.candillon@28msec.com-20121126172042-27yhtbq1v6yrhypu
Merge.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
 : The logic contained in this module is not specific to any particular XQuery implementation.
28
28
 :
29
29
 : @author Bruno Martins and Diogo Simões
30
 
 : @project data processing/data cleaning
 
30
 : @project Zorba/Data Cleaning/Character-Based String Similarity
31
31
 :)
32
32
 
33
33
module namespace simc = "http://www.zorba-xquery.com/modules/data-cleaning/character-based-string-similarity";
43
43
 : being insertion, deletion, or substitution of a single character.
44
44
 :
45
45
 : <br/>
46
 
 : Example usage : <pre> edit-distance("FLWOR", "FLOWER") </pre>
 
46
 : Example usage : <code>edit-distance("FLWOR", "FLOWER")</code>
47
47
 : <br/>
48
 
 : The function invocation in the example above returns : <pre> 2 </pre>
 
48
 : The function invocation in the example above returns : <code>2</code>
49
49
 :
50
50
 : @param $s1 The first string.
51
51
 : @param $s2 The second string.
71
71
 : normalized such that 0 equates to no similarity and 1 is an exact match.
72
72
 :
73
73
 : <br/>
74
 
 : Example usage : <pre> jaro("FLWOR Found.", "FLWOR Foundation") </pre>
 
74
 : Example usage : <code>jaro("FLWOR Found.", "FLWOR Foundation")</code>
75
75
 : <br/>
76
 
 : The function invocation in the example above returns : <pre> 0.5853174603174603 </pre>
 
76
 : The function invocation in the example above returns : <code>0.5853174603174603</code>
77
77
 :
78
78
 : @param $s1 The first string.
79
79
 : @param $s2 The second string.
103
103
 : penalizes strings based on their similarity at the beginning of the string, up to a given prefix size.
104
104
 :
105
105
 : <br/>
106
 
 : Example usage : <pre> jaro-winkler("DWAYNE", "DUANE", 4, 0.1 ) </pre>
 
106
 : Example usage : <code>jaro-winkler("DWAYNE", "DUANE", 4, 0.1 )</code>
107
107
 : <br/>
108
 
 : The function invocation in the example above returns : <pre> 0.8577777777777778 </pre>
 
108
 : The function invocation in the example above returns : <code>0.8577777777777778</code>
109
109
 :
110
110
 : @param $s1 The first string.
111
111
 : @param $s2 The second string.
129
129
 : distance metric.
130
130
 :
131
131
 : <br/>
132
 
 : Example usage : <pre> needleman-wunsch("KAK", "KQRK", 1, 1) </pre>
 
132
 : Example usage : <code>needleman-wunsch("KAK", "KQRK", 1, 1)</code>
133
133
 : <br/>
134
 
 : The function invocation in the example above returns : <pre> 0 </pre>
 
134
 : The function invocation in the example above returns : <code>0</code>
135
135
 :
136
136
 : @param $s1 The first string.
137
137
 : @param $s2 The second string.
155
155
 : Returns the Smith-Waterman distance between two strings.
156
156
 :
157
157
 : <br/>
158
 
 : Example usage : <pre> smith-waterman("ACACACTA", "AGCACACA", 2, 1) </pre>
 
158
 : Example usage : <code>smith-waterman("ACACACTA", "AGCACACA", 2, 1)</code>
159
159
 : <br/>
160
 
 : The function invocation in the example above returns : <pre> 12 </pre>
 
160
 : The function invocation in the example above returns : <code>12</code>
161
161
 :
162
162
 : @param $s1 The first string.
163
163
 : @param $s2 The second string.