Skip to content
Snippets Groups Projects
Commit a3c1fed3 authored by Michal Procházka's avatar Michal Procházka
Browse files

Disco suggest algorithm accepts also -_() characters

When IdP has e.g. acronym in the name covered by () or there is dash in the name, then the current suggest algorithm doesn't split the name correctly, so disco doesn't show the name of the organization when you type the acronym or something which is in brackets.
parent 88652a21
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