Skip to content
Snippets Groups Projects
Commit 4d18c55e authored by Thijs Kinkhorst's avatar Thijs Kinkhorst Committed by GitHub
Browse files

Merge pull request #639 from tauceti2/disco_suggest

Disco suggest algorithm accepts also -_() characters
parents 13ff57bf a3c1fed3
No related branches found
No related tags found
No related merge requests found
...@@ -12,7 +12,7 @@ String.prototype.score = function(abbreviation,offset) { ...@@ -12,7 +12,7 @@ String.prototype.score = function(abbreviation,offset) {
suggest_cache['re'][i] = new Array(); suggest_cache['re'][i] = new Array();
// /\b<x>/ doesn't work when <x> i a non-ascii - oddly enough \s does ... // /\b<x>/ doesn't work when <x> i a non-ascii - oddly enough \s does ...
suggest_cache['re'][i]['initialword'] = new RegExp("^"+words[i], "i"); suggest_cache['re'][i]['initialword'] = new RegExp("^"+words[i], "i");
suggest_cache['re'][i]['word'] = new RegExp("\\s"+words[i], "i"); suggest_cache['re'][i]['word'] = new RegExp("[\\s-()_]"+words[i], "i");
} }
} }
...@@ -20,4 +20,4 @@ String.prototype.score = function(abbreviation,offset) { ...@@ -20,4 +20,4 @@ String.prototype.score = function(abbreviation,offset) {
if (!(this.match(suggest_cache['re'][i]['initialword']) || this.match(suggest_cache['re'][i]['word']))) return 0; if (!(this.match(suggest_cache['re'][i]['initialword']) || this.match(suggest_cache['re'][i]['word']))) return 0;
} }
return 1; return 1;
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment