Hello. I am trying to achieve the following.
I have a form which is in Greek. When the user types, everything works smooth. I would like to create a matcher function that will enable the user to find the correct match even though the user types in latin. Of course I have already defined an array of possible greeklishToGreek mappings however I try to use the matcher and it does not work or when I managed to get this working…it was case sensitive which I dont want.
The function I use is something like this.
function matchCustom(params, data) {
if ($.trim(params.term) === '') {
return data;
}
var greek = greekUtils.toGreek('kalhmera pws eiste?','');
console.log(greek); //καλημερα, πως ειστε;
if ($.trim(params.term) === '') {
return data;
}
// `params.term` should be the term that is used for searching
// `data.text` is the text that is displayed for the data object
var original = params.term; // Greeklish px Marousi
var grOrig = greekUtils.toGreek(original); // Greek px Μαρουι
if (data.text.indexOf(grOrig) > -1) {
return data;
}
if (data.text.indexOf(grOrig) > -1) {
var modifiedData = $.extend({}, data, true);
modifiedData.text += ' (matched)';
You can return modified objects from here
This includes matching the `children` how you want in nested data sets
return modifiedData;
}
return null;
}
is there any solution available?