text-data-accentfold.js revision cc70141342b8690e43bef6d8cef0c38fcfba8227
/**
* <p>
* An imperfect, incomplete reverse mapping of ASCII characters to
* case-insensitive regexes that match their most common accented forms.
* </p>
*
* <p>
* The goal of this module is to provide a pragmatic and generally useful set of
* accent folding data, since serving and performing lookups on a complete
* dataset would be impractical in client-side JavaScript.
* </p>
*
* <p>
* Whenever possible, accent folding should be done on the server, where it's
* possible to use tools that are both more complete and more performant. It
* should only be done on the client as an absolute last resort.
* </p>
*
* @module text
* @submodule text-data-accentfold
* @class Text.Data.AccentFold
* @static
*/
// The following tool was very helpful in creating these mappings:
// http://unicode.org/cldr/utility/list-unicodeset.jsp?a=[:toNFKD%3D/^a/:]&abb=on
0: /[⁰₀⓪0]/gi,
1: /[¹₁①1]/gi,
2: /[²₂②2]/gi,
3: /[³₃③3]/gi,
4: /[⁴₄④4]/gi,
5: /[⁵₅⑤5]/gi,
6: /[⁶₆⑥6]/gi,
7: /[⁷₇⑦7]/gi,
8: /[⁸₈⑧8]/gi,
9: /[⁹₉⑨9]/gi,
a: /[ªà-åāăąǎǟǡǻȁȃȧᵃḁẚạảấầẩẫậắằẳẵặⓐa]/gi,
b: /[ᵇḃḅḇⓑb]/gi,
c: /[çćĉċčᶜḉⓒc]/gi,
d: /[ďᵈḋḍḏḑḓⅾⓓd]/gi,
e: /[è-ëēĕėęěȅȇȩᵉḕḗḙḛḝẹẻẽếềểễệₑℯⓔe]/gi,
f: /[ᶠḟⓕf]/gi,
g: /[ĝğġģǧǵᵍḡℊⓖg]/gi,
h: /[ĥȟʰḣḥḧḩḫẖℎⓗh]/gi,
i: /[ì-ïĩīĭįijǐȉȋᵢḭḯỉịⁱℹⅰⓘi]/gi,
j: /[ĵǰʲⓙⱼj]/gi,
k: /[ķǩᵏḱḳḵⓚk]/gi,
l: /[ĺļľŀljˡḷḹḻḽℓⅼⓛl]/gi,
m: /[ᵐḿṁṃⅿⓜm]/gi,
n: /[ñńņňǹṅṇṉṋⁿⓝn]/gi,
o: /[ºò-öōŏőơǒǫǭȍȏȫȭȯȱᵒṍṏṑṓọỏốồổỗộớờởỡợₒℴⓞo]/gi,
p: /[ᵖṕṗⓟp]/gi,
q: /[ʠⓠq]/gi,
r: /[ŕŗřȑȓʳᵣṙṛṝṟⓡr]/gi,
s: /[śŝşšſșˢṡṣṥṧṩẛⓢs]/gi,
t: /[ţťțᵗṫṭṯṱẗⓣt]/gi,
u: /[ù-üũūŭůűųưǔǖǘǚǜȕȗᵘᵤṳṵṷṹṻụủứừửữựⓤu]/gi,
v: /[ᵛᵥṽṿⅴⓥv]/gi,
w: /[ŵʷẁẃẅẇẉẘⓦw]/gi,
x: /[ˣẋẍₓⅹⓧx]/gi,
y: /[ýÿŷȳʸẏẙỳỵỷỹⓨy]/gi,
z: /[źżžᶻẑẓẕⓩz]/gi
};