code:
<?php

namespace Masterminds\HTML5;

/**
 * Entity lookup tables.
 * This class is automatically generated.
 */
class Entities
{
    public static $byName = array(
        'Aacute' => 'Á',
        'Aacut' => 'Á',
        'aacute' => 'á',
        'aacut' => 'á',
        'Abreve' => 'Ă',
        'abreve' => 'ă',
        'ac' => '∾',
        'acd' => '∿',
        'acE' => '∾̳',
        'Acirc' => 'Â',
        'Acir' => 'Â',
        'acirc' => 'â',
        'acir' => 'â',
        'acute' => '´',
        'acut' => '´',
        'Acy' => 'А',
        'acy' => 'а',
        'AElig' => 'Æ',
        'AEli' => 'Æ',
        'aelig' => 'æ',
        'aeli' => 'æ',
        'af' => '',
        'Afr' => '𝔄',
        'afr' => '𝔞',
        'Agrave' => 'À',
        'Agrav' => 'À',
        'agrave' => 'à',
        'agrav' => 'à',
        'alefsym' => 'ℵ',
        'aleph' => 'ℵ',
        'Alpha' => 'Α',
        'alpha' => 'α',
        'Amacr' => 'Ā',
        'amacr' => 'ā',
        'amalg' => '⨿',
        'AMP' => '&',
        'AM' => '&',
        'amp' => '&',
        'am' => '&',
        'And' => '⩓',
        'and' => '∧',
        'andand' => '⩕',
        'andd' => '⩜',
        'andslope' => '⩘',
        'andv' => '⩚',
        'ang' => '∠',
        'ange' => '⦤',
        'angle' => '∠',
        'angmsd' => '∡',
        'angmsdaa' => '⦨',
        'angmsdab' => '⦩',
        'angmsdac' => '⦪',
        'angmsdad' => '⦫',
        'angmsdae' => '⦬',
        'angmsdaf' => '⦭',
        'angmsdag' => '⦮',
        'angmsdah' => '⦯',
        'angrt' => '∟',
        'angrtvb' => '⊾',
        'angrtvbd' => '⦝',
        'angsph' => '∢',
        'angst' => 'Å',
        'angzarr' => '⍼',
        'Aogon' => 'Ą',
        'aogon' => 'ą',
        'Aopf' => '𝔸',
        'aopf' => '𝕒',
        'ap' => '≈',
        'apacir' => '⩯',
        'apE' => '⩰',
        'ape' => '≊',
        'apid' => '≋',
        'apos' => '\'',
        'ApplyFunction' => '',
        'approx' => '≈',
        'approxeq' => '≊',
        'Aring' => 'Å',
        'Arin' => 'Å',
        'aring' => 'å',
        'arin' => 'å',
        'Ascr' => '𝒜',
        'ascr' => '𝒶',
        'Assign' => '≔',
        'ast' => '*',
        'asymp' => '≈',
        'asympeq' => '≍',
        'Atilde' => 'Ã',
        'Atild' => 'Ã',
        'atilde' => 'ã',
        'atild' => 'ã',
        'Auml' => 'Ä',
        'Aum' => 'Ä',
        'auml' => 'ä',
        'aum' => 'ä',
        'awconint' => '∳',
        'awint' => '⨑',
        'backcong' => '≌',
        'backepsilon' => '϶',
        'backprime' => '‵',
        'backsim' => '∽',
        'backsimeq' => '⋍',
        'Backslash' => '∖',
        'Barv' => '⫧',
        'barvee' => '⊽',
        'Barwed' => '⌆',
        'barwed' => '⌅',
        'barwedge' => '⌅',
        'bbrk' => '⎵',
        'bbrktbrk' => '⎶',
        'bcong' => '≌',
        'Bcy' => 'Б',
        'bcy' => 'б',
        'bdquo' => '„',
        'becaus' => '∵',
        'Because' => '∵',
        'because' => '∵',
        'bemptyv' => '⦰',
        'bepsi' => '϶',
        'bernou' => 'ℬ',
        'Bernoullis' => 'ℬ',
        'Beta' => 'Β',
        'beta' => 'β',
        'beth' => 'ℶ',
        'between' => '≬',
        'Bfr' => '𝔅',
        'bfr' => '𝔟',
        'bigcap' => '⋂',
        'bigcirc' => '◯',
        'bigcup' => '⋃',
        'bigodot' => '⨀',
        'bigoplus' => '⨁',
        'bigotimes' => '⨂',
        'bigsqcup' => '⨆',
        'bigstar' => '★',
        'bigtriangledown' => '▽',
        'bigtriangleup' => '△',
        'biguplus' => '⨄',
        'bigvee' => '⋁',
        'bigwedge' => '⋀',
        'bkarow' => '⤍',
        'blacklozenge' => '⧫',
        'blacksquare' => '▪',
        'blacktriangle' => '▴',
        'blacktriangledown' => '▾',
        'blacktriangleleft' => '◂',
        'blacktriangleright' => '▸',
        'blank' => '␣',
        'blk12' => '▒',
        'blk14' => '░',
        'blk34' => '▓',
        'block' => '█',
        'bne' => '=⃥',
        'bnequiv' => '≡⃥',
        'bNot' => '⫭',
        'bnot' => '⌐',
        'Bopf' => '𝔹',
        'bopf' => '𝕓',
        'bot' => '⊥',
        'bottom' => '⊥',
        'bowtie' => '⋈',
        'boxbox' => '⧉',
        'boxDL' => '╗',
        'boxDl' => '╖',
        'boxdL' => '╕',
        'boxdl' => '┐',
        'boxDR' => '╔',
        'boxDr' => '╓',
        'boxdR' => '╒',
        'boxdr' => '┌',
        'boxH' => '═',
        'boxh' => '─',
        'boxHD' => '╦',
        'boxHd' => '╤',
        'boxhD' => '╥',
        'boxhd' => '┬',
        'boxHU' => '╩',
        'boxHu' => '╧',
        'boxhU' => '╨',
        'boxhu' => '┴',
        'boxminus' => '⊟',
        'boxplus' => '⊞',
        'boxtimes' => '⊠',
        'boxUL' => '╝',
        'boxUl' => '╜',
        'boxuL' => '╛',
        'boxul' => '┘',
        'boxUR' => '╚',
        'boxUr' => '╙',
        'boxuR' => '╘',
        'boxur' => '└',
        'boxV' => '║',
        'boxv' => '│',
        'boxVH' => '╬',
        'boxVh' => '╫',
        'boxvH' => '╪',
        'boxvh' => '┼',
        'boxVL' => '╣',
        'boxVl' => '╢',
        'boxvL' => '╡',
        'boxvl' => '┤',
        'boxVR' => '╠',
        'boxVr' => '╟',
        'boxvR' => '╞',
        'boxvr' => '├',
        'bprime' => '‵',
        'Breve' => '˘',
        'breve' => '˘',
        'brvbar' => '¦',
        'brvba' => '¦',
        'Bscr' => 'ℬ',
        'bscr' => '𝒷',
        'bsemi' => '⁏',
        'bsim' => '∽',
        'bsime' => '⋍',
        'bsol' => '\\',
        'bsolb' => '⧅',
        'bsolhsub' => '⟈',
        'bull' => '•',
        'bullet' => '•',
        'bump' => '≎',
        'bumpE' => '⪮',
        'bumpe' => '≏',
        'Bumpeq' => '≎',
        'bumpeq' => '≏',
        'Cacute' => 'Ć',
        'cacute' => 'ć',
        'Cap' => '⋒',
        'cap' => '∩',
        'capand' => '⩄',
        'capbrcup' => '⩉',
        'capcap' => '⩋',
        'capcup' => '⩇',
        'capdot' => '⩀',
        'CapitalDifferentialD' => 'ⅅ',
        'caps' => '∩',
        'caret' => '⁁',
        'caron' => 'ˇ',
        'Cayleys' => 'ℭ',
        'ccaps' => '⩍',
        'Ccaron' => 'Č',
        'ccaron' => 'č',
        'Ccedil' => 'Ç',
        'Ccedi' => 'Ç',
        'ccedil' => 'ç',
        'ccedi' => 'ç',
        'Ccirc' => 'Ĉ',
        'ccirc' => 'ĉ',
        'Cconint' => '∰',
        'ccups' => '⩌',
        'ccupssm' => '⩐',
        'Cdot' => 'Ċ',
        'cdot' => 'ċ',
        'cedil' => '¸',
        'cedi' => '¸',
        'Cedilla' => '¸',
        'cemptyv' => '⦲',
        'cent' => '¢',
        'cen' => '¢',
        'CenterDot' => '·',
        'centerdot' => '·',
        'Cfr' => 'ℭ',
        'cfr' => '𝔠',
        'CHcy' => 'Ч',
        'chcy' => 'ч',
        'check' => '✓',
        'checkmark' => '✓',
        'Chi' => 'Χ',
        'chi' => 'χ',
        'cir' => '○',
        'circ' => 'ˆ',
        'circeq' => '≗',
        'circlearrowleft' => '↺',
        'circlearrowright' => '↻',
        'circledast' => '⊛',
        'circledcirc' => '⊚',
        'circleddash' => '⊝',
        'CircleDot' => '⊙',
        'circledR' => '®',
        'circledS' => 'Ⓢ',
        'CircleMinus' => '⊖',
        'CirclePlus' => '⊕',
        'CircleTimes' => '⊗',
        'cirE' => '⧃',
        'cire' => '≗',
        'cirfnint' => '⨐',
        'cirmid' => '⫯',
        'cirscir' => '⧂',
        'ClockwiseContourIntegral' => '∲',
        'CloseCurlyDoubleQuote' => '”',
        'CloseCurlyQuote' => '’',
        'clubs' => '♣',
        'clubsuit' => '♣',
        'Colon' => '∷',
        'colon' => ':',
        'Colone' => '⩴',
        'colone' => '≔',
        'coloneq' => '≔',
        'comma' => ',',
        'commat' => '@',
        'comp' => '∁',
        'compfn' => '∘',
        'complement' => '∁',
        'complexes' => 'ℂ',
        'cong' => '≅',
        'congdot' => '⩭',
        'Congruent' => '≡',
        'Conint' => '∯',
        'conint' => '∮',
        'ContourIntegral' => '∮',
        'Copf' => 'ℂ',
        'copf' => '𝕔',
        'coprod' => '∐',
        'Coproduct' => '∐',
        'COPY' => '©',
        'COP' => '©',
        'copy' => '©',
        'cop' => '©',
        'copysr' => '℗',
        'CounterClockwiseContourIntegral' => '∳',
        'crarr' => '↵',
        'Cross' => '⨯',
        'cross' => '✗',
        'Cscr' => '𝒞',
        'cscr' => '𝒸',
        'csub' => '⫏',
        'csube' => '⫑',
        'csup' => '⫐',
        'csupe' => '⫒',
        'ctdot' => '⋯',
        'cudarrl' => '⤸',
        'cudarrr' => '⤵',
        'cuepr' => '⋞',
        'cuesc' => '⋟',
        'cularr' => '↶',
        'cularrp' => '⤽',
        'Cup' => '⋓',
        'cup' => '∪',
        'cupbrcap' => '⩈',
        'CupCap' => '≍',
        'cupcap' => '⩆',
        'cupcup' => '⩊',
        'cupdot' => '⊍',
        'cupor' => '⩅',
        'cups' => '∪',
        'curarr' => '↷',
        'curarrm' => '⤼',
        'curlyeqprec' => '⋞',
        'curlyeqsucc' => '⋟',
        'curlyvee' => '⋎',
        'curlywedge' => '⋏',
        'curren' => '¤',
        'curre' => '¤',
        'curvearrowleft' => '↶',
        'curvearrowright' => '↷',
        'cuvee' => '⋎',
        'cuwed' => '⋏',
        'cwconint' => '∲',
        'cwint' => '∱',
        'cylcty' => '⌭',
        'Dagger' => '‡',
        'dagger' => '†',
        'daleth' => 'ℸ',
        'Darr' => '↡',
        'dArr' => '⇓',
        'darr' => '↓',
        'dash' => '‐',
        'Dashv' => '⫤',
        'dashv' => '⊣',
        'dbkarow' => '⤏',
        'dblac' => '˝',
        'Dcaron' => 'Ď',
        'dcaron' => 'ď',
        'Dcy' => 'Д',
        'dcy' => 'д',
        'DD' => 'ⅅ',
        'dd' => 'ⅆ',
        'ddagger' => '‡',
        'ddarr' => '⇊',
        'DDotrahd' => '⤑',
        'ddotseq' => '⩷',
        'deg' => '°',
        'de' => '°',
        'Del' => '∇',
        'Delta' => 'Δ',
        'delta' => 'δ',
        'demptyv' => '⦱',
        'dfisht' => '⥿',
        'Dfr' => '𝔇',
        'dfr' => '𝔡',
        'dHar' => '⥥',
        'dharl' => '⇃',
        'dharr' => '⇂',
        'DiacriticalAcute' => '´',
        'DiacriticalDot' => '˙',
        'DiacriticalDoubleAcute' => '˝',
        'DiacriticalGrave' => '`',
        'DiacriticalTilde' => '˜',
        'diam' => '⋄',
        'Diamond' => '⋄',
        'diamond' => '⋄',
        'diamondsuit' => '♦',
        'diams' => '♦',
        'die' => '¨',
        'DifferentialD' => 'ⅆ',
        'digamma' => 'ϝ',
        'disin' => '⋲',
        'div' => '÷',
        'divide' => '÷',
        'divid' => '÷',
        'divideontimes' => '⋇',
        'divonx' => '⋇',
        'DJcy' => 'Ђ',
        'djcy' => 'ђ',
        'dlcorn' => '⌞',
        'dlcrop' => '⌍',
        'dollar' => '$',
        'Dopf' => '𝔻',
        'dopf' => '𝕕',
        'Dot' => '¨',
        'dot' => '˙',
        'DotDot' => '⃜',
        'doteq' => '≐',
        'doteqdot' => '≑',
        'DotEqual' => '≐',
        'dotminus' => '∸',
        'dotplus' => '∔',
        'dotsquare' => '⊡',
        'doublebarwedge' => '⌆',
        'DoubleContourIntegral' => '∯',
        'DoubleDot' => '¨',
        'DoubleDownArrow' => '⇓',
        'DoubleLeftArrow' => '⇐',
        'DoubleLeftRightArrow' => '⇔',
        'DoubleLeftTee' => '⫤',
        'DoubleLongLeftArrow' => '⟸',
        'DoubleLongLeftRightArrow' => '⟺',
        'DoubleLongRightArrow' => '⟹',
        'DoubleRightArrow' => '⇒',
        'DoubleRightTee' => '⊨',
        'DoubleUpArrow' => '⇑',
        'DoubleUpDownArrow' => '⇕',
        'DoubleVerticalBar' => '∥',
        'DownArrow' => '↓',
        'Downarrow' => '⇓',
        'downarrow' => '↓',
        'DownArrowBar' => '⤓',
        'DownArrowUpArrow' => '⇵',
        'DownBreve' => '̑',
        'downdownarrows' => '⇊',
        'downharpoonleft' => '⇃',
        'downharpoonright' => '⇂',
        'DownLeftRightVector' => '⥐',
        'DownLeftTeeVector' => '⥞',
        'DownLeftVector' => '↽',
        'DownLeftVectorBar' => '⥖',
        'DownRightTeeVector' => '⥟',
        'DownRightVector' => '⇁',
        'DownRightVectorBar' => '⥗',
        'DownTee' => '⊤',
        'DownTeeArrow' => '↧',
        'drbkarow' => '⤐',
        'drcorn' => '⌟',
        'drcrop' => '⌌',
        'Dscr' => '𝒟',
        'dscr' => '𝒹',
        'DScy' => 'Ѕ',
        'dscy' => 'ѕ',
        'dsol' => '⧶',
        'Dstrok' => 'Đ',
        'dstrok' => 'đ',
        'dtdot' => '⋱',
        'dtri' => '▿',
        'dtrif' => '▾',
        'duarr' => '⇵',
        'duhar' => '⥯',
        'dwangle' => '⦦',
        'DZcy' => 'Џ',
        'dzcy' => 'џ',
        'dzigrarr' => '⟿',
        'Eacute' => 'É',
        'Eacut' => 'É',
        'eacute' => 'é',
        'eacut' => 'é',
        'easter' => '⩮',
        'Ecaron' => 'Ě',
        'ecaron' => 'ě',
        'ecir' => 'ê',
        'Ecirc' => 'Ê',
        'Ecir' => 'Ê',
        'ecirc' => 'ê',
        'ecolon' => '≕',
        'Ecy' => 'Э',
        'ecy' => 'э',
        'eDDot' => '⩷',
        'Edot' => 'Ė',
        'eDot' => '≑',
        'edot' => 'ė',
        'ee' => 'ⅇ',
        'efDot' => '≒',
        'Efr' => '𝔈',
        'efr' => '𝔢',
        'eg' => '⪚',
        'Egrave' => 'È',
        'Egrav' => 'È',
        'egrave' => 'è',
        'egrav' => 'è',
        'egs' => '⪖',
        'egsdot' => '⪘',
        'el' => '⪙',
        'Element' => '∈',
        'elinters' => '⏧',
        'ell' => 'ℓ',
        'els' => '⪕',
        'elsdot' => '⪗',
        'Emacr' => 'Ē',
        'emacr' => 'ē',
        'empty' => '∅',
        'emptyset' => '∅',
        'EmptySmallSquare' => '◻',
        'emptyv' => '∅',
        'EmptyVerySmallSquare' => '▫',
        'emsp' => ' ',
        'emsp13' => ' ',
        'emsp14' => ' ',
        'ENG' => 'Ŋ',
        'eng' => 'ŋ',
        'ensp' => ' ',
        'Eogon' => 'Ę',
        'eogon' => 'ę',
        'Eopf' => '𝔼',
        'eopf' => '𝕖',
        'epar' => '⋕',
        'eparsl' => '⧣',
        'eplus' => '⩱',
        'epsi' => 'ε',
        'Epsilon' => 'Ε',
        'epsilon' => 'ε',
        'epsiv' => 'ϵ',
        'eqcirc' => '≖',
        'eqcolon' => '≕',
        'eqsim' => '≂',
        'eqslantgtr' => '⪖',
        'eqslantless' => '⪕',
        'Equal' => '⩵',
        'equals' => '=',
        'EqualTilde' => '≂',
        'equest' => '≟',
        'Equilibrium' => '⇌',
        'equiv' => '≡',
        'equivDD' => '⩸',
        'eqvparsl' => '⧥',
        'erarr' => '⥱',
        'erDot' => '≓',
        'Escr' => 'ℰ',
        'escr' => 'ℯ',
        'esdot' => '≐',
        'Esim' => '⩳',
        'esim' => '≂',
        'Eta' => 'Η',
        'eta' => 'η',
        'ETH' => 'Ð',
        'ET' => 'Ð',
        'eth' => 'ð',
        'et' => 'ð',
        'Euml' => 'Ë',
        'Eum' => 'Ë',
        'euml' => 'ë',
        'eum' => 'ë',
        'euro' => '€',
        'excl' => '!',
        'exist' => '∃',
        'Exists' => '∃',
        'expectation' => 'ℰ',
        'ExponentialE' => 'ⅇ',
        'exponentiale' => 'ⅇ',
        'fallingdotseq' => '≒',
        'Fcy' => 'Ф',
        'fcy' => 'ф',
        'female' => '♀',
        'ffilig' => 'ﬃ',
        'fflig' => 'ﬀ',
        'ffllig' => 'ﬄ',
        'Ffr' => '𝔉',
        'ffr' => '𝔣',
        'filig' => 'ﬁ',
        'FilledSmallSquare' => '◼',
        'FilledVerySmallSquare' => '▪',
        'fjlig' => 'fj',
        'flat' => '♭',
        'fllig' => 'ﬂ',
        'fltns' => '▱',
        'fnof' => 'ƒ',
        'Fopf' => '𝔽',
        'fopf' => '𝕗',
        'ForAll' => '∀',
        'forall' => '∀',
        'fork' => '⋔',
        'forkv' => '⫙',
        'Fouriertrf' => 'ℱ',
        'fpartint' => '⨍',
        'frac12' => '½',
        'frac1' => '¼',
        'frac13' => '⅓',
        'frac14' => '¼',
        'frac15' => '⅕',
        'frac16' => '⅙',
        'frac18' => '⅛',
        'frac23' => '⅔',
        'frac25' => '⅖',
        'frac34' => '¾',
        'frac3' => '¾',
        'frac35' => '⅗',
        'frac38' => '⅜',
        'frac45' => '⅘',
        'frac56' => '⅚',
        'frac58' => '⅝',
        'frac78' => '⅞',
        'frasl' => '⁄',
        'frown' => '⌢',
        'Fscr' => 'ℱ',
        'fscr' => '𝒻',
        'gacute' => 'ǵ',
        'Gamma' => 'Γ',
        'gamma' => 'γ',
        'Gammad' => 'Ϝ',
        'gammad' => 'ϝ',
        'gap' => '⪆',
        'Gbreve' => 'Ğ',
        'gbreve' => 'ğ',
        'Gcedil' => 'Ģ',
        'Gcirc' => 'Ĝ',
        'gcirc' => 'ĝ',
        'Gcy' => 'Г',
        'gcy' => 'г',
        'Gdot' => 'Ġ',
        'gdot' => 'ġ',
        'gE' => '≧',
        'ge' => '≥',
        'gEl' => '⪌',
        'gel' => '⋛',
        'geq' => '≥',
        'geqq' => '≧',
        'geqslant' => '⩾',
        'ges' => '⩾',
        'gescc' => '⪩',
        'gesdot' => '⪀',
        'gesdoto' => '⪂',
        'gesdotol' => '⪄',
        'gesl' => '⋛',
        'gesles' => '⪔',
        'Gfr' => '𝔊',
        'gfr' => '𝔤',
        'Gg' => '⋙',
        'gg' => '≫',
        'ggg' => '⋙',
        'gimel' => 'ℷ',
        'GJcy' => 'Ѓ',
        'gjcy' => 'ѓ',
        'gl' => '≷',
        'gla' => '⪥',
        'glE' => '⪒',
        'glj' => '⪤',
        'gnap' => '⪊',
        'gnapprox' => '⪊',
        'gnE' => '≩',
        'gne' => '⪈',
        'gneq' => '⪈',
        'gneqq' => '≩',
        'gnsim' => '⋧',
        'Gopf' => '𝔾',
        'gopf' => '𝕘',
        'grave' => '`',
        'GreaterEqual' => '≥',
        'GreaterEqualLess' => '⋛',
        'GreaterFullEqual' => '≧',
        'GreaterGreater' => '⪢',
        'GreaterLess' => '≷',
        'GreaterSlantEqual' => '⩾',
        'GreaterTilde' => '≳',
        'Gscr' => '𝒢',
        'gscr' => 'ℊ',
        'gsim' => '≳',
        'gsime' => '⪎',
        'gsiml' => '⪐',
        'GT' => '>',
        'G' => '>',
        'Gt' => '≫',
        'gt' => '>',
        'g' => '>',
        'gtcc' => '⪧',
        'gtcir' => '⩺',
        'gtdot' => '⋗',
        'gtlPar' => '⦕',
        'gtquest' => '⩼',
        'gtrapprox' => '⪆',
        'gtrarr' => '⥸',
        'gtrdot' => '⋗',
        'gtreqless' => '⋛',
        'gtreqqless' => '⪌',
        'gtrless' => '≷',
        'gtrsim' => '≳',
        'gvertneqq' => '≩',
        'gvnE' => '≩',
        'Hacek' => 'ˇ',
        'hairsp' => ' ',
        'half' => '½',
        'hamilt' => 'ℋ',
        'HARDcy' => 'Ъ',
        'hardcy' => 'ъ',
        'hArr' => '⇔',
        'harr' => '↔',
        'harrcir' => '⥈',
        'harrw' => '↭',
        'Hat' => '^',
        'hbar' => 'ℏ',
        'Hcirc' => 'Ĥ',
        'hcirc' => 'ĥ',
        'hearts' => '♥',
        'heartsuit' => '♥',
        'hellip' => '…',
        'hercon' => '⊹',
        'Hfr' => 'ℌ',
        'hfr' => '𝔥',
        'HilbertSpace' => 'ℋ',
        'hksearow' => '⤥',
        'hkswarow' => '⤦',
        'hoarr' => '⇿',
        'homtht' => '∻',
        'hookleftarrow' => '↩',
        'hookrightarrow' => '↪',
        'Hopf' => 'ℍ',
        'hopf' => '𝕙',
        'horbar' => '―',
        'HorizontalLine' => '─',
        'Hscr' => 'ℋ',
        'hscr' => '𝒽',
        'hslash' => 'ℏ',
        'Hstrok' => 'Ħ',
        'hstrok' => 'ħ',
        'HumpDownHump' => '≎',
        'HumpEqual' => '≏',
        'hybull' => '⁃',
        'hyphen' => '‐',
        'Iacute' => 'Í',
        'Iacut' => 'Í',
        'iacute' => 'í',
        'iacut' => 'í',
        'ic' => '',
        'Icirc' => 'Î',
        'Icir' => 'Î',
        'icirc' => 'î',
        'icir' => 'î',
        'Icy' => 'И',
        'icy' => 'и',
        'Idot' => 'İ',
        'IEcy' => 'Е',
        'iecy' => 'е',
        'iexcl' => '¡',
        'iexc' => '¡',
        'iff' => '⇔',
        'Ifr' => 'ℑ',
        'ifr' => '𝔦',
        'Igrave' => 'Ì',
        'Igrav' => 'Ì',
        'igrave' => 'ì',
        'igrav' => 'ì',
        'ii' => 'ⅈ',
        'iiiint' => '⨌',
        'iiint' => '∭',
        'iinfin' => '⧜',
        'iiota' => '℩',
        'IJlig' => 'Ĳ',
        'ijlig' => 'ĳ',
        'Im' => 'ℑ',
        'Imacr' => 'Ī',
        'imacr' => 'ī',
        'image' => 'ℑ',
        'ImaginaryI' => 'ⅈ',
        'imagline' => 'ℐ',
        'imagpart' => 'ℑ',
        'imath' => 'ı',
        'imof' => '⊷',
        'imped' => 'Ƶ',
        'Implies' => '⇒',
        'in' => '∈',
        'incare' => '℅',
        'infin' => '∞',
        'infintie' => '⧝',
        'inodot' => 'ı',
        'Int' => '∬',
        'int' => '∫',
        'intcal' => '⊺',
        'integers' => 'ℤ',
        'Integral' => '∫',
        'intercal' => '⊺',
        'Intersection' => '⋂',
        'intlarhk' => '⨗',
        'intprod' => '⨼',
        'InvisibleComma' => '',
        'InvisibleTimes' => '',
        'IOcy' => 'Ё',
        'iocy' => 'ё',
        'Iogon' => 'Į',
        'iogon' => 'į',
        'Iopf' => '𝕀',
        'iopf' => '𝕚',
        'Iota' => 'Ι',
        'iota' => 'ι',
        'iprod' => '⨼',
        'iquest' => '¿',
        'iques' => '¿',
        'Iscr' => 'ℐ',
        'iscr' => '𝒾',
        'isin' => '∈',
        'isindot' => '⋵',
        'isinE' => '⋹',
        'isins' => '⋴',
        'isinsv' => '⋳',
        'isinv' => '∈',
        'it' => '',
        'Itilde' => 'Ĩ',
        'itilde' => 'ĩ',
        'Iukcy' => 'І',
        'iukcy' => 'і',
        'Iuml' => 'Ï',
        'Ium' => 'Ï',
        'iuml' => 'ï',
        'ium' => 'ï',
        'Jcirc' => 'Ĵ',
        'jcirc' => 'ĵ',
        'Jcy' => 'Й',
        'jcy' => 'й',
        'Jfr' => '𝔍',
        'jfr' => '𝔧',
        'jmath' => 'ȷ',
        'Jopf' => '𝕁',
        'jopf' => '𝕛',
        'Jscr' => '𝒥',
        'jscr' => '𝒿',
        'Jsercy' => 'Ј',
        'jsercy' => 'ј',
        'Jukcy' => 'Є',
        'jukcy' => 'є',
        'Kappa' => 'Κ',
        'kappa' => 'κ',
        'kappav' => 'ϰ',
        'Kcedil' => 'Ķ',
        'kcedil' => 'ķ',
        'Kcy' => 'К',
        'kcy' => 'к',
        'Kfr' => '𝔎',
        'kfr' => '𝔨',
        'kgreen' => 'ĸ',
        'KHcy' => 'Х',
        'khcy' => 'х',
        'KJcy' => 'Ќ',
        'kjcy' => 'ќ',
        'Kopf' => '𝕂',
        'kopf' => '𝕜',
        'Kscr' => '𝒦',
        'kscr' => '𝓀',
        'lAarr' => '⇚',
        'Lacute' => 'Ĺ',
        'lacute' => 'ĺ',
        'laemptyv' => '⦴',
        'lagran' => 'ℒ',
        'Lambda' => 'Λ',
        'lambda' => 'λ',
        'Lang' => '⟪',
        'lang' => '⟨',
        'langd' => '⦑',
        'langle' => '⟨',
        'lap' => '⪅',
        'Laplacetrf' => 'ℒ',
        'laquo' => '«',
        'laqu' => '«',
        'Larr' => '↞',
        'lArr' => '⇐',
        'larr' => '←',
        'larrb' => '⇤',
        'larrbfs' => '⤟',
        'larrfs' => '⤝',
        'larrhk' => '↩',
        'larrlp' => '↫',
        'larrpl' => '⤹',
        'larrsim' => '⥳',
        'larrtl' => '↢',
        'lat' => '⪫',
        'lAtail' => '⤛',
        'latail' => '⤙',
        'late' => '⪭',
        'lates' => '⪭',
        'lBarr' => '⤎',
        'lbarr' => '⤌',
        'lbbrk' => '❲',
        'lbrace' => '{',
        'lbrack' => '[',
        'lbrke' => '⦋',
        'lbrksld' => '⦏',
        'lbrkslu' => '⦍',
        'Lcaron' => 'Ľ',
        'lcaron' => 'ľ',
        'Lcedil' => 'Ļ',
        'lcedil' => 'ļ',
        'lceil' => '⌈',
        'lcub' => '{',
        'Lcy' => 'Л',
        'lcy' => 'л',
        'ldca' => '⤶',
        'ldquo' => '“',
        'ldquor' => '„',
        'ldrdhar' => '⥧',
        'ldrushar' => '⥋',
        'ldsh' => '↲',
        'lE' => '≦',
        'le' => '≤',
        'LeftAngleBracket' => '⟨',
        'LeftArrow' => '←',
        'Leftarrow' => '⇐',
        'leftarrow' => '←',
        'LeftArrowBar' => '⇤',
        'LeftArrowRightArrow' => '⇆',
        'leftarrowtail' => '↢',
        'LeftCeiling' => '⌈',
        'LeftDoubleBracket' => '⟦',
        'LeftDownTeeVector' => '⥡',
        'LeftDownVector' => '⇃',
        'LeftDownVectorBar' => '⥙',
        'LeftFloor' => '⌊',
        'leftharpoondown' => '↽',
        'leftharpoonup' => '↼',
        'leftleftarrows' => '⇇',
        'LeftRightArrow' => '↔',
        'Leftrightarrow' => '⇔',
        'leftrightarrow' => '↔',
        'leftrightarrows' => '⇆',
        'leftrightharpoons' => '⇋',
        'leftrightsquigarrow' => '↭',
        'LeftRightVector' => '⥎',
        'LeftTee' => '⊣',
        'LeftTeeArrow' => '↤',
        'LeftTeeVector' => '⥚',
        'leftthreetimes' => '⋋',
        'LeftTriangle' => '⊲',
        'LeftTriangleBar' => '⧏',
        'LeftTriangleEqual' => '⊴',
        'LeftUpDownVector' => '⥑',
        'LeftUpTeeVector' => '⥠',
        'LeftUpVector' => '↿',
        'LeftUpVectorBar' => '⥘',
        'LeftVector' => '↼',
        'LeftVectorBar' => '⥒',
        'lEg' => '⪋',
        'leg' => '⋚',
        'leq' => '≤',
        'leqq' => '≦',
        'leqslant' => '⩽',
        'les' => '⩽',
        'lescc' => '⪨',
        'lesdot' => '⩿',
        'lesdoto' => '⪁',
        'lesdotor' => '⪃',
        'lesg' => '⋚',
        'lesges' => '⪓',
        'lessapprox' => '⪅',
        'lessdot' => '⋖',
        'lesseqgtr' => '⋚',
        'lesseqqgtr' => '⪋',
        'LessEqualGreater' => '⋚',
        'LessFullEqual' => '≦',
        'LessGreater' => '≶',
        'lessgtr' => '≶',
        'LessLess' => '⪡',
        'lesssim' => '≲',
        'LessSlantEqual' => '⩽',
        'LessTilde' => '≲',
        'lfisht' => '⥼',
        'lfloor' => '⌊',
        'Lfr' => '𝔏',
        'lfr' => '𝔩',
        'lg' => '≶',
        'lgE' => '⪑',
        'lHar' => '⥢',
        'lhard' => '↽',
        'lharu' => '↼',
        'lharul' => '⥪',
        'lhblk' => '▄',
        'LJcy' => 'Љ',
        'ljcy' => 'љ',
        'Ll' => '⋘',
        'll' => '≪',
        'llarr' => '⇇',
        'llcorner' => '⌞',
        'Lleftarrow' => '⇚',
        'llhard' => '⥫',
        'lltri' => '◺',
        'Lmidot' => 'Ŀ',
        'lmidot' => 'ŀ',
        'lmoust' => '⎰',
        'lmoustache' => '⎰',
        'lnap' => '⪉',
        'lnapprox' => '⪉',
        'lnE' => '≨',
        'lne' => '⪇',
        'lneq' => '⪇',
        'lneqq' => '≨',
        'lnsim' => '⋦',
        'loang' => '⟬',
        'loarr' => '⇽',
        'lobrk' => '⟦',
        'LongLeftArrow' => '⟵',
        'Longleftarrow' => '⟸',
        'longleftarrow' => '⟵',
        'LongLeftRightArrow' => '⟷',
        'Longleftrightarrow' => '⟺',
        'longleftrightarrow' => '⟷',
        'longmapsto' => '⟼',
        'LongRightArrow' => '⟶',
        'Longrightarrow' => '⟹',
        'longrightarrow' => '⟶',
        'looparrowleft' => '↫',
        'looparrowright' => '↬',
        'lopar' => '⦅',
        'Lopf' => '𝕃',
        'lopf' => '𝕝',
        'loplus' => '⨭',
        'lotimes' => '⨴',
        'lowast' => '∗',
        'lowbar' => '_',
        'LowerLeftArrow' => '↙',
        'LowerRightArrow' => '↘',
        'loz' => '◊',
        'lozenge' => '◊',
        'lozf' => '⧫',
        'lpar' => '(',
        'lparlt' => '⦓',
        'lrarr' => '⇆',
        'lrcorner' => '⌟',
        'lrhar' => '⇋',
        'lrhard' => '⥭',
        'lrm' => '',
        'lrtri' => '⊿',
        'lsaquo' => '‹',
        'Lscr' => 'ℒ',
        'lscr' => '𝓁',
        'Lsh' => '↰',
        'lsh' => '↰',
        'lsim' => '≲',
        'lsime' => '⪍',
        'lsimg' => '⪏',
        'lsqb' => '[',
        'lsquo' => '‘',
        'lsquor' => '‚',
        'Lstrok' => 'Ł',
        'lstrok' => 'ł',
        'LT' => '<',
        'L' => '<',
        'Lt' => '≪',
        'lt' => '<',
        'l' => '<',
        'ltcc' => '⪦',
        'ltcir' => '⩹',
        'ltdot' => '⋖',
        'lthree' => '⋋',
        'ltimes' => '⋉',
        'ltlarr' => '⥶',
        'ltquest' => '⩻',
        'ltri' => '◃',
        'ltrie' => '⊴',
        'ltrif' => '◂',
        'ltrPar' => '⦖',
        'lurdshar' => '⥊',
        'luruhar' => '⥦',
        'lvertneqq' => '≨',
        'lvnE' => '≨',
        'macr' => '¯',
        'mac' => '¯',
        'male' => '♂',
        'malt' => '✠',
        'maltese' => '✠',
        'Map' => '⤅',
        'map' => '↦',
        'mapsto' => '↦',
        'mapstodown' => '↧',
        'mapstoleft' => '↤',
        'mapstoup' => '↥',
        'marker' => '▮',
        'mcomma' => '⨩',
        'Mcy' => 'М',
        'mcy' => 'м',
        'mdash' => '—',
        'mDDot' => '∺',
        'measuredangle' => '∡',
        'MediumSpace' => ' ',
        'Mellintrf' => 'ℳ',
        'Mfr' => '𝔐',
        'mfr' => '𝔪',
        'mho' => '℧',
        'micro' => 'µ',
        'micr' => 'µ',
        'mid' => '∣',
        'midast' => '*',
        'midcir' => '⫰',
        'middot' => '·',
        'middo' => '·',
        'minus' => '−',
        'minusb' => '⊟',
        'minusd' => '∸',
        'minusdu' => '⨪',
        'MinusPlus' => '∓',
        'mlcp' => '⫛',
        'mldr' => '…',
        'mnplus' => '∓',
        'models' => '⊧',
        'Mopf' => '𝕄',
        'mopf' => '𝕞',
        'mp' => '∓',
        'Mscr' => 'ℳ',
        'mscr' => '𝓂',
        'mstpos' => '∾',
        'Mu' => 'Μ',
        'mu' => 'μ',
        'multimap' => '⊸',
        'mumap' => '⊸',
        'nabla' => '∇',
        'Nacute' => 'Ń',
        'nacute' => 'ń',
        'nang' => '∠⃒',
        'nap' => '≉',
        'napE' => '⩰̸',
        'napid' => '≋̸',
        'napos' => 'ŉ',
        'napprox' => '≉',
        'natur' => '♮',
        'natural' => '♮',
        'naturals' => 'ℕ',
        'nbsp' => ' ',
        'nbs' => ' ',
        'nbump' => '≎̸',
        'nbumpe' => '≏̸',
        'ncap' => '⩃',
        'Ncaron' => 'Ň',
        'ncaron' => 'ň',
        'Ncedil' => 'Ņ',
        'ncedil' => 'ņ',
        'ncong' => '≇',
        'ncongdot' => '⩭̸',
        'ncup' => '⩂',
        'Ncy' => 'Н',
        'ncy' => 'н',
        'ndash' => '–',
        'ne' => '≠',
        'nearhk' => '⤤',
        'neArr' => '⇗',
        'nearr' => '↗',
        'nearrow' => '↗',
        'nedot' => '≐̸',
        'NegativeMediumSpace' => '',
        'NegativeThickSpace' => '',
        'NegativeThinSpace' => '',
        'NegativeVeryThinSpace' => '',
        'nequiv' => '≢',
        'nesear' => '⤨',
        'nesim' => '≂̸',
        'NestedGreaterGreater' => '≫',
        'NestedLessLess' => '≪',
        'NewLine' => '
',
        'nexist' => '∄',
        'nexists' => '∄',
        'Nfr' => '𝔑',
        'nfr' => '𝔫',
        'ngE' => '≧̸',
        'nge' => '≱',
        'ngeq' => '≱',
        'ngeqq' => '≧̸',
        'ngeqslant' => '⩾̸',
        'nges' => '⩾̸',
        'nGg' => '⋙̸',
        'ngsim' => '≵',
        'nGt' => '≫⃒',
        'ngt' => '≯',
        'ngtr' => '≯',
        'nGtv' => '≫̸',
        'nhArr' => '⇎',
        'nharr' => '↮',
        'nhpar' => '⫲',
        'ni' => '∋',
        'nis' => '⋼',
        'nisd' => '⋺',
        'niv' => '∋',
        'NJcy' => 'Њ',
        'njcy' => 'њ',
        'nlArr' => '⇍',
        'nlarr' => '↚',
        'nldr' => '‥',
        'nlE' => '≦̸',
        'nle' => '≰',
        'nLeftarrow' => '⇍',
        'nleftarrow' => '↚',
        'nLeftrightarrow' => '⇎',
        'nleftrightarrow' => '↮',
        'nleq' => '≰',
        'nleqq' => '≦̸',
        'nleqslant' => '⩽̸',
        'nles' => '⩽̸',
        'nless' => '≮',
        'nLl' => '⋘̸',
        'nlsim' => '≴',
        'nLt' => '≪⃒',
        'nlt' => '≮',
        'nltri' => '⋪',
        'nltrie' => '⋬',
        'nLtv' => '≪̸',
        'nmid' => '∤',
        'NoBreak' => '',
        'NonBreakingSpace' => ' ',
        'Nopf' => 'ℕ',
        'nopf' => '𝕟',
        'Not' => '⫬',
        'not' => '¬',
        'no' => '¬',
        'NotCongruent' => '≢',
        'NotCupCap' => '≭',
        'NotDoubleVerticalBar' => '∦',
        'NotElement' => '∉',
        'NotEqual' => '≠',
        'NotEqualTilde' => '≂̸',
        'NotExists' => '∄',
        'NotGreater' => '≯',
        'NotGreaterEqual' => '≱',
        'NotGreaterFullEqual' => '≧̸',
        'NotGreaterGreater' => '≫̸',
        'NotGreaterLess' => '≹',
        'NotGreaterSlantEqual' => '⩾̸',
        'NotGreaterTilde' => '≵',
        'NotHumpDownHump' => '≎̸',
        'NotHumpEqual' => '≏̸',
        'notin' => '∉',
        'notindot' => '⋵̸',
        'notinE' => '⋹̸',
        'notinva' => '∉',
        'notinvb' => '⋷',
        'notinvc' => '⋶',
        'NotLeftTriangle' => '⋪',
        'NotLeftTriangleBar' => '⧏̸',
        'NotLeftTriangleEqual' => '⋬',
        'NotLess' => '≮',
        'NotLessEqual' => '≰',
        'NotLessGreater' => '≸',
        'NotLessLess' => '≪̸',
        'NotLessSlantEqual' => '⩽̸',
        'NotLessTilde' => '≴',
        'NotNestedGreaterGreater' => '⪢̸',
        'NotNestedLessLess' => '⪡̸',
        'notni' => '∌',
        'notniva' => '∌',
        'notnivb' => '⋾',
        'notnivc' => '⋽',
        'NotPrecedes' => '⊀',
        'NotPrecedesEqual' => '⪯̸',
        'NotPrecedesSlantEqual' => '⋠',
        'NotReverseElement' => '∌',
        'NotRightTriangle' => '⋫',
        'NotRightTriangleBar' => '⧐̸',
        'NotRightTriangleEqual' => '⋭',
        'NotSquareSubset' => '⊏̸',
        'NotSquareSubsetEqual' => '⋢',
        'NotSquareSuperset' => '⊐̸',
        'NotSquareSupersetEqual' => '⋣',
        'NotSubset' => '⊂⃒',
        'NotSubsetEqual' => '⊈',
        'NotSucceeds' => '⊁',
        'NotSucceedsEqual' => '⪰̸',
        'NotSucceedsSlantEqual' => '⋡',
        'NotSucceedsTilde' => '≿̸',
        'NotSuperset' => '⊃⃒',
        'NotSupersetEqual' => '⊉',
        'NotTilde' => '≁',
        'NotTildeEqual' => '≄',
        'NotTildeFullEqual' => '≇',
        'NotTildeTilde' => '≉',
        'NotVerticalBar' => '∤',
        'npar' => '∦',
        'nparallel' => '∦',
        'nparsl' => '⫽⃥',
        'npart' => '∂̸',
        'npolint' => '⨔',
        'npr' => '⊀',
        'nprcue' => '⋠',
        'npre' => '⪯̸',
        'nprec' => '⊀',
        'npreceq' => '⪯̸',
        'nrArr' => '⇏',
        'nrarr' => '↛',
        'nrarrc' => '⤳̸',
        'nrarrw' => '↝̸',
        'nRightarrow' => '⇏',
        'nrightarrow' => '↛',
        'nrtri' => '⋫',
        'nrtrie' => '⋭',
        'nsc' => '⊁',
        'nsccue' => '⋡',
        'nsce' => '⪰̸',
        'Nscr' => '𝒩',
        'nscr' => '𝓃',
        'nshortmid' => '∤',
        'nshortparallel' => '∦',
        'nsim' => '≁',
        'nsime' => '≄',
        'nsimeq' => '≄',
        'nsmid' => '∤',
        'nspar' => '∦',
        'nsqsube' => '⋢',
        'nsqsupe' => '⋣',
        'nsub' => '⊄',
        'nsubE' => '⫅̸',
        'nsube' => '⊈',
        'nsubset' => '⊂⃒',
        'nsubseteq' => '⊈',
        'nsubseteqq' => '⫅̸',
        'nsucc' => '⊁',
        'nsucceq' => '⪰̸',
        'nsup' => '⊅',
        'nsupE' => '⫆̸',
        'nsupe' => '⊉',
        'nsupset' => '⊃⃒',
        'nsupseteq' => '⊉',
        'nsupseteqq' => '⫆̸',
        'ntgl' => '≹',
        'Ntilde' => 'Ñ',
        'Ntild' => 'Ñ',
        'ntilde' => 'ñ',
        'ntild' => 'ñ',
        'ntlg' => '≸',
        'ntriangleleft' => '⋪',
        'ntrianglelefteq' => '⋬',
        'ntriangleright' => '⋫',
        'ntrianglerighteq' => '⋭',
        'Nu' => 'Ν',
        'nu' => 'ν',
        'num' => '#',
        'numero' => '№',
        'numsp' => ' ',
        'nvap' => '≍⃒',
        'nVDash' => '⊯',
        'nVdash' => '⊮',
        'nvDash' => '⊭',
        'nvdash' => '⊬',
        'nvge' => '≥⃒',
        'nvgt' => '>⃒',
        'nvHarr' => '⤄',
        'nvinfin' => '⧞',
        'nvlArr' => '⤂',
        'nvle' => '≤⃒',
        'nvlt' => '<⃒',
        'nvltrie' => '⊴⃒',
        'nvrArr' => '⤃',
        'nvrtrie' => '⊵⃒',
        'nvsim' => '∼⃒',
        'nwarhk' => '⤣',
        'nwArr' => '⇖',
        'nwarr' => '↖',
        'nwarrow' => '↖',
        'nwnear' => '⤧',
        'Oacute' => 'Ó',
        'Oacut' => 'Ó',
        'oacute' => 'ó',
        'oacut' => 'ó',
        'oast' => '⊛',
        'ocir' => 'ô',
        'Ocirc' => 'Ô',
        'Ocir' => 'Ô',
        'ocirc' => 'ô',
        'Ocy' => 'О',
        'ocy' => 'о',
        'odash' => '⊝',
        'Odblac' => 'Ő',
        'odblac' => 'ő',
        'odiv' => '⨸',
        'odot' => '⊙',
        'odsold' => '⦼',
        'OElig' => 'Œ',
        'oelig' => 'œ',
        'ofcir' => '⦿',
        'Ofr' => '𝔒',
        'ofr' => '𝔬',
        'ogon' => '˛',
        'Ograve' => 'Ò',
        'Ograv' => 'Ò',
        'ograve' => 'ò',
        'ograv' => 'ò',
        'ogt' => '⧁',
        'ohbar' => '⦵',
        'ohm' => 'Ω',
        'oint' => '∮',
        'olarr' => '↺',
        'olcir' => '⦾',
        'olcross' => '⦻',
        'oline' => '‾',
        'olt' => '⧀',
        'Omacr' => 'Ō',
        'omacr' => 'ō',
        'Omega' => 'Ω',
        'omega' => 'ω',
        'Omicron' => 'Ο',
        'omicron' => 'ο',
        'omid' => '⦶',
        'ominus' => '⊖',
        'Oopf' => '𝕆',
        'oopf' => '𝕠',
        'opar' => '⦷',
        'OpenCurlyDoubleQuote' => '“',
        'OpenCurlyQuote' => '‘',
        'operp' => '⦹',
        'oplus' => '⊕',
        'Or' => '⩔',
        'or' => '∨',
        'orarr' => '↻',
        'ord' => 'º',
        'order' => 'ℴ',
        'orderof' => 'ℴ',
        'ordf' => 'ª',
        'ordm' => 'º',
        'origof' => '⊶',
        'oror' => '⩖',
        'orslope' => '⩗',
        'orv' => '⩛',
        'oS' => 'Ⓢ',
        'Oscr' => '𝒪',
        'oscr' => 'ℴ',
        'Oslash' => 'Ø',
        'Oslas' => 'Ø',
        'oslash' => 'ø',
        'oslas' => 'ø',
        'osol' => '⊘',
        'Otilde' => 'Õ',
        'Otild' => 'Õ',
        'otilde' => 'õ',
        'otild' => 'õ',
        'Otimes' => '⨷',
        'otimes' => '⊗',
        'otimesas' => '⨶',
        'Ouml' => 'Ö',
        'Oum' => 'Ö',
        'ouml' => 'ö',
        'oum' => 'ö',
        'ovbar' => '⌽',
        'OverBar' => '‾',
        'OverBrace' => '⏞',
        'OverBracket' => '⎴',
        'OverParenthesis' => '⏜',
        'par' => '¶',
        'para' => '¶',
        'parallel' => '∥',
        'parsim' => '⫳',
        'parsl' => '⫽',
        'part' => '∂',
        'PartialD' => '∂',
        'Pcy' => 'П',
        'pcy' => 'п',
        'percnt' => '%',
        'period' => '.',
        'permil' => '‰',
        'perp' => '⊥',
        'pertenk' => '‱',
        'Pfr' => '𝔓',
        'pfr' => '𝔭',
        'Phi' => 'Φ',
        'phi' => 'φ',
        'phiv' => 'ϕ',
        'phmmat' => 'ℳ',
        'phone' => '☎',
        'Pi' => 'Π',
        'pi' => 'π',
        'pitchfork' => '⋔',
        'piv' => 'ϖ',
        'planck' => 'ℏ',
        'planckh' => 'ℎ',
        'plankv' => 'ℏ',
        'plus' => '+',
        'plusacir' => '⨣',
        'plusb' => '⊞',
        'pluscir' => '⨢',
        'plusdo' => '∔',
        'plusdu' => '⨥',
        'pluse' => '⩲',
        'PlusMinus' => '±',
        'plusmn' => '±',
        'plusm' => '±',
        'plussim' => '⨦',
        'plustwo' => '⨧',
        'pm' => '±',
        'Poincareplane' => 'ℌ',
        'pointint' => '⨕',
        'Popf' => 'ℙ',
        'popf' => '𝕡',
        'pound' => '£',
        'poun' => '£',
        'Pr' => '⪻',
        'pr' => '≺',
        'prap' => '⪷',
        'prcue' => '≼',
        'prE' => '⪳',
        'pre' => '⪯',
        'prec' => '≺',
        'precapprox' => '⪷',
        'preccurlyeq' => '≼',
        'Precedes' => '≺',
        'PrecedesEqual' => '⪯',
        'PrecedesSlantEqual' => '≼',
        'PrecedesTilde' => '≾',
        'preceq' => '⪯',
        'precnapprox' => '⪹',
        'precneqq' => '⪵',
        'precnsim' => '⋨',
        'precsim' => '≾',
        'Prime' => '″',
        'prime' => '′',
        'primes' => 'ℙ',
        'prnap' => '⪹',
        'prnE' => '⪵',
        'prnsim' => '⋨',
        'prod' => '∏',
        'Product' => '∏',
        'profalar' => '⌮',
        'profline' => '⌒',
        'profsurf' => '⌓',
        'prop' => '∝',
        'Proportion' => '∷',
        'Proportional' => '∝',
        'propto' => '∝',
        'prsim' => '≾',
        'prurel' => '⊰',
        'Pscr' => '𝒫',
        'pscr' => '𝓅',
        'Psi' => 'Ψ',
        'psi' => 'ψ',
        'puncsp' => ' ',
        'Qfr' => '𝔔',
        'qfr' => '𝔮',
        'qint' => '⨌',
        'Qopf' => 'ℚ',
        'qopf' => '𝕢',
        'qprime' => '⁗',
        'Qscr' => '𝒬',
        'qscr' => '𝓆',
        'quaternions' => 'ℍ',
        'quatint' => '⨖',
        'quest' => '?',
        'questeq' => '≟',
        'QUOT' => '"',
        'QUO' => '"',
        'quot' => '"',
        'quo' => '"',
        'rAarr' => '⇛',
        'race' => '∽̱',
        'Racute' => 'Ŕ',
        'racute' => 'ŕ',
        'radic' => '√',
        'raemptyv' => '⦳',
        'Rang' => '⟫',
        'rang' => '⟩',
        'rangd' => '⦒',
        'range' => '⦥',
        'rangle' => '⟩',
        'raquo' => '»',
        'raqu' => '»',
        'Rarr' => '↠',
        'rArr' => '⇒',
        'rarr' => '→',
        'rarrap' => '⥵',
        'rarrb' => '⇥',
        'rarrbfs' => '⤠',
        'rarrc' => '⤳',
        'rarrfs' => '⤞',
        'rarrhk' => '↪',
        'rarrlp' => '↬',
        'rarrpl' => '⥅',
        'rarrsim' => '⥴',
        'Rarrtl' => '⤖',
        'rarrtl' => '↣',
        'rarrw' => '↝',
        'rAtail' => '⤜',
        'ratail' => '⤚',
        'ratio' => '∶',
        'rationals' => 'ℚ',
        'RBarr' => '⤐',
        'rBarr' => '⤏',
        'rbarr' => '⤍',
        'rbbrk' => '❳',
        'rbrace' => '}',
        'rbrack' => ']',
        'rbrke' => '⦌',
        'rbrksld' => '⦎',
        'rbrkslu' => '⦐',
        'Rcaron' => 'Ř',
        'rcaron' => 'ř',
        'Rcedil' => 'Ŗ',
        'rcedil' => 'ŗ',
        'rceil' => '⌉',
        'rcub' => '}',
        'Rcy' => 'Р',
        'rcy' => 'р',
        'rdca' => '⤷',
        'rdldhar' => '⥩',
        'rdquo' => '”',
        'rdquor' => '”',
        'rdsh' => '↳',
        'Re' => 'ℜ',
        'real' => 'ℜ',
        'realine' => 'ℛ',
        'realpart' => 'ℜ',
        'reals' => 'ℝ',
        'rect' => '▭',
        'REG' => '®',
        'RE' => '®',
        'reg' => '®',
        're' => '®',
        'ReverseElement' => '∋',
        'ReverseEquilibrium' => '⇋',
        'ReverseUpEquilibrium' => '⥯',
        'rfisht' => '⥽',
        'rfloor' => '⌋',
        'Rfr' => 'ℜ',
        'rfr' => '𝔯',
        'rHar' => '⥤',
        'rhard' => '⇁',
        'rharu' => '⇀',
        'rharul' => '⥬',
        'Rho' => 'Ρ',
        'rho' => 'ρ',
        'rhov' => 'ϱ',
        'RightAngleBracket' => '⟩',
        'RightArrow' => '→',
        'Rightarrow' => '⇒',
        'rightarrow' => '→',
        'RightArrowBar' => '⇥',
        'RightArrowLeftArrow' => '⇄',
        'rightarrowtail' => '↣',
        'RightCeiling' => '⌉',
        'RightDoubleBracket' => '⟧',
        'RightDownTeeVector' => '⥝',
        'RightDownVector' => '⇂',
        'RightDownVectorBar' => '⥕',
        'RightFloor' => '⌋',
        'rightharpoondown' => '⇁',
        'rightharpoonup' => '⇀',
        'rightleftarrows' => '⇄',
        'rightleftharpoons' => '⇌',
        'rightrightarrows' => '⇉',
        'rightsquigarrow' => '↝',
        'RightTee' => '⊢',
        'RightTeeArrow' => '↦',
        'RightTeeVector' => '⥛',
        'rightthreetimes' => '⋌',
        'RightTriangle' => '⊳',
        'RightTriangleBar' => '⧐',
        'RightTriangleEqual' => '⊵',
        'RightUpDownVector' => '⥏',
        'RightUpTeeVector' => '⥜',
        'RightUpVector' => '↾',
        'RightUpVectorBar' => '⥔',
        'RightVector' => '⇀',
        'RightVectorBar' => '⥓',
        'ring' => '˚',
        'risingdotseq' => '≓',
        'rlarr' => '⇄',
        'rlhar' => '⇌',
        'rlm' => '',
        'rmoust' => '⎱',
        'rmoustache' => '⎱',
        'rnmid' => '⫮',
        'roang' => '⟭',
        'roarr' => '⇾',
        'robrk' => '⟧',
        'ropar' => '⦆',
        'Ropf' => 'ℝ',
        'ropf' => '𝕣',
        'roplus' => '⨮',
        'rotimes' => '⨵',
        'RoundImplies' => '⥰',
        'rpar' => ')',
        'rpargt' => '⦔',
        'rppolint' => '⨒',
        'rrarr' => '⇉',
        'Rrightarrow' => '⇛',
        'rsaquo' => '›',
        'Rscr' => 'ℛ',
        'rscr' => '𝓇',
        'Rsh' => '↱',
        'rsh' => '↱',
        'rsqb' => ']',
        'rsquo' => '’',
        'rsquor' => '’',
        'rthree' => '⋌',
        'rtimes' => '⋊',
        'rtri' => '▹',
        'rtrie' => '⊵',
        'rtrif' => '▸',
        'rtriltri' => '⧎',
        'RuleDelayed' => '⧴',
        'ruluhar' => '⥨',
        'rx' => '℞',
        'Sacute' => 'Ś',
        'sacute' => 'ś',
        'sbquo' => '‚',
        'Sc' => '⪼',
        'sc' => '≻',
        'scap' => '⪸',
        'Scaron' => 'Š',
        'scaron' => 'š',
        'sccue' => '≽',
        'scE' => '⪴',
        'sce' => '⪰',
        'Scedil' => 'Ş',
        'scedil' => 'ş',
        'Scirc' => 'Ŝ',
        'scirc' => 'ŝ',
        'scnap' => '⪺',
        'scnE' => '⪶',
        'scnsim' => '⋩',
        'scpolint' => '⨓',
        'scsim' => '≿',
        'Scy' => 'С',
        'scy' => 'с',
        'sdot' => '⋅',
        'sdotb' => '⊡',
        'sdote' => '⩦',
        'searhk' => '⤥',
        'seArr' => '⇘',
        'searr' => '↘',
        'searrow' => '↘',
        'sect' => '§',
        'sec' => '§',
        'semi' => ';',
        'seswar' => '⤩',
        'setminus' => '∖',
        'setmn' => '∖',
        'sext' => '✶',
        'Sfr' => '𝔖',
        'sfr' => '𝔰',
        'sfrown' => '⌢',
        'sharp' => '♯',
        'SHCHcy' => 'Щ',
        'shchcy' => 'щ',
        'SHcy' => 'Ш',
        'shcy' => 'ш',
        'ShortDownArrow' => '↓',
        'ShortLeftArrow' => '←',
        'shortmid' => '∣',
        'shortparallel' => '∥',
        'ShortRightArrow' => '→',
        'ShortUpArrow' => '↑',
        'shy' => '',
        'sh' => '',
        'Sigma' => 'Σ',
        'sigma' => 'σ',
        'sigmaf' => 'ς',
        'sigmav' => 'ς',
        'sim' => '∼',
        'simdot' => '⩪',
        'sime' => '≃',
        'simeq' => '≃',
        'simg' => '⪞',
        'simgE' => '⪠',
        'siml' => '⪝',
        'simlE' => '⪟',
        'simne' => '≆',
        'simplus' => '⨤',
        'simrarr' => '⥲',
        'slarr' => '←',
        'SmallCircle' => '∘',
        'smallsetminus' => '∖',
        'smashp' => '⨳',
        'smeparsl' => '⧤',
        'smid' => '∣',
        'smile' => '⌣',
        'smt' => '⪪',
        'smte' => '⪬',
        'smtes' => '⪬',
        'SOFTcy' => 'Ь',
        'softcy' => 'ь',
        'sol' => '/',
        'solb' => '⧄',
        'solbar' => '⌿',
        'Sopf' => '𝕊',
        'sopf' => '𝕤',
        'spades' => '♠',
        'spadesuit' => '♠',
        'spar' => '∥',
        'sqcap' => '⊓',
        'sqcaps' => '⊓',
        'sqcup' => '⊔',
        'sqcups' => '⊔',
        'Sqrt' => '√',
        'sqsub' => '⊏',
        'sqsube' => '⊑',
        'sqsubset' => '⊏',
        'sqsubseteq' => '⊑',
        'sqsup' => '⊐',
        'sqsupe' => '⊒',
        'sqsupset' => '⊐',
        'sqsupseteq' => '⊒',
        'squ' => '□',
        'Square' => '□',
        'square' => '□',
        'SquareIntersection' => '⊓',
        'SquareSubset' => '⊏',
        'SquareSubsetEqual' => '⊑',
        'SquareSuperset' => '⊐',
        'SquareSupersetEqual' => '⊒',
        'SquareUnion' => '⊔',
        'squarf' => '▪',
        'squf' => '▪',
        'srarr' => '→',
        'Sscr' => '𝒮',
        'sscr' => '𝓈',
        'ssetmn' => '∖',
        'ssmile' => '⌣',
        'sstarf' => '⋆',
        'Star' => '⋆',
        'star' => '☆',
        'starf' => '★',
        'straightepsilon' => 'ϵ',
        'straightphi' => 'ϕ',
        'strns' => '¯',
        'Sub' => '⋐',
        'sub' => '⊂',
        'subdot' => '⪽',
        'subE' => '⫅',
        'sube' => '⊆',
        'subedot' => '⫃',
        'submult' => '⫁',
        'subnE' => '⫋',
        'subne' => '⊊',
        'subplus' => '⪿',
        'subrarr' => '⥹',
        'Subset' => '⋐',
        'subset' => '⊂',
        'subseteq' => '⊆',
        'subseteqq' => '⫅',
        'SubsetEqual' => '⊆',
        'subsetneq' => '⊊',
        'subsetneqq' => '⫋',
        'subsim' => '⫇',
        'subsub' => '⫕',
        'subsup' => '⫓',
        'succ' => '≻',
        'succapprox' => '⪸',
        'succcurlyeq' => '≽',
        'Succeeds' => '≻',
        'SucceedsEqual' => '⪰',
        'SucceedsSlantEqual' => '≽',
        'SucceedsTilde' => '≿',
        'succeq' => '⪰',
        'succnapprox' => '⪺',
        'succneqq' => '⪶',
        'succnsim' => '⋩',
        'succsim' => '≿',
        'SuchThat' => '∋',
        'Sum' => '∑',
        'sum' => '∑',
        'sung' => '♪',
        'Sup' => '⋑',
        'sup' => '³',
        'sup1' => '¹',
        'sup2' => '²',
        'sup3' => '³',
        'supdot' => '⪾',
        'supdsub' => '⫘',
        'supE' => '⫆',
        'supe' => '⊇',
        'supedot' => '⫄',
        'Superset' => '⊃',
        'SupersetEqual' => '⊇',
        'suphsol' => '⟉',
        'suphsub' => '⫗',
        'suplarr' => '⥻',
        'supmult' => '⫂',
        'supnE' => '⫌',
        'supne' => '⊋',
        'supplus' => '⫀',
        'Supset' => '⋑',
        'supset' => '⊃',
        'supseteq' => '⊇',
        'supseteqq' => '⫆',
        'supsetneq' => '⊋',
        'supsetneqq' => '⫌',
        'supsim' => '⫈',
        'supsub' => '⫔',
        'supsup' => '⫖',
        'swarhk' => '⤦',
        'swArr' => '⇙',
        'swarr' => '↙',
        'swarrow' => '↙',
        'swnwar' => '⤪',
        'szlig' => 'ß',
        'szli' => 'ß',
        'Tab' => '	',
        'target' => '⌖',
        'Tau' => 'Τ',
        'tau' => 'τ',
        'tbrk' => '⎴',
        'Tcaron' => 'Ť',
        'tcaron' => 'ť',
        'Tcedil' => 'Ţ',
        'tcedil' => 'ţ',
        'Tcy' => 'Т',
        'tcy' => 'т',
        'tdot' => '⃛',
        'telrec' => '⌕',
        'Tfr' => '𝔗',
        'tfr' => '𝔱',
        'there4' => '∴',
        'Therefore' => '∴',
        'therefore' => '∴',
        'Theta' => 'Θ',
        'theta' => 'θ',
        'thetasym' => 'ϑ',
        'thetav' => 'ϑ',
        'thickapprox' => '≈',
        'thicksim' => '∼',
        'ThickSpace' => '  ',
        'thinsp' => ' ',
        'ThinSpace' => ' ',
        'thkap' => '≈',
        'thksim' => '∼',
        'THORN' => 'Þ',
        'THOR' => 'Þ',
        'thorn' => 'þ',
        'thor' => 'þ',
        'Tilde' => '∼',
        'tilde' => '˜',
        'TildeEqual' => '≃',
        'TildeFullEqual' => '≅',
        'TildeTilde' => '≈',
        'times' => '×',
        'time' => '×',
        'timesb' => '⊠',
        'timesbar' => '⨱',
        'timesd' => '⨰',
        'tint' => '∭',
        'toea' => '⤨',
        'top' => '⊤',
        'topbot' => '⌶',
        'topcir' => '⫱',
        'Topf' => '𝕋',
        'topf' => '𝕥',
        'topfork' => '⫚',
        'tosa' => '⤩',
        'tprime' => '‴',
        'TRADE' => '™',
        'trade' => '™',
        'triangle' => '▵',
        'triangledown' => '▿',
        'triangleleft' => '◃',
        'trianglelefteq' => '⊴',
        'triangleq' => '≜',
        'triangleright' => '▹',
        'trianglerighteq' => '⊵',
        'tridot' => '◬',
        'trie' => '≜',
        'triminus' => '⨺',
        'TripleDot' => '⃛',
        'triplus' => '⨹',
        'trisb' => '⧍',
        'tritime' => '⨻',
        'trpezium' => '⏢',
        'Tscr' => '𝒯',
        'tscr' => '𝓉',
        'TScy' => 'Ц',
        'tscy' => 'ц',
        'TSHcy' => 'Ћ',
        'tshcy' => 'ћ',
        'Tstrok' => 'Ŧ',
        'tstrok' => 'ŧ',
        'twixt' => '≬',
        'twoheadleftarrow' => '↞',
        'twoheadrightarrow' => '↠',
        'Uacute' => 'Ú',
        'Uacut' => 'Ú',
        'uacute' => 'ú',
        'uacut' => 'ú',
        'Uarr' => '↟',
        'uArr' => '⇑',
        'uarr' => '↑',
        'Uarrocir' => '⥉',
        'Ubrcy' => 'Ў',
        'ubrcy' => 'ў',
        'Ubreve' => 'Ŭ',
        'ubreve' => 'ŭ',
        'Ucirc' => 'Û',
        'Ucir' => 'Û',
        'ucirc' => 'û',
        'ucir' => 'û',
        'Ucy' => 'У',
        'ucy' => 'у',
        'udarr' => '⇅',
        'Udblac' => 'Ű',
        'udblac' => 'ű',
        'udhar' => '⥮',
        'ufisht' => '⥾',
        'Ufr' => '𝔘',
        'ufr' => '𝔲',
        'Ugrave' => 'Ù',
        'Ugrav' => 'Ù',
        'ugrave' => 'ù',
        'ugrav' => 'ù',
        'uHar' => '⥣',
        'uharl' => '↿',
        'uharr' => '↾',
        'uhblk' => '▀',
        'ulcorn' => '⌜',
        'ulcorner' => '⌜',
        'ulcrop' => '⌏',
        'ultri' => '◸',
        'Umacr' => 'Ū',
        'umacr' => 'ū',
        'uml' => '¨',
        'um' => '¨',
        'UnderBar' => '_',
        'UnderBrace' => '⏟',
        'UnderBracket' => '⎵',
        'UnderParenthesis' => '⏝',
        'Union' => '⋃',
        'UnionPlus' => '⊎',
        'Uogon' => 'Ų',
        'uogon' => 'ų',
        'Uopf' => '𝕌',
        'uopf' => '𝕦',
        'UpArrow' => '↑',
        'Uparrow' => '⇑',
        'uparrow' => '↑',
        'UpArrowBar' => '⤒',
        'UpArrowDownArrow' => '⇅',
        'UpDownArrow' => '↕',
        'Updownarrow' => '⇕',
        'updownarrow' => '↕',
        'UpEquilibrium' => '⥮',
        'upharpoonleft' => '↿',
        'upharpoonright' => '↾',
        'uplus' => '⊎',
        'UpperLeftArrow' => '↖',
        'UpperRightArrow' => '↗',
        'Upsi' => 'ϒ',
        'upsi' => 'υ',
        'upsih' => 'ϒ',
        'Upsilon' => 'Υ',
        'upsilon' => 'υ',
        'UpTee' => '⊥',
        'UpTeeArrow' => '↥',
        'upuparrows' => '⇈',
        'urcorn' => '⌝',
        'urcorner' => '⌝',
        'urcrop' => '⌎',
        'Uring' => 'Ů',
        'uring' => 'ů',
        'urtri' => '◹',
        'Uscr' => '𝒰',
        'uscr' => '𝓊',
        'utdot' => '⋰',
        'Utilde' => 'Ũ',
        'utilde' => 'ũ',
        'utri' => '▵',
        'utrif' => '▴',
        'uuarr' => '⇈',
        'Uuml' => 'Ü',
        'Uum' => 'Ü',
        'uuml' => 'ü',
        'uum' => 'ü',
        'uwangle' => '⦧',
        'vangrt' => '⦜',
        'varepsilon' => 'ϵ',
        'varkappa' => 'ϰ',
        'varnothing' => '∅',
        'varphi' => 'ϕ',
        'varpi' => 'ϖ',
        'varpropto' => '∝',
        'vArr' => '⇕',
        'varr' => '↕',
        'varrho' => 'ϱ',
        'varsigma' => 'ς',
        'varsubsetneq' => '⊊',
        'varsubsetneqq' => '⫋',
        'varsupsetneq' => '⊋',
        'varsupsetneqq' => '⫌',
        'vartheta' => 'ϑ',
        'vartriangleleft' => '⊲',
        'vartriangleright' => '⊳',
        'Vbar' => '⫫',
        'vBar' => '⫨',
        'vBarv' => '⫩',
        'Vcy' => 'В',
        'vcy' => 'в',
        'VDash' => '⊫',
        'Vdash' => '⊩',
        'vDash' => '⊨',
        'vdash' => '⊢',
        'Vdashl' => '⫦',
        'Vee' => '⋁',
        'vee' => '∨',
        'veebar' => '⊻',
        'veeeq' => '≚',
        'vellip' => '⋮',
        'Verbar' => '‖',
        'verbar' => '|',
        'Vert' => '‖',
        'vert' => '|',
        'VerticalBar' => '∣',
        'VerticalLine' => '|',
        'VerticalSeparator' => '❘',
        'VerticalTilde' => '≀',
        'VeryThinSpace' => ' ',
        'Vfr' => '𝔙',
        'vfr' => '𝔳',
        'vltri' => '⊲',
        'vnsub' => '⊂⃒',
        'vnsup' => '⊃⃒',
        'Vopf' => '𝕍',
        'vopf' => '𝕧',
        'vprop' => '∝',
        'vrtri' => '⊳',
        'Vscr' => '𝒱',
        'vscr' => '𝓋',
        'vsubnE' => '⫋',
        'vsubne' => '⊊',
        'vsupnE' => '⫌',
        'vsupne' => '⊋',
        'Vvdash' => '⊪',
        'vzigzag' => '⦚',
        'Wcirc' => 'Ŵ',
        'wcirc' => 'ŵ',
        'wedbar' => '⩟',
        'Wedge' => '⋀',
        'wedge' => '∧',
        'wedgeq' => '≙',
        'weierp' => '℘',
        'Wfr' => '𝔚',
        'wfr' => '𝔴',
        'Wopf' => '𝕎',
        'wopf' => '𝕨',
        'wp' => '℘',
        'wr' => '≀',
        'wreath' => '≀',
        'Wscr' => '𝒲',
        'wscr' => '𝓌',
        'xcap' => '⋂',
        'xcirc' => '◯',
        'xcup' => '⋃',
        'xdtri' => '▽',
        'Xfr' => '𝔛',
        'xfr' => '𝔵',
        'xhArr' => '⟺',
        'xharr' => '⟷',
        'Xi' => 'Ξ',
        'xi' => 'ξ',
        'xlArr' => '⟸',
        'xlarr' => '⟵',
        'xmap' => '⟼',
        'xnis' => '⋻',
        'xodot' => '⨀',
        'Xopf' => '𝕏',
        'xopf' => '𝕩',
        'xoplus' => '⨁',
        'xotime' => '⨂',
        'xrArr' => '⟹',
        'xrarr' => '⟶',
        'Xscr' => '𝒳',
        'xscr' => '𝓍',
        'xsqcup' => '⨆',
        'xuplus' => '⨄',
        'xutri' => '△',
        'xvee' => '⋁',
        'xwedge' => '⋀',
        'Yacute' => 'Ý',
        'Yacut' => 'Ý',
        'yacute' => 'ý',
        'yacut' => 'ý',
        'YAcy' => 'Я',
        'yacy' => 'я',
        'Ycirc' => 'Ŷ',
        'ycirc' => 'ŷ',
        'Ycy' => 'Ы',
        'ycy' => 'ы',
        'yen' => '¥',
        'ye' => '¥',
        'Yfr' => '𝔜',
        'yfr' => '𝔶',
        'YIcy' => 'Ї',
        'yicy' => 'ї',
        'Yopf' => '𝕐',
        'yopf' => '𝕪',
        'Yscr' => '𝒴',
        'yscr' => '𝓎',
        'YUcy' => 'Ю',
        'yucy' => 'ю',
        'Yuml' => 'Ÿ',
        'yuml' => 'ÿ',
        'yum' => 'ÿ',
        'Zacute' => 'Ź',
        'zacute' => 'ź',
        'Zcaron' => 'Ž',
        'zcaron' => 'ž',
        'Zcy' => 'З',
        'zcy' => 'з',
        'Zdot' => 'Ż',
        'zdot' => 'ż',
        'zeetrf' => 'ℨ',
        'ZeroWidthSpace' => '',
        'Zeta' => 'Ζ',
        'zeta' => 'ζ',
        'Zfr' => 'ℨ',
        'zfr' => '𝔷',
        'ZHcy' => 'Ж',
        'zhcy' => 'ж',
        'zigrarr' => '⇝',
        'Zopf' => 'ℤ',
        'zopf' => '𝕫',
        'Zscr' => '𝒵',
        'zscr' => '𝓏',
        'zwj' => '',
        'zwnj' => '',
    );
}


