deburr
Version:
Utility that simplifies substring search by normalizing character set. Diacritic marks and supplementary letters are converted to nearest ASCII character sequence before search.
153 lines (143 loc) • 2.36 kB
JSON
{
// Latin-1 supplementary letters to basic latin letters
// See https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table
"À": "A",
"Á": "A",
"Â": "A",
"Ã": "A",
"Ä": "A",
"Å": "A",
"à": "a",
"á": "a",
"â": "a",
"ã": "a",
"ä": "a",
"å": "a",
"Ç": "C",
"ç": "c",
"Ð": "D",
"ð": "d",
"È": "E",
"É": "E",
"Ê": "E",
"Ë": "E",
"è": "e",
"é": "e",
"ê": "e",
"ë": "e",
"Ì": "I",
"Í": "I",
"Î": "I",
"Ï": "I",
"ì": "i",
"í": "i",
"î": "i",
"ï": "i",
"Ñ": "N",
"ñ": "n",
"Ò": "O",
"Ó": "O",
"Ô": "O",
"Õ": "O",
"Ö": "O",
"Ø": "O",
"ò": "o",
"ó": "o",
"ô": "o",
"õ": "o",
"ö": "o",
"ø": "o",
"Ù": "U",
"Ú": "U",
"Û": "U",
"Ü": "U",
"ù": "u",
"ú": "u",
"û": "u",
"ü": "u",
"Ý": "Y",
"ý": "y",
"ÿ": "y",
"Æ": "Ae",
"æ": "ae",
"Þ": "Th",
"þ": "th",
"ß": "ss",
// Cyrillic letters
"ё": "е",
// Unicode characters to close analogues
// See http://www.fileformat.info/info/unicode/category
"‼": "!!",
",": ",",
":": ":",
";": ";",
"…": "...",
// General punctuation
"@": "@",
"©": "c",
"®": "R",
"™": "TM",
// No-break space
" ": " ",
// Single-angle quotes
"›": ">",
"‹": "<",
"‘": "'",
"’": "'",
"‚": "'",
"'": "'",
"︐": "'",
"‛": "'",
"、": "'",
"︑": "'",
// Derivatives
"‵": "'",
"‶": "'",
"‷": "'''",
// Double-angle quotes
"«": "\"",
"»": "\"",
"„": "\"",
"“": "\"",
"”": "\"",
"〝": "\"",
"〞": "\"",
"〟": "\"",
"〃": "\"",
""": "\"",
// Hyphenation and dashes
"⁃": "-",
"‑": "-",
"‒": "-",
"–": "-",
"—": "-",
"―": "-",
"﹘": "-",
"﹣": "-",
"-": "-",
"‐": "-",
"־": "-",
// Currency
"¢": "c",
"£": "L",
"¥": "Y",
"₩": "W",
"₤": "L",
"€": "e",
"¢": "c",
"£": "L",
"¥": "Y",
"₩": "W",
"$": "$",
"¤": "o",
// Math and fractions
"゠": "=",
"×": "x",
"±": "+-",
"¼": "1/4",
"½": "1/2",
"¾": "3/4",
"⁄": "/",
"/": "/",
"\": "\\"
}