Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Version 0.3

  • Loading branch information...
commit e4d044556cb6922af2ceef0ae6e0148687610aff 1 parent 766d7fc
@ConradIrwin ConradIrwin authored
Showing with 4 additions and 4 deletions.
  1. +1 −1  jquery.fuzzymatch.js
  2. +3 −3 jquery.fuzzymatch.min.js
View
2  jquery.fuzzymatch.js
@@ -1,5 +1,5 @@
/**
- * jQuery.fuzzyMatch.js, version 0.2 (2011-06-22)
+ * jQuery.fuzzyMatch.js, version 0.3 (2011-06-22)
*
* https://github.com/rapportive-oss/jquery-fuzzymatch
*
View
6 jquery.fuzzymatch.min.js
@@ -1,3 +1,3 @@
-// jQuery.fuzzyMatch.js (v0.2): Copyright 2011 conrad@rapportive.com (MIT License)
-(function(d){function h(b,d){for(var g=b.toLowerCase(),a=d.toLowerCase(),c=g.indexOf(a),e=[];c>-1;)e.push({before:b.slice(0,c),chr:b.charAt(c),after:b.slice(c+1)}),c=g.indexOf(a,c+1);return e}d.fuzzyMatch=function(b,f){if(f==="")return{score:b===""?1:0.99,html:d("<div>").text(b).html()};return d(h(b,f.charAt(0))).map(function(b,a){var c=d.fuzzyMatch(a.after,f.slice(1)),e=a.before.charAt(a.before.length-1);c.score*=a.before===""?1:e.match(/[\\\/\-_+.# \t"@\[\(\{&]/)||a.chr.toLowerCase()!==a.chr&&e.toLowerCase()===
-e?0.9:0.8;a.chr!==f.charAt(0)&&(c.score*=0.9999);c.score*=Math.pow(0.999,a.before.length);c.html=d("<div>").text(a.before).append(d("<b>").text(a.chr)).append(c.html).html();return c}).sort(function(b,a){return b.score<a.score?1:b.score===a.score?0:-1})[0]||{score:0,html:d("<div>").text(b).html()}}})(jQuery)
+// jQuery.fuzzyMatch.js (v0.3): Copyright 2011 conrad@rapportive.com (MIT License)
+(function(f){function j(a,d){for(var c=a.toLowerCase(),i=d.toLowerCase(),b=c.indexOf(i),e=[];b>-1;)e.push({before:a.slice(0,b),chr:a.charAt(b),after:a.slice(b+1)}),b=c.indexOf(i,b+1);return e}function g(a){return a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}f.fuzzyMatch=function(a,d,c){if(d==="")return{score:a===""?1:0.99,html:g(a)};if(c&&c[a]&&c[a][d])return f.extend({},c[a][d]);c=c||{};c[a]=c[a]||{};c[a][d]=f(j(a,d.charAt(0))).map(function(a,b){var e=f.fuzzyMatch(b.after,d.slice(1),
+c),h=b.before.charAt(b.before.length-1);e.score*=b.before===""?1:h.match(/[\\\/\-_+.# \t"@\[\(\{&]/)||b.chr.toLowerCase()!==b.chr&&h.toLowerCase()===h?0.9:0.8;b.chr!==d.charAt(0)&&(e.score*=0.9999);e.score*=Math.pow(0.999,b.before.length);e.html=g(b.before)+"<b>"+g(b.chr)+"</b>"+e.html;return e}).sort(function(a,b){return a.score<b.score?1:a.score===b.score?0:-1})[0]||{score:0,html:g(a)};return f.extend({},c[a][d])}})(jQuery);
Please sign in to comment.
Something went wrong with that request. Please try again.