2 lines
1.7 KiB
JavaScript
2 lines
1.7 KiB
JavaScript
for(var diacriticsList=[{base:"A",chars:"ÁÀÂǍĂÃẢẠÄÅĀĄẤẦẪẨẬẮẰẴẲẶǺ"},{base:"C",chars:"ĆĈČĊÇ"},{base:"D",chars:"ĎĐÐ"},{base:"E",chars:"ÉÈÊĚĔẼẺĖËĒĘẾỀỄỂẸỆ"},{base:"G",chars:"ĞĜĠĢ"},{base:"H",chars:"ĤĦ"},{base:"I",chars:"ÍÌĬÎǏÏĨĮĪỈỊ"},{base:"J",chars:"Ĵ"},{base:"K",chars:"Ķ"},{base:"L",chars:"ĹĽĻŁĿ"},{base:"N",chars:"ŃŇÑŅ"},{base:"O",chars:"ÓÒŎÔỐỒỖỔǑÖŐÕØǾŌỎƠỚỜỠỞỢỌỘ"},{base:"P",chars:"ṔṖ"},{base:"R",chars:"ŔŘŖ"},{base:"S",chars:"ŚŜŠŞ"},{base:"T",chars:"ŤŢŦ"},{base:"U",chars:"ÚÙŬÛǓŮÜǗǛǙǕŰŨŲŪỦƯỨỪỮỬỰỤ"},{base:"W",chars:"ẂẀŴẄ"},{base:"Y",chars:"ÝỲŶŸỸỶỴ"},{base:"Z",chars:"ŹŽŻ"},{base:"a",chars:"áàâǎăãảạäåāąấầẫẩậắằẵẳặǻ"},{base:"C",chars:"ćĉčċç"},{base:"d",chars:"ďđ"},{base:"e",chars:"éèêěĕẽẻėëēęếềễểẹệ"},{base:"g",chars:"ğĝġģ"},{base:"h",chars:"ĥħ"},{base:"i",chars:"íìĭîǐïĩįīỉị"},{base:"j",chars:"ĵ"},{base:"k",chars:"ķ"},{base:"l",chars:"ĺľļłŀ"},{base:"n",chars:"ńňñņ"},{base:"o",chars:"óòŏôốồỗổǒöőõøǿōỏơớờỡởợọộ"},{base:"p",chars:"ṕṗ"},{base:"r",chars:"ŕřŗ"},{base:"s",chars:"śŝšş"},{base:"t",chars:"ťţŧ"},{base:"u",chars:"úùŭûǔůüǘǜǚǖűũųūủưứừữửựụ"},{base:"w",chars:"ẃẁŵẅ"},{base:"y",chars:"ýỳŷÿỹỷỵ"},{base:"z",chars:"źžż"}],diacriticsMap={},i=0;i<diacriticsList.length;i+=1)for(var chars=diacriticsList[i].chars,j=0;j<chars.length;j+=1)diacriticsMap[chars[j]]=diacriticsList[i].base;function removeDiacritics(a){return a.replace(/[^-~]/g,function(a){return diacriticsMap[a]||a})}
|