~zorba-coders/zorba/data-cleaning-missing-functions

« back to all changes in this revision

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

  • Committer: spungi
  • Date: 2011-08-02 14:07:32 UTC
  • Revision ID: svn-v4:8046edc3-af21-0410-8661-ec7318497eea:modules/data-cleaning/trunk:11523
commented out function Smith-Waterman.

Show diffs side-by-side

added added

removed removed

Lines of Context:
164
164
 : @param $score The score value.
165
165
 : @param $penalty The penalty value.
166
166
 : @return The Smith-Waterman distance between the two strings.
167
 
  :)
 
167
 :)
 
168
(:
168
169
declare function simc:smith-waterman ( $s1 as xs:string, $s2 as xs:string, $score as xs:integer, $penalty as xs:integer ) as xs:double{ 
169
170
 if(string-length($s1) = 0) then 0 else
170
171
 if(string-length($s2) = 0) then 0 else
175
176
  simc:smith-waterman(substring($s1, 2), substring($s2, 2), $score, $penalty) + ( if(substring($s1, 1, 1) = substring($s2, 1, 1)) then $score else -$penalty )
176
177
 ))
177
178
};
 
179
:)