code:
<?php

namespace Masterminds\HTML5;

/**
 * The base exception for the HTML5 project.
 */
class Exception extends \Exception
{
}

repo_name: andremichelle/gnu

license: mit


code:
<?php
/**
 * A handler for processor instructions.
 */

namespace Masterminds\HTML5;

/**
 * Provide an processor to handle embedded instructions.
 *
 * XML defines a mechanism for inserting instructions (like PHP) into a
 * document. These are called "Processor Instructions." The HTML5 parser
 * provides an opportunity to handle these processor instructions during
 * the tree-building phase (before the DOM is constructed), which makes
 * it possible to alter the document as it is being created.
 *
 * One could, for example, use this mechanism to execute well-formed PHP
 * code embedded inside of an HTML5 document.
 */
interface InstructionProcessor
{
    /**
     * Process an individual processing instruction.
     *
     * The process() function is responsible for doing the following:
     * - Determining whether $name is an instruction type it can handle.
     * - Determining what to do with the data passed in.
     * - Making any subsequent modifications to the DOM by modifying the
     * DOMElement or its attached DOM tree.
     *
     * @param \DOMElement $element The parent element for the current processing instruction.
     * @param string      $name    The instruction's name. E.g. `<?php` has the name `php`.
     * @param string      $data    All of the data between the opening and closing PI marks.
     *
     * @return \DOMElement The element that should be considered "Current". This may just be
     *                     the element passed in, but if the processor added more elements,
     *                     it may choose to reset the current element to one of the elements
     *                     it created. (When in doubt, return the element passed in.)
     */
    public function process(\DOMElement $element, $name, $data);
}


code:
<?php

namespace Masterminds\HTML5\Parser;

use Masterminds\HTML5\Entities;

/**
 * Manage entity references.
 *
 * This is a simple resolver for HTML5 character reference entitites. See Entities for the list of supported entities.
 */
class CharacterReference
{
    protected static $numeric_mask = array(
        0x0,
        0x2FFFF,
        0,
        0xFFFF,
    );

    /**
     * Given a name (e.g. 'amp'), lookup the UTF-8 character ('&').
     *
     * @param string $name The name to look up.
     *
     * @return string The character sequence. In UTF-8 this may be more than one byte.
     */
    public static function lookupName($name)
    {
        // Do we really want to return NULL here? or FFFD
        return isset(Entities::$byName[$name]) ? Entities::$byName[$name] : null;
    }

    /**
     * Given a decimal number, return the UTF-8 character.
     *
     * @param $int
     *
     * @return false|string|string[]|null
     */
    public static function lookupDecimal($int)
    {
        $entity = '&#' . $int . ';';

        // UNTESTED: This may fail on some planes. Couldn't find full documentation
        // on the value of the mask array.
        return mb_decode_numericentity($entity, static::$numeric_mask, 'utf-8');
    }

    /**
     * Given a hexidecimal number, return the UTF-8 character.
     *
     * @param $hexdec
     *
     * @return false|string|string[]|null
     */
    public static function lookupHex($hexdec)
    {
        return static::lookupDecimal(hexdec($hexdec));
    }
}


