Yahoo! UI Library

unicode  3.3.0pr1

Yahoo! UI Library > unicode > unicode-data-accentfold.js (source view)
Search:
 
Filters
/**
 * <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 unicode
 * @submodule unicode-data-accentfold
 * @class Unicode.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

Y.namespace('Unicode.Data').AccentFold = {
    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
};

Copyright © 2010 Yahoo! Inc. All rights reserved.