Skip to content

Commit

Permalink
Fix ongoing search case sensitivity
Browse files Browse the repository at this point in the history
  • Loading branch information
r0levrai committed Mar 19, 2024
1 parent aea8d21 commit c64abed
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion search.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,15 @@ class SuffixTree {
}
}

function all_words_in_name(string, name) {
function all_words_in_name(string, name, case_sensitive = false) {
/* return true if all words of string are in name
use this when you don't need the data structure,
e.g. if you are loading names one by one */
if (!case_sensitive)
{
string = string.toLowerCase();
name = name.toLowerCase();
}
let words = string.split(' ');
for (let i in words) {
let word = words[i];
Expand Down

0 comments on commit c64abed

Please sign in to comment.