code:
<?php

namespace Masterminds\HTML5\Parser;

use Masterminds\HTML5\Elements;
use Masterminds\HTML5\InstructionProcessor;

/**
 * Create an HTML5 DOM tree from events.
 *
 * This attempts to create a DOM from events emitted by a parser. This
 * attempts (but does not guarantee) to up-convert older HTML documents
 * to HTML5. It does this by applying HTML5's rules, but it will not
 * change the architecture of the document itself.
 *
 * Many of the error correction and quirks features suggested in the specification
 * are implemented herein; however, not all of them are. Since we do not
 * assume a graphical user agent, no presentation-specific logic is conducted
 * during tree building.
 *
 * FIXME: The present tree builder does not exactly follow the state machine rules
 * for insert modes as outlined in the HTML5 spec. The processor needs to be
 * re-written to accomodate this. See, for example, the Go language HTML5
 * parser.
 */
class DOMTreeBuilder implements EventHandler
{
    /**
     * Defined in http://www.w3.org/TR/html51/infrastructure.html#html-namespace-0.
     */
    const NAMESPACE_HTML = 'http://www.w3.org/1999/xhtml';

    const NAMESPACE_MATHML = 'http://www.w3.org/1998/Math/MathML';

    const NAMESPACE_SVG = 'http://www.w3.org/2000/svg';

