Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please allow redefinition of DIACRITICS through options #49

Open
varyen opened this issue Apr 25, 2017 · 0 comments
Open

Please allow redefinition of DIACRITICS through options #49

varyen opened this issue Apr 25, 2017 · 0 comments

Comments

@varyen
Copy link

varyen commented Apr 25, 2017

Hi. I'm using selectize with sifter support.

Diacritics matching can be also used when you have two languages (two keyboard layouts) to switch between and you're typing on wrong one.

In my case, english letters "qwertyuiop" are "йцукенгшщз" in russian keyboard layout. If I add these pairs of letters to DIACRITICS it works just perfect and shows expected search results even if I'm on wrong keyboard layout! Very handy.

Something like this:

	var DIACRITICS = {
		'a': '[фaḀḁĂăÂâǍǎȺⱥȦȧẠạÄäÀàÁáĀāÃãÅåąĄÃąĄ]',
		'b': '[иb␢βΒB฿𐌁ᛒ]',
		'c': '[сcĆćĈĉČčĊċC̄c̄ÇçḈḉȻȼƇƈɕᴄCc]',
		'd': '[вdĎďḊḋḐḑḌḍḒḓḎḏĐđD̦d̦ƉɖƊɗƋƌᵭᶁᶑȡᴅDdð]',
		'e': '[уeÉéÈèÊêḘḙĚěĔĕẼẽḚḛẺẻĖėËëĒēȨȩĘęᶒɆɇȄȅẾếỀềỄễỂểḜḝḖḗḔḕȆȇẸẹỆệⱸᴇEeɘǝƏƐε]',
		'f': '[аfƑƒḞḟ]',
		'g': '[пgɢ₲ǤǥĜĝĞğĢģƓɠĠġ]',
		'h': '[рhĤĥĦħḨḩẖẖḤḥḢḣɦʰǶƕ]',
		'i': '[шiÍíÌìĬĭÎîǏǐÏïḮḯĨĩĮįĪīỈỉȈȉȊȋỊịḬḭƗɨɨ̆ᵻᶖİiIıɪIi]',
		'j': '[оjȷĴĵɈɉʝɟʲ]',
		'k': '[лkƘƙꝀꝁḰḱǨǩḲḳḴḵκϰ₭]',
		'l': '[дlŁłĽľĻļĹĺḶḷḸḹḼḽḺḻĿŀȽƚⱠⱡⱢɫɬᶅɭȴʟLl]',
		'n': '[тnŃńǸǹŇňÑñṄṅŅņṆṇṊṋṈṉN̈n̈ƝɲȠƞᵰᶇɳȵɴNnŊŋ]',
		'o': '[щoØøÖöÓóÒòÔôǑǒŐőŎŏȮȯỌọƟɵƠơỎỏŌōÕõǪǫȌȍՕօ]',
		'p': '[зpṔṕṖṗⱣᵽƤƥᵱ]',
		'q': '[йqꝖꝗʠɊɋꝘꝙq̃]',
		'r': '[кrŔŕɌɍŘřŖŗṘṙȐȑȒȓṚṛⱤɽ]',
		's': '[ыsŚśṠṡṢṣꞨꞩŜŝŠšŞşȘșS̈s̈]',
		't': '[еtŤťṪṫŢţṬṭƮʈȚțṰṱṮṯƬƭ]',
		'u': '[гuŬŭɄʉỤụÜüÚúÙùÛûǓǔŰűŬŭƯưỦủŪūŨũŲųȔȕ∪]',
		'v': '[мvṼṽṾṿƲʋꝞꝟⱱʋ]',
		'w': '[цwẂẃẀẁŴŵẄẅẆẇẈẉ]',
		'x': '[чxẌẍẊẋχ]',
		'y': '[нyÝýỲỳŶŷŸÿỸỹẎẏỴỵɎɏƳƴ]',
		'z': '[яzŹźẐẑŽžŻżẒẓẔẕƵƶ]'
	};

Unfortunately there's no way to redefine DIACRITICS variable, it's hardcoded. Is it possible to make it configurable?

P.S. I don't think russian-english or other language pairs should be implemented in source along another diacritics, end users should configure it themselves. But it may be a new feature, in that case of course it will be another variable which can be used in asciifold().

I can prepare and send you pull request for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant