q = q.replace(/\s+/g, ' ');
if (removeSpaces) {
q = q.replace(/\s+/g, '');
+ q = this.removeSpaceAndPoints(q);
}
q = q.toLowerCase();
if (split) {
setRobustHighlightTerms: function (terms) {
let term = terms.join('');
+ term = this.removeSpaceAndPoints(term);
+ console.log(term);
let letters = term.split('');
let occurences = [];
}
},
+ removeSpaceAndPoints: function (str) {
+ str = str.replace(/[-\/_]/g, "");
+ str = str.replace(/[』『「」!?。。。」﹂”』’》)]}〕〗〙〛〉】"#$%&'()*+,-/:;<=>@[\]^_`{|}~⦅⦆「」、 、〃〈〉《》【】〕〔〗〖〙〘〛〚〜〞〝〟〰〾〿–—‘’“‛”„‟…‧﹏﹑﹔·〇一。]/g, "");
+ str = str.replace(/[\u2000-\u20ff\u2122\x21-\x2f\x3a-\x3f\x5b-\x60\x7b-\xa0\xaa-\xbf]/g, "");
+ str = str.replace(/\\p{Cc}/g, "");
+ str = str.replace(/\\p{Whitespace}/g, "");
+ return str;
+ },
+
clearHighlights: function () {
$("#searchHighlights").html('');
for (var p in this.plugins) {