    const NAMESPACE_XLINK = 'http://www.w3.org/1999/xlink';

    const NAMESPACE_XML = 'http://www.w3.org/XML/1998/namespace';

    const NAMESPACE_XMLNS = 'http://www.w3.org/2000/xmlns/';

    const OPT_DISABLE_HTML_NS = 'disable_html_ns';

    const OPT_TARGET_DOC = 'target_document';

    const OPT_IMPLICIT_NS = 'implicit_namespaces';

    /**
     * Holds the HTML5 element names that causes a namespace switch.
     *
     * @var array
     */
    protected $nsRoots = array(
        'html' => self::NAMESPACE_HTML,
        'svg' => self::NAMESPACE_SVG,
        'math' => self::NAMESPACE_MATHML,
    );

    /**
     * Holds the always available namespaces (which does not require the XMLNS declaration).
     *
     * @var array
     */
    protected $implicitNamespaces = array(
        'xml' => self::NAMESPACE_XML,
        'xmlns' => self::NAMESPACE_XMLNS,
        'xlink' => self::NAMESPACE_XLINK,
    );

    /**
     * Holds a stack of currently active namespaces.
     *
     * @var array
     */
    protected $nsStack = array();

    /**
     * Holds the number of namespaces declared by a node.
     *
     * @var array
     */
    protected $pushes = array();

    /**
     * Defined in 8.2.5.
     */
    const IM_INITIAL = 0;

    const IM_BEFORE_HTML = 1;

    const IM_BEFORE_HEAD = 2;

    const IM_IN_HEAD = 3;

    const IM_IN_HEAD_NOSCRIPT = 4;

    const IM_AFTER_HEAD = 5;

    const IM_IN_BODY = 6;

    const IM_TEXT = 7;

    const IM_IN_TABLE = 8;

    const IM_IN_TABLE_TEXT = 9;

    const IM_IN_CAPTION = 10;

    const IM_IN_COLUMN_GROUP = 11;

    const IM_IN_TABLE_BODY = 12;

    const IM_IN_ROW = 13;

    const IM_IN_CELL = 14;

    const IM_IN_SELECT = 15;

    const IM_IN_SELECT_IN_TABLE = 16;

    const IM_AFTER_BODY = 17;

    const IM_IN_FRAMESET = 18;

    const IM_AFTER_FRAMESET = 19;

    const IM_AFTER_AFTER_BODY = 20;

    const IM_AFTER_AFTER_FRAMESET = 21;

    const IM_IN_SVG = 22;

    const IM_IN_MATHML = 23;

    protected $options = array();

    protected $stack = array();

    protected $current; // Pointer in the tag hierarchy.
    protected $rules;
    protected $doc;

    protected $frag;

    protected $processor;

    protected $insertMode = 0;

    /**
     * Track if we are in an element that allows only inline child nodes.
     *
     * @var string|null
     */
    protected $onlyInline;

    /**
     * Quirks mode is enabled by default.
     * Any document that is missing the DT will be considered to be in quirks mode.
     */
    protected $quirks = true;

    protected $errors = array();

    public function __construct($isFragment = false, array $options = array())
    {
        $this->options = $options;

        if (isset($options[self::OPT_TARGET_DOC])) {
            $this->doc = $options[self::OPT_TARGET_DOC];
        } else {
            $impl = new \DOMImplementation();
            // XXX:
            // Create the doctype. For now, we are always creating HTML5
            // documents, and attempting to up-convert any older DTDs to HTML5.
            $dt = $impl->createDocumentType('html');
            // $this->doc = \DOMImplementation::createDocument(NULL, 'html', $dt);
            $this->doc = $impl->createDocument(null, null, $dt);
        }

        $this->errors = array();

        $this->current = $this->doc; // ->documentElement;

        // Create a rules engine for tags.
        $this->rules = new TreeBuildingRules();

        $implicitNS = array();
        if (isset($this->options[self::OPT_IMPLICIT_NS])) {
            $implicitNS = $this->options[self::OPT_IMPLICIT_NS];
        } elseif (isset($this->options['implicitNamespaces'])) {
            $implicitNS = $this->options['implicitNamespaces'];
        }

        // Fill $nsStack with the defalut HTML5 namespaces, plus the "implicitNamespaces" array taken form $options
        array_unshift($this->nsStack, $implicitNS + array('' => self::NAMESPACE_HTML) + $this->implicitNamespaces);

        if ($isFragment) {
            $this->insertMode = static::IM_IN_BODY;
            $this->frag = $this->doc->createDocumentFragment();
            $this->current = $this->frag;
        }
    }

    /**
     * Get the document.
     */
    public function document()
    {
        return $this->doc;
    }

    /**
     * Get the DOM fragment for the body.
     *
     * This returns a DOMNodeList because a fragment may have zero or more
     * DOMNodes at its root.
     *
     * @see http://www.w3.org/TR/2012/CR-html5-20121217/syntax.html#concept-frag-parse-context
     *
     * @return \DOMDocumentFragment
     */
    public function fragment()
    {
        return $this->frag;
    }

    /**
     * Provide an instruction processor.
     *
     * This is used for handling Processor Instructions as they are
     * inserted. If omitted, PI's are inserted directly into the DOM tree.
     *
     * @param InstructionProcessor $proc
     */
    public function setInstructionProcessor(InstructionProcessor $proc)
    {
        $this->processor = $proc;
    }

    public function doctype($name, $idType = 0, $id = null, $quirks = false)
    {
        // This is used solely for setting quirks mode. Currently we don't
        // try to preserve the inbound DT. We convert it to HTML5.
        $this->quirks = $quirks;

        if ($this->insertMode > static::IM_INITIAL) {
            $this->parseError('Illegal placement of DOCTYPE tag. Ignoring: ' . $name);

            return;
        }

        $this->insertMode = static::IM_BEFORE_HTML;
    }

    /**
     * Process the start tag.
     *
     * @todo - XMLNS namespace handling (we need to parse, even if it's not valid)
     *       - XLink, MathML and SVG namespace handling
     *       - Omission rules: 8.1.2.4 Optional tags
     *
     * @param string $name
     * @param array  $attributes
     * @param bool   $selfClosing
     *
     * @return int
     */
    public function startTag($name, $attributes = array(), $selfClosing = false)
    {
        $lname = $this->normalizeTagName($name);

        // Make sure we have an html element.
        if (!$this->doc->documentElement && 'html' !== $name && !$this->frag) {
            $this->startTag('html');
        }

        // Set quirks mode if we're at IM_INITIAL with no doctype.
        if ($this->insertMode === static::IM_INITIAL) {
            $this->quirks = true;
            $this->parseError('No DOCTYPE specified.');
        }

        // SPECIAL TAG HANDLING:
        // Spec says do this, and "don't ask."
        // find the spec where this is defined... looks problematic
        if ('image' === $name && !($this->insertMode === static::IM_IN_SVG || $this->insertMode === static::IM_IN_MATHML)) {
            $name = 'img';
        }

        // Autoclose p tags where appropriate.
        if ($this->insertMode >= static::IM_IN_BODY && Elements::isA($name, Elements::AUTOCLOSE_P)) {
            $this->autoclose('p');
        }

        // Set insert mode:
        switch ($name) {
            case 'html':
                $this->insertMode = static::IM_BEFORE_HEAD;
                break;
            case 'head':
                if ($this->insertMode > static::IM_BEFORE_HEAD) {
                    $this->parseError('Unexpected head tag outside of head context.');
                } else {
                    $this->insertMode = static::IM_IN_HEAD;
                }
                break;
            case 'body':
                $this->insertMode = static::IM_IN_BODY;
                break;
            case 'svg':
                $this->insertMode = static::IM_IN_SVG;
                break;
            case 'math':
                $this->insertMode = static::IM_IN_MATHML;
                break;
            case 'noscript':
                if ($this->insertMode === static::IM_IN_HEAD) {
                    $this->insertMode = static::IM_IN_HEAD_NOSCRIPT;
                }
                break;
        }

        // Special case handling for SVG.
        if ($this->insertMode === static::IM_IN_SVG) {
            $lname = Elements::normalizeSvgElement($lname);
        }

        $pushes = 0;
        // when we found a tag thats appears inside $nsRoots, we have to switch the defalut namespace
        if (isset($this->nsRoots[$lname]) && $this->nsStack[0][''] !== $this->nsRoots[$lname]) {
            array_unshift($this->nsStack, array(
                '' => $this->nsRoots[$lname],
            ) + $this->nsStack[0]);
            ++$pushes;
        }
        $needsWorkaround = false;
        if (isset($this->options['xmlNamespaces']) && $this->options['xmlNamespaces']) {
            // when xmlNamespaces is true a and we found a 'xmlns' or 'xmlns:*' attribute, we should add a new item to the $nsStack
            foreach ($attributes as $aName => $aVal) {
                if ('xmlns' === $aName) {
                    $needsWorkaround = $aVal;
                    array_unshift($this->nsStack, array(
                        '' => $aVal,
                    ) + $this->nsStack[0]);
                    ++$pushes;
                } elseif ('xmlns' === (($pos = strpos($aName, ':')) ? substr($aName, 0, $pos) : '')) {
                    array_unshift($this->nsStack, array(
                        substr($aName, $pos + 1) => $aVal,
                    ) + $this->nsStack[0]);
                    ++$pushes;
                }
            }
        }

        if ($this->onlyInline && Elements::isA($lname, Elements::BLOCK_TAG)) {
            $this->autoclose($this->onlyInline);
            $this->onlyInline = null;
        }

        try {
            $prefix = ($pos = strpos($lname, ':')) ? substr($lname, 0, $pos) : '';

            if (false !== $needsWorkaround) {
                $xml = "<$lname xmlns=\"$needsWorkaround\" " . (strlen($prefix) && isset($this->nsStack[0][$prefix]) ? ("xmlns:$prefix=\"" . $this->nsStack[0][$prefix] . '"') : '') . '/>';

                $frag = new \DOMDocument('1.0', 'UTF-8');
                $frag->loadXML($xml);

                $ele = $this->doc->importNode($frag->documentElement, true);
            } else {
                if (!isset($this->nsStack[0][$prefix]) || ('' === $prefix && isset($this->options[self::OPT_DISABLE_HTML_NS]) && $this->options[self::OPT_DISABLE_HTML_NS])) {
                    $ele = $this->doc->createElement($lname);
                } else {
                    $ele = $this->doc->createElementNS($this->nsStack[0][$prefix], $lname);
                }
            }
        } catch (\DOMException $e) {
            $this->parseError("Illegal tag name: <$lname>. Replaced with <invalid>.");
            $ele = $this->doc->createElement('invalid');
        }

        if (Elements::isA($lname, Elements::BLOCK_ONLY_INLINE)) {
            $this->onlyInline = $lname;
        }

        // When we add some namespacess, we have to track them. Later, when "endElement" is invoked, we have to remove them.
        // When we are on a void tag, we do not need to care about namesapce nesting.
        if ($pushes > 0 && !Elements::isA($name, Elements::VOID_TAG)) {
            // PHP tends to free the memory used by DOM,
            // to avoid spl_object_hash collisions whe have to avoid garbage collection of $ele storing it into $pushes
            // see https://bugs.php.net/bug.php?id=67459
            $this->pushes[spl_object_hash($ele)] = array($pushes, $ele);

            // SEE https://github.com/facebook/hhvm/issues/2962
            if (defined('HHVM_VERSION')) {
                $ele->setAttribute('html5-php-fake-id-attribute', spl_object_hash($ele));
            }
        }

        foreach ($attributes as $aName => $aVal) {
            // xmlns attributes can't be set
            if ('xmlns' === $aName) {
                continue;
            }

            if ($this->insertMode === static::IM_IN_SVG) {
                $aName = Elements::normalizeSvgAttribute($aName);
            } elseif ($this->insertMode === static::IM_IN_MATHML) {
                $aName = Elements::normalizeMathMlAttribute($aName);
            }

            try {
                $prefix = ($pos = strpos($aName, ':')) ? substr($aName, 0, $pos) : false;

                if ('xmlns' === $prefix) {
                    $ele->setAttributeNS(self::NAMESPACE_XMLNS, $aName, $aVal);
                } elseif (false !== $prefix && isset($this->nsStack[0][$prefix])) {
                    $ele->setAttributeNS($this->nsStack[0][$prefix], $aName, $aVal);
                } else {
                    $ele->setAttribute($aName, $aVal);
                }
            } catch (\DOMException $e) {
                $this->parseError("Illegal attribute name for tag $name. Ignoring: $aName");
                continue;
            }

            // This is necessary on a non-DTD schema, like HTML5.
            if ('id' === $aName) {
                $ele->setIdAttribute('id', true);
            }
        }

        if ($this->frag !== $this->current && $this->rules->hasRules($name)) {
            // Some elements have special processing rules. Handle those separately.
            $this->current = $this->rules->evaluate($ele, $this->current);
        } else {
            // Otherwise, it's a standard element.
            $this->current->appendChild($ele);

            if (!Elements::isA($name, Elements::VOID_TAG)) {
                $this->current = $ele;
            }

            // Self-closing tags should only be respected on foreign elements
            // (and are implied on void elements)
            // See: https://www.w3.org/TR/html5/syntax.html#start-tags
            if (Elements::isHtml5Element($name)) {
                $selfClosing = false;
            }
        }

        // This is sort of a last-ditch attempt to correct for cases where no head/body
        // elements are provided.
        if ($this->insertMode <= static::IM_BEFORE_HEAD && 'head' !== $name && 'html' !== $name) {
            $this->insertMode = static::IM_IN_BODY;
        }

        // When we are on a void tag, we do not need to care about namesapce nesting,
        // but we have to remove the namespaces pushed to $nsStack.
        if ($pushes > 0 && Elements::isA($name, Elements::VOID_TAG)) {
            // remove the namespaced definded by current node
            for ($i = 0; $i < $pushes; ++$i) {
                array_shift($this->nsStack);
            }
        }

        if ($selfClosing) {
            $this->endTag($name);
        }

        // Return the element mask, which the tokenizer can then use to set
        // various processing rules.
        return Elements::element($name);
    }

    public function endTag($name)
    {
        $lname = $this->normalizeTagName($name);

        // Ignore closing tags for unary elements.
        if (Elements::isA($name, Elements::VOID_TAG)) {
            return;
        }

        if ($this->insertMode <= static::IM_BEFORE_HTML) {
            // 8.2.5.4.2
            if (in_array($name, array(
                'html',
                'br',
                'head',
                'title',
            ))) {
                $this->startTag('html');
                $this->endTag($name);
                $this->insertMode = static::IM_BEFORE_HEAD;

                return;
            }

            // Ignore the tag.
            $this->parseError('Illegal closing tag at global scope.');

            return;
        }

        // Special case handling for SVG.
        if ($this->insertMode === static::IM_IN_SVG) {
            $lname = Elements::normalizeSvgElement($lname);
        }

        // See https://github.com/facebook/hhvm/issues/2962
        if (defined('HHVM_VERSION') && ($cid = $this->current->getAttribute('html5-php-fake-id-attribute'))) {
            $this->current->removeAttribute('html5-php-fake-id-attribute');
        } else {
            $cid = spl_object_hash($this->current);
        }

        // XXX: HTML has no parent. What do we do, though,
        // if this element appears in the wrong place?
        if ('html' === $lname) {
            return;
        }

        // remove the namespaced definded by current node
        if (isset($this->pushes[$cid])) {
            for ($i = 0; $i < $this->pushes[$cid][0]; ++$i) {
                array_shift($this->nsStack);
            }
            unset($this->pushes[$cid]);
        }

        if (!$this->autoclose($lname)) {
            $this->parseError('Could not find closing tag for ' . $lname);
        }

        switch ($lname) {
            case 'head':
                $this->insertMode = static::IM_AFTER_HEAD;
                break;
            case 'body':
                $this->insertMode = static::IM_AFTER_BODY;
                break;
            case 'svg':
            case 'mathml':
                $this->insertMode = static::IM_IN_BODY;
                break;
        }
    }

    public function comment($cdata)
    {
        // TODO: Need to handle case where comment appears outside of the HTML tag.
        $node = $this->doc->createComment($cdata);
        $this->current->appendChild($node);
    }

    public function text($data)
    {
        // XXX: Hmmm.... should we really be this strict?
        if ($this->insertMode < static::IM_IN_HEAD) {
            // Per '8.2.5.4.3 The "before head" insertion mode' the characters
            // " \t\n\r\f" should be ignored but no mention of a parse error. This is
            // practical as most documents contain these characters. Other text is not
            // expected here so recording a parse error is necessary.
            $dataTmp = trim($data, " \t\n\r\f");
            if (!empty($dataTmp)) {
                // fprintf(STDOUT, "Unexpected insert mode: %d", $this->insertMode);
                $this->parseError('Unexpected text. Ignoring: ' . $dataTmp);
            }

            return;
        }
        // fprintf(STDOUT, "Appending text %s.", $data);
        $node = $this->doc->createTextNode($data);
        $this->current->appendChild($node);
    }

    public function eof()
    {
        // If the $current isn't the $root, do we need to do anything?
    }

    public function parseError($msg, $line = 0, $col = 0)
    {
        $this->errors[] = sprintf('Line %d, Col %d: %s', $line, $col, $msg);
    }

    public function getErrors()
    {
        return $this->errors;
    }

    public function cdata($data)
    {
        $node = $this->doc->createCDATASection($data);
        $this->current->appendChild($node);
    }

    public function processingInstruction($name, $data = null)
    {
        // XXX: Ignore initial XML declaration, per the spec.
        if ($this->insertMode === static::IM_INITIAL && 'xml' === strtolower($name)) {
            return;
        }

        // Important: The processor may modify the current DOM tree however it sees fit.
        if ($this->processor instanceof InstructionProcessor) {
            $res = $this->processor->process($this->current, $name, $data);
            if (!empty($res)) {
                $this->current = $res;
            }

            return;
        }

        // Otherwise, this is just a dumb PI element.
        $node = $this->doc->createProcessingInstruction($name, $data);

        $this->current->appendChild($node);
    }

    // ==========================================================================
    // UTILITIES
    // ==========================================================================

    /**
     * Apply normalization rules to a tag name.
     * See sections 2.9 and 8.1.2.
     *
     * @param string $tagName
     *
     * @return string The normalized tag name.
     */
    protected function normalizeTagName($tagName)
    {
        /*
         * Section 2.9 suggests that we should not do this. if (strpos($name, ':') !== false) { // We know from the grammar that there must be at least one other // char besides :, since : is not a legal tag start. $parts = explode(':', $name); return array_pop($parts); }
         */
        return $tagName;
    }

    protected function quirksTreeResolver($name)
    {
        throw new \Exception('Not implemented.');
    }

    /**
     * Automatically climb the tree and close the closest node with the matching $tag.
     *
     * @param string $tagName
     *
     * @return bool
     */
    protected function autoclose($tagName)
    {
        $working = $this->current;
        do {
            if (XML_ELEMENT_NODE !== $working->nodeType) {
                return false;
            }
            if ($working->tagName === $tagName) {
                $this->current = $working->parentNode;

                return true;
            }
        } while ($working = $working->parentNode);

        return false;
    }

    /**
     * Checks if the given tagname is an ancestor of the present candidate.
     *
     * If $this->current or anything above $this->current matches the given tag
     * name, this returns true.
     *
     * @param string $tagName
     *
     * @return bool
     */
    protected function isAncestor($tagName)
    {
        $candidate = $this->current;
        while (XML_ELEMENT_NODE === $candidate->nodeType) {
            if ($candidate->tagName === $tagName) {
                return true;
            }
            $candidate = $candidate->parentNode;
        }

        return false;
    }

    /**
     * Returns true if the immediate parent element is of the given tagname.
     *
     * @param string $tagName
     *
     * @return bool
     */
    protected function isParent($tagName)
    {
        return $this->current->tagName === $tagName;
    }
}


code:
<?php

namespace Masterminds\HTML5\Parser;

/**
 * Standard events for HTML5.
 *
 * This is roughly analogous to a SAX2 or expat-style interface.
 * However, it is tuned specifically for HTML5, according to section 8
 * of the HTML5 specification.
 *
 * An event handler receives parser events. For a concrete
 * implementation, see DOMTreeBuilder.
 *
 * Quirks support in the parser is limited to close-in syntax (malformed
 * tags or attributes). Higher order syntax and semantic issues with a
 * document (e.g. mismatched tags, illegal nesting, etc.) are the
 * responsibility of the event handler implementation.
 *
 * See HTML5 spec section 8.2.4
 */
interface EventHandler
{
    const DOCTYPE_NONE = 0;

    const DOCTYPE_PUBLIC = 1;

    const DOCTYPE_SYSTEM = 2;

    /**
     * A doctype declaration.
     *
     * @param string $name   The name of the root element.
     * @param int    $idType One of DOCTYPE_NONE, DOCTYPE_PUBLIC, or DOCTYPE_SYSTEM
     * @param string $id     The identifier. For DOCTYPE_PUBLIC, this is the public ID. If DOCTYPE_SYSTEM,
     *                       then this is a system ID.
     * @param bool   $quirks Indicates whether the builder should enter quirks mode.
     */
    public function doctype($name, $idType = 0, $id = null, $quirks = false);

    /**
     * A start tag.
     *
     * IMPORTANT: The parser watches the return value of this event. If this returns
     * an integer, the parser will switch TEXTMODE patters according to the int.
     *
     * This is how the Tree Builder can tell the Tokenizer when a certain tag should
     * cause the parser to go into RAW text mode.
     *
     * The HTML5 standard requires that the builder is the one that initiates this
     * step, and this is the only way short of a circular reference that we can
     * do that.
     *
     * Example: if a startTag even for a `script` name is fired, and the startTag()
     * implementation returns Tokenizer::TEXTMODE_RAW, then the tokenizer will
     * switch into RAW text mode and consume data until it reaches a closing
     * `script` tag.
     *
     * The textmode is automatically reset to Tokenizer::TEXTMODE_NORMAL when the
     * closing tag is encounter. **This behavior may change.**
     *
     * @param string $name        The tag name.
     * @param array  $attributes  An array with all of the tag's attributes.
     * @param bool   $selfClosing An indicator of whether or not this tag is self-closing (<foo/>).
     *
     * @return int one of the Tokenizer::TEXTMODE_* constants
     */
    public function startTag($name, $attributes = array(), $selfClosing = false);

    /**
     * An end-tag.
     */
    public function endTag($name);

    /**
     * A comment section (unparsed character data).
     */
    public function comment($cdata);

    /**
     * A unit of parsed character data.
     *
     * Entities in this text are *already decoded*.
     */
    public function text($cdata);

    /**
     * Indicates that the document has been entirely processed.
     */
    public function eof();

    /**
     * Emitted when the parser encounters an error condition.
     */
    public function parseError($msg, $line, $col);

    /**
     * A CDATA section.
     *
     * @param string $data
     *                     The unparsed character data
     */
    public function cdata($data);

    /**
     * This is a holdover from the XML spec.
     *
     * While user agents don't get PIs, server-side does.
     *
     * @param string $name The name of the processor (e.g. 'php').
     * @param string $data The unparsed data.
     */
    public function processingInstruction($name, $data = null);
}


code:
<?php

namespace Masterminds\HTML5\Parser;

/**
 * The FileInputStream loads a file to be parsed.
 *
 * So right now we read files into strings and then process the
 * string. We chose to do this largely for the sake of expediency of
 * development, and also because we could optimize toward processing
 * arbitrarily large chunks of the input. But in the future, we'd
 * really like to rewrite this class to efficiently handle lower level
 * stream reads (and thus efficiently handle large documents).
 *
 * @deprecated since 2.4, to remove in 3.0. Use a string in the scanner instead.
 */
class FileInputStream extends StringInputStream implements InputStream
{
    /**
     * Load a file input stream.
     *
     * @param string $data     The file or url path to load.
     * @param string $encoding The encoding to use for the data.
     * @param string $debug    A fprintf format to use to echo the data on stdout.
     */
    public function __construct($data, $encoding = 'UTF-8', $debug = '')
    {
        // Get the contents of the file.
        $content = file_get_contents($data);

        parent::__construct($content, $encoding, $debug);
    }
}


code:
<?php

namespace Masterminds\HTML5\Parser;

/**
 * Interface for stream readers.
 *
 * The parser only reads from streams. Various input sources can write
 * an adapater to this InputStream.
 *
 * Currently provided InputStream implementations include
 * FileInputStream and StringInputStream.
 *
 * @deprecated since 2.4, to remove in 3.0. Use a string in the scanner instead.
 */
interface InputStream extends \Iterator
{
    /**
     * Returns the current line that is being consumed.
     *
     * TODO: Move this to the scanner.
     */
    public function currentLine();

    /**
     * Returns the current column of the current line that the tokenizer is at.
     *
     * Newlines are column 0. The first char after a newline is column 1.
     *
     * @TODO Move this to the scanner.
     *
     * @return int The column number.
     */
    public function columnOffset();

    /**
     * Get all characters until EOF.
     *
     * This consumes characters until the EOF.
     */
    public function remainingChars();

    /**
     * Read to a particular match (or until $max bytes are consumed).
     *
     * This operates on byte sequences, not characters.
     *
     * Matches as far as possible until we reach a certain set of bytes
     * and returns the matched substring.
     *
     * @see strcspn
     *
     * @param string $bytes Bytes to match.
     * @param int    $max   Maximum number of bytes to scan.
     *
     * @return mixed Index or false if no match is found. You should use strong
     *               equality when checking the result, since index could be 0.
     */
    public function charsUntil($bytes, $max = null);

    /**
     * Returns the string so long as $bytes matches.
     *
     * Matches as far as possible with a certain set of bytes
     * and returns the matched substring.
     *
     * @see strspn
     *
     * @param string $bytes A mask of bytes to match. If ANY byte in this mask matches the
     *                      current char, the pointer advances and the char is part of the
     *                      substring.
     * @param int    $max   The max number of chars to read.
     */
    public function charsWhile($bytes, $max = null);

    /**
     * Unconsume one character.
     *
     * @param int $howMany The number of characters to move the pointer back.
     */
    public function unconsume($howMany = 1);

    /**
     * Retrieve the next character without advancing the pointer.
     */
    public function peek();
}


code:
<?php

namespace Masterminds\HTML5\Parser;

/**
 * Emit when the parser has an error.
 */
class ParseError extends \Exception
{
}


code:
# The Parser Model

The parser model here follows the model in section
[8.2.1](http://www.w3.org/TR/2012/CR-html5-20121217/syntax.html#parsing)
of the HTML5 specification, though we do not assume a networking layer.

     [ InputStream ]    // Generic support for reading input.
           ||
      [ Scanner ]       // Breaks down the stream into characters.
           ||
     [ Tokenizer ]      // Groups characters into syntactic
           ||
    [ Tree Builder ]    // Organizes units into a tree of objects
           ||
     [ DOM Document ]     // The final state of the parsed document.

## InputStream

This is an interface with at least two concrete implementations:

- StringInputStream: Reads an HTML5 string.
- FileInputStream: Reads an HTML5 file.

## Scanner

This is a mechanical piece of the parser.

## Tokenizer

This follows section 8.4 of the HTML5 spec. It is (roughly) a recursive
descent parser. (Though there are plenty of optimizations that are less
than purely functional.

## EventHandler and DOMTree

EventHandler is the interface for tree builders. Since not all
implementations will necessarily build trees, we've chosen a more
generic name.

The event handler emits tokens during tokenization.

The DOMTree is an event handler that builds a DOM tree. The output of
the DOMTree builder is a DOMDocument.

## DOMDocument

PHP has a DOMDocument class built-in (technically, it's part of libxml.)
We use that, thus rendering the output of this process compatible with
SimpleXML, QueryPath, and many other XML/HTML processing tools.

For cases where the HTML5 is a fragment of a HTML5 document a
DOMDocumentFragment is returned instead. This is another built-in class.