Last active
November 2, 2019 15:28
-
-
Save MihaZupan/d4cf7740502f9de08fc1899f3a9c2e34 to your computer and use it in GitHub Desktop.
bool IsLeftToRight(int c)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static bool IsLeftToRight(int c) | |
{ | |
// Generated from Table D.2 of RFC3454 | |
// http://www.ietf.org/rfc/rfc3454.txt | |
// Probably should use a binary search approach | |
return c >= 0x000041 && c <= 0x00005A || | |
c >= 0x000061 && c <= 0x00007A || | |
c >= 0x0000C0 && c <= 0x0000D6 || | |
c >= 0x0000D8 && c <= 0x0000F6 || | |
c >= 0x0000F8 && c <= 0x000220 || | |
c >= 0x000222 && c <= 0x000233 || | |
c >= 0x000250 && c <= 0x0002AD || | |
c >= 0x0002B0 && c <= 0x0002B8 || | |
c >= 0x0002BB && c <= 0x0002C1 || | |
c >= 0x0002D0 && c <= 0x0002D1 || | |
c >= 0x0002E0 && c <= 0x0002E4 || | |
c >= 0x000388 && c <= 0x00038A || | |
c >= 0x00038E && c <= 0x0003A1 || | |
c >= 0x0003A3 && c <= 0x0003CE || | |
c >= 0x0003D0 && c <= 0x0003F5 || | |
c >= 0x000400 && c <= 0x000482 || | |
c >= 0x00048A && c <= 0x0004CE || | |
c >= 0x0004D0 && c <= 0x0004F5 || | |
c >= 0x0004F8 && c <= 0x0004F9 || | |
c >= 0x000500 && c <= 0x00050F || | |
c >= 0x000531 && c <= 0x000556 || | |
c >= 0x000559 && c <= 0x00055F || | |
c >= 0x000561 && c <= 0x000587 || | |
c >= 0x000905 && c <= 0x000939 || | |
c >= 0x00093D && c <= 0x000940 || | |
c >= 0x000949 && c <= 0x00094C || | |
c >= 0x000958 && c <= 0x000961 || | |
c >= 0x000964 && c <= 0x000970 || | |
c >= 0x000982 && c <= 0x000983 || | |
c >= 0x000985 && c <= 0x00098C || | |
c >= 0x00098F && c <= 0x000990 || | |
c >= 0x000993 && c <= 0x0009A8 || | |
c >= 0x0009AA && c <= 0x0009B0 || | |
c >= 0x0009B6 && c <= 0x0009B9 || | |
c >= 0x0009BE && c <= 0x0009C0 || | |
c >= 0x0009C7 && c <= 0x0009C8 || | |
c >= 0x0009CB && c <= 0x0009CC || | |
c >= 0x0009DC && c <= 0x0009DD || | |
c >= 0x0009DF && c <= 0x0009E1 || | |
c >= 0x0009E6 && c <= 0x0009F1 || | |
c >= 0x0009F4 && c <= 0x0009FA || | |
c >= 0x000A05 && c <= 0x000A0A || | |
c >= 0x000A0F && c <= 0x000A10 || | |
c >= 0x000A13 && c <= 0x000A28 || | |
c >= 0x000A2A && c <= 0x000A30 || | |
c >= 0x000A32 && c <= 0x000A33 || | |
c >= 0x000A35 && c <= 0x000A36 || | |
c >= 0x000A38 && c <= 0x000A39 || | |
c >= 0x000A3E && c <= 0x000A40 || | |
c >= 0x000A59 && c <= 0x000A5C || | |
c >= 0x000A66 && c <= 0x000A6F || | |
c >= 0x000A72 && c <= 0x000A74 || | |
c >= 0x000A85 && c <= 0x000A8B || | |
c >= 0x000A8F && c <= 0x000A91 || | |
c >= 0x000A93 && c <= 0x000AA8 || | |
c >= 0x000AAA && c <= 0x000AB0 || | |
c >= 0x000AB2 && c <= 0x000AB3 || | |
c >= 0x000AB5 && c <= 0x000AB9 || | |
c >= 0x000ABD && c <= 0x000AC0 || | |
c >= 0x000ACB && c <= 0x000ACC || | |
c >= 0x000AE6 && c <= 0x000AEF || | |
c >= 0x000B02 && c <= 0x000B03 || | |
c >= 0x000B05 && c <= 0x000B0C || | |
c >= 0x000B0F && c <= 0x000B10 || | |
c >= 0x000B13 && c <= 0x000B28 || | |
c >= 0x000B2A && c <= 0x000B30 || | |
c >= 0x000B32 && c <= 0x000B33 || | |
c >= 0x000B36 && c <= 0x000B39 || | |
c >= 0x000B3D && c <= 0x000B3E || | |
c >= 0x000B47 && c <= 0x000B48 || | |
c >= 0x000B4B && c <= 0x000B4C || | |
c >= 0x000B5C && c <= 0x000B5D || | |
c >= 0x000B5F && c <= 0x000B61 || | |
c >= 0x000B66 && c <= 0x000B70 || | |
c >= 0x000B85 && c <= 0x000B8A || | |
c >= 0x000B8E && c <= 0x000B90 || | |
c >= 0x000B92 && c <= 0x000B95 || | |
c >= 0x000B99 && c <= 0x000B9A || | |
c >= 0x000B9E && c <= 0x000B9F || | |
c >= 0x000BA3 && c <= 0x000BA4 || | |
c >= 0x000BA8 && c <= 0x000BAA || | |
c >= 0x000BAE && c <= 0x000BB5 || | |
c >= 0x000BB7 && c <= 0x000BB9 || | |
c >= 0x000BBE && c <= 0x000BBF || | |
c >= 0x000BC1 && c <= 0x000BC2 || | |
c >= 0x000BC6 && c <= 0x000BC8 || | |
c >= 0x000BCA && c <= 0x000BCC || | |
c >= 0x000BE7 && c <= 0x000BF2 || | |
c >= 0x000C01 && c <= 0x000C03 || | |
c >= 0x000C05 && c <= 0x000C0C || | |
c >= 0x000C0E && c <= 0x000C10 || | |
c >= 0x000C12 && c <= 0x000C28 || | |
c >= 0x000C2A && c <= 0x000C33 || | |
c >= 0x000C35 && c <= 0x000C39 || | |
c >= 0x000C41 && c <= 0x000C44 || | |
c >= 0x000C60 && c <= 0x000C61 || | |
c >= 0x000C66 && c <= 0x000C6F || | |
c >= 0x000C82 && c <= 0x000C83 || | |
c >= 0x000C85 && c <= 0x000C8C || | |
c >= 0x000C8E && c <= 0x000C90 || | |
c >= 0x000C92 && c <= 0x000CA8 || | |
c >= 0x000CAA && c <= 0x000CB3 || | |
c >= 0x000CB5 && c <= 0x000CB9 || | |
c >= 0x000CC0 && c <= 0x000CC4 || | |
c >= 0x000CC7 && c <= 0x000CC8 || | |
c >= 0x000CCA && c <= 0x000CCB || | |
c >= 0x000CD5 && c <= 0x000CD6 || | |
c >= 0x000CE0 && c <= 0x000CE1 || | |
c >= 0x000CE6 && c <= 0x000CEF || | |
c >= 0x000D02 && c <= 0x000D03 || | |
c >= 0x000D05 && c <= 0x000D0C || | |
c >= 0x000D0E && c <= 0x000D10 || | |
c >= 0x000D12 && c <= 0x000D28 || | |
c >= 0x000D2A && c <= 0x000D39 || | |
c >= 0x000D3E && c <= 0x000D40 || | |
c >= 0x000D46 && c <= 0x000D48 || | |
c >= 0x000D4A && c <= 0x000D4C || | |
c >= 0x000D60 && c <= 0x000D61 || | |
c >= 0x000D66 && c <= 0x000D6F || | |
c >= 0x000D82 && c <= 0x000D83 || | |
c >= 0x000D85 && c <= 0x000D96 || | |
c >= 0x000D9A && c <= 0x000DB1 || | |
c >= 0x000DB3 && c <= 0x000DBB || | |
c >= 0x000DC0 && c <= 0x000DC6 || | |
c >= 0x000DCF && c <= 0x000DD1 || | |
c >= 0x000DD8 && c <= 0x000DDF || | |
c >= 0x000DF2 && c <= 0x000DF4 || | |
c >= 0x000E01 && c <= 0x000E30 || | |
c >= 0x000E32 && c <= 0x000E33 || | |
c >= 0x000E40 && c <= 0x000E46 || | |
c >= 0x000E4F && c <= 0x000E5B || | |
c >= 0x000E81 && c <= 0x000E82 || | |
c >= 0x000E87 && c <= 0x000E88 || | |
c >= 0x000E94 && c <= 0x000E97 || | |
c >= 0x000E99 && c <= 0x000E9F || | |
c >= 0x000EA1 && c <= 0x000EA3 || | |
c >= 0x000EAA && c <= 0x000EAB || | |
c >= 0x000EAD && c <= 0x000EB0 || | |
c >= 0x000EB2 && c <= 0x000EB3 || | |
c >= 0x000EC0 && c <= 0x000EC4 || | |
c >= 0x000ED0 && c <= 0x000ED9 || | |
c >= 0x000EDC && c <= 0x000EDD || | |
c >= 0x000F00 && c <= 0x000F17 || | |
c >= 0x000F1A && c <= 0x000F34 || | |
c >= 0x000F3E && c <= 0x000F47 || | |
c >= 0x000F49 && c <= 0x000F6A || | |
c >= 0x000F88 && c <= 0x000F8B || | |
c >= 0x000FBE && c <= 0x000FC5 || | |
c >= 0x000FC7 && c <= 0x000FCC || | |
c >= 0x001000 && c <= 0x001021 || | |
c >= 0x001023 && c <= 0x001027 || | |
c >= 0x001029 && c <= 0x00102A || | |
c >= 0x001040 && c <= 0x001057 || | |
c >= 0x0010A0 && c <= 0x0010C5 || | |
c >= 0x0010D0 && c <= 0x0010F8 || | |
c >= 0x001100 && c <= 0x001159 || | |
c >= 0x00115F && c <= 0x0011A2 || | |
c >= 0x0011A8 && c <= 0x0011F9 || | |
c >= 0x001200 && c <= 0x001206 || | |
c >= 0x001208 && c <= 0x001246 || | |
c >= 0x00124A && c <= 0x00124D || | |
c >= 0x001250 && c <= 0x001256 || | |
c >= 0x00125A && c <= 0x00125D || | |
c >= 0x001260 && c <= 0x001286 || | |
c >= 0x00128A && c <= 0x00128D || | |
c >= 0x001290 && c <= 0x0012AE || | |
c >= 0x0012B2 && c <= 0x0012B5 || | |
c >= 0x0012B8 && c <= 0x0012BE || | |
c >= 0x0012C2 && c <= 0x0012C5 || | |
c >= 0x0012C8 && c <= 0x0012CE || | |
c >= 0x0012D0 && c <= 0x0012D6 || | |
c >= 0x0012D8 && c <= 0x0012EE || | |
c >= 0x0012F0 && c <= 0x00130E || | |
c >= 0x001312 && c <= 0x001315 || | |
c >= 0x001318 && c <= 0x00131E || | |
c >= 0x001320 && c <= 0x001346 || | |
c >= 0x001348 && c <= 0x00135A || | |
c >= 0x001361 && c <= 0x00137C || | |
c >= 0x0013A0 && c <= 0x0013F4 || | |
c >= 0x001401 && c <= 0x001676 || | |
c >= 0x001681 && c <= 0x00169A || | |
c >= 0x0016A0 && c <= 0x0016F0 || | |
c >= 0x001700 && c <= 0x00170C || | |
c >= 0x00170E && c <= 0x001711 || | |
c >= 0x001720 && c <= 0x001731 || | |
c >= 0x001735 && c <= 0x001736 || | |
c >= 0x001740 && c <= 0x001751 || | |
c >= 0x001760 && c <= 0x00176C || | |
c >= 0x00176E && c <= 0x001770 || | |
c >= 0x001780 && c <= 0x0017B6 || | |
c >= 0x0017BE && c <= 0x0017C5 || | |
c >= 0x0017C7 && c <= 0x0017C8 || | |
c >= 0x0017D4 && c <= 0x0017DA || | |
c >= 0x0017E0 && c <= 0x0017E9 || | |
c >= 0x001810 && c <= 0x001819 || | |
c >= 0x001820 && c <= 0x001877 || | |
c >= 0x001880 && c <= 0x0018A8 || | |
c >= 0x001E00 && c <= 0x001E9B || | |
c >= 0x001EA0 && c <= 0x001EF9 || | |
c >= 0x001F00 && c <= 0x001F15 || | |
c >= 0x001F18 && c <= 0x001F1D || | |
c >= 0x001F20 && c <= 0x001F45 || | |
c >= 0x001F48 && c <= 0x001F4D || | |
c >= 0x001F50 && c <= 0x001F57 || | |
c >= 0x001F5F && c <= 0x001F7D || | |
c >= 0x001F80 && c <= 0x001FB4 || | |
c >= 0x001FB6 && c <= 0x001FBC || | |
c >= 0x001FC2 && c <= 0x001FC4 || | |
c >= 0x001FC6 && c <= 0x001FCC || | |
c >= 0x001FD0 && c <= 0x001FD3 || | |
c >= 0x001FD6 && c <= 0x001FDB || | |
c >= 0x001FE0 && c <= 0x001FEC || | |
c >= 0x001FF2 && c <= 0x001FF4 || | |
c >= 0x001FF6 && c <= 0x001FFC || | |
c >= 0x00210A && c <= 0x002113 || | |
c >= 0x002119 && c <= 0x00211D || | |
c >= 0x00212A && c <= 0x00212D || | |
c >= 0x00212F && c <= 0x002131 || | |
c >= 0x002133 && c <= 0x002139 || | |
c >= 0x00213D && c <= 0x00213F || | |
c >= 0x002145 && c <= 0x002149 || | |
c >= 0x002160 && c <= 0x002183 || | |
c >= 0x002336 && c <= 0x00237A || | |
c >= 0x00249C && c <= 0x0024E9 || | |
c >= 0x003005 && c <= 0x003007 || | |
c >= 0x003021 && c <= 0x003029 || | |
c >= 0x003031 && c <= 0x003035 || | |
c >= 0x003038 && c <= 0x00303C || | |
c >= 0x003041 && c <= 0x003096 || | |
c >= 0x00309D && c <= 0x00309F || | |
c >= 0x0030A1 && c <= 0x0030FA || | |
c >= 0x0030FC && c <= 0x0030FF || | |
c >= 0x003105 && c <= 0x00312C || | |
c >= 0x003131 && c <= 0x00318E || | |
c >= 0x003190 && c <= 0x0031B7 || | |
c >= 0x0031F0 && c <= 0x00321C || | |
c >= 0x003220 && c <= 0x003243 || | |
c >= 0x003260 && c <= 0x00327B || | |
c >= 0x00327F && c <= 0x0032B0 || | |
c >= 0x0032C0 && c <= 0x0032CB || | |
c >= 0x0032D0 && c <= 0x0032FE || | |
c >= 0x003300 && c <= 0x003376 || | |
c >= 0x00337B && c <= 0x0033DD || | |
c >= 0x0033E0 && c <= 0x0033FE || | |
c >= 0x003400 && c <= 0x004DB5 || | |
c >= 0x004E00 && c <= 0x009FA5 || | |
c >= 0x00A000 && c <= 0x00A48C || | |
c >= 0x00AC00 && c <= 0x00D7A3 || | |
c >= 0x00D800 && c <= 0x00FA2D || | |
c >= 0x00FA30 && c <= 0x00FA6A || | |
c >= 0x00FB00 && c <= 0x00FB06 || | |
c >= 0x00FB13 && c <= 0x00FB17 || | |
c >= 0x00FF21 && c <= 0x00FF3A || | |
c >= 0x00FF41 && c <= 0x00FF5A || | |
c >= 0x00FF66 && c <= 0x00FFBE || | |
c >= 0x00FFC2 && c <= 0x00FFC7 || | |
c >= 0x00FFCA && c <= 0x00FFCF || | |
c >= 0x00FFD2 && c <= 0x00FFD7 || | |
c >= 0x00FFDA && c <= 0x00FFDC || | |
c >= 0x010300 && c <= 0x01031E || | |
c >= 0x010320 && c <= 0x010323 || | |
c >= 0x010330 && c <= 0x01034A || | |
c >= 0x010400 && c <= 0x010425 || | |
c >= 0x010428 && c <= 0x01044D || | |
c >= 0x01D000 && c <= 0x01D0F5 || | |
c >= 0x01D100 && c <= 0x01D126 || | |
c >= 0x01D12A && c <= 0x01D166 || | |
c >= 0x01D16A && c <= 0x01D172 || | |
c >= 0x01D183 && c <= 0x01D184 || | |
c >= 0x01D18C && c <= 0x01D1A9 || | |
c >= 0x01D1AE && c <= 0x01D1DD || | |
c >= 0x01D400 && c <= 0x01D454 || | |
c >= 0x01D456 && c <= 0x01D49C || | |
c >= 0x01D49E && c <= 0x01D49F || | |
c >= 0x01D4A5 && c <= 0x01D4A6 || | |
c >= 0x01D4A9 && c <= 0x01D4AC || | |
c >= 0x01D4AE && c <= 0x01D4B9 || | |
c >= 0x01D4BD && c <= 0x01D4C0 || | |
c >= 0x01D4C2 && c <= 0x01D4C3 || | |
c >= 0x01D4C5 && c <= 0x01D505 || | |
c >= 0x01D507 && c <= 0x01D50A || | |
c >= 0x01D50D && c <= 0x01D514 || | |
c >= 0x01D516 && c <= 0x01D51C || | |
c >= 0x01D51E && c <= 0x01D539 || | |
c >= 0x01D53B && c <= 0x01D53E || | |
c >= 0x01D540 && c <= 0x01D544 || | |
c >= 0x01D54A && c <= 0x01D550 || | |
c >= 0x01D552 && c <= 0x01D6A3 || | |
c >= 0x01D6A8 && c <= 0x01D7C9 || | |
c >= 0x020000 && c <= 0x02A6D6 || | |
c >= 0x02F800 && c <= 0x02FA1D || | |
c >= 0x0F0000 && c <= 0x0FFFFD || | |
c >= 0x100000 && c <= 0x10FFFD || | |
c == 0x0000AA || c == 0x0000B5 || | |
c == 0x0000BA || c == 0x0002EE || | |
c == 0x00037A || c == 0x000386 || | |
c == 0x00038C || c == 0x000589 || | |
c == 0x000903 || c == 0x000950 || | |
c == 0x0009B2 || c == 0x0009D7 || | |
c == 0x000A5E || c == 0x000A83 || | |
c == 0x000A8D || c == 0x000AC9 || | |
c == 0x000AD0 || c == 0x000AE0 || | |
c == 0x000B40 || c == 0x000B57 || | |
c == 0x000B83 || c == 0x000B9C || | |
c == 0x000BD7 || c == 0x000CBE || | |
c == 0x000CDE || c == 0x000D57 || | |
c == 0x000DBD || c == 0x000E84 || | |
c == 0x000E8A || c == 0x000E8D || | |
c == 0x000EA5 || c == 0x000EA7 || | |
c == 0x000EBD || c == 0x000EC6 || | |
c == 0x000F36 || c == 0x000F38 || | |
c == 0x000F7F || c == 0x000F85 || | |
c == 0x000FCF || c == 0x00102C || | |
c == 0x001031 || c == 0x001038 || | |
c == 0x0010FB || c == 0x001248 || | |
c == 0x001258 || c == 0x001288 || | |
c == 0x0012B0 || c == 0x0012C0 || | |
c == 0x001310 || c == 0x0017DC || | |
c == 0x001F59 || c == 0x001F5B || | |
c == 0x001F5D || c == 0x001FBE || | |
c == 0x00200E || c == 0x002071 || | |
c == 0x00207F || c == 0x002102 || | |
c == 0x002107 || c == 0x002115 || | |
c == 0x002124 || c == 0x002126 || | |
c == 0x002128 || c == 0x002395 || | |
c == 0x01D4A2 || c == 0x01D4BB || | |
c == 0x01D546; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static bool IsLeftToRight(int c) | |
{ | |
if (c < 3902) | |
{ | |
if (c < 2903) | |
{ | |
if (c < 2494) | |
{ | |
if (c < 1162) | |
{ | |
if (c < 720) | |
{ | |
if (c < 216) | |
{ | |
if (c < 170) | |
{ | |
return (uint)(c - 65) <= 25 || (uint)(c - 97) <= 25; | |
} | |
else | |
{ | |
return ((35184367962113L >> (c - 170)) & 1) != 0; | |
} | |
} | |
else | |
{ | |
if (c < 592) | |
{ | |
return (uint)(c - 248) <= 296 || c <= 246 || (uint)(c - 546) <= 17; | |
} | |
else | |
{ | |
return c <= 685 || (uint)(c - 688) <= 8 || (uint)(c - 699) <= 6; | |
} | |
} | |
} | |
else | |
{ | |
if (c < 890) | |
{ | |
c -= 720; | |
if ((uint)c > 30) return false; | |
return ((1075773443L >> c) & 1) != 0; | |
} | |
else | |
{ | |
if (c < 931) | |
{ | |
return ((1099510960129L >> (c - 890)) & 1) != 0; | |
} | |
else | |
{ | |
return (uint)(c - 1024) <= 130 || c <= 974 || (uint)(c - 976) <= 37; | |
} | |
} | |
} | |
} | |
else | |
{ | |
if (c < 2377) | |
{ | |
if (c < 1377) | |
{ | |
if (c < 1232) | |
{ | |
return c <= 1230; | |
} | |
else | |
{ | |
if (c < 1329) | |
{ | |
c -= 1232; | |
if ((uint)c > 63) return false; | |
return ((-277901563920385L >> c) & 1) != 0; | |
} | |
else | |
{ | |
return ((139912854634495L >> (c - 1329)) & 1) != 0; | |
} | |
} | |
} | |
else | |
{ | |
if (c < 2307) | |
{ | |
return c <= 1415 || c == 1417; | |
} | |
else | |
{ | |
c -= 2307; | |
if ((uint)c > 61) return false; | |
return ((4359484439294640125L >> c) & 1) != 0; | |
} | |
} | |
} | |
else | |
{ | |
if (c < 2434) | |
{ | |
return ((1099410931855L >> (c - 2377)) & 1) != 0; | |
} | |
else | |
{ | |
return ((67975657119705083L >> (c - 2434)) & 1) != 0; | |
} | |
} | |
} | |
} | |
else | |
{ | |
if (c < 2703) | |
{ | |
if (c < 2610) | |
{ | |
if (c < 2548) | |
{ | |
return ((4502563500090887L >> (c - 2494)) & 1) != 0; | |
} | |
else | |
{ | |
return ((2296835808222380159L >> (c - 2548)) & 1) != 0; | |
} | |
} | |
else | |
{ | |
if (c < 2649) | |
{ | |
return ((28891L >> (c - 2610)) & 1) != 0; | |
} | |
else | |
{ | |
return ((6742205544783919L >> (c - 2649)) & 1) != 0; | |
} | |
} | |
} | |
else | |
{ | |
if (c < 2831) | |
{ | |
if (c < 2768) | |
{ | |
c -= 2703; | |
if ((uint)c > 61) return false; | |
return ((3748059062542008311L >> c) & 1) != 0; | |
} | |
else | |
{ | |
return ((2300213513970319361L >> (c - 2768)) & 1) != 0; | |
} | |
} | |
else | |
{ | |
c -= 2831; | |
if ((uint)c > 61) return false; | |
return ((3675719718649462771L >> c) & 1) != 0; | |
} | |
} | |
} | |
} | |
else | |
{ | |
if (c < 3333) | |
{ | |
if (c < 3086) | |
{ | |
if (c < 2947) | |
{ | |
return ((67077985L >> (c - 2903)) & 1) != 0; | |
} | |
else | |
{ | |
if (c < 3014) | |
{ | |
c -= 2947; | |
if ((uint)c > 63) return false; | |
return ((-2848534584997988099L >> c) & 1) != 0; | |
} | |
else | |
{ | |
if (c < 3031) | |
{ | |
return ((119L >> (c - 3014)) & 1) != 0; | |
} | |
else | |
{ | |
return ((17974816359251969L >> (c - 3031)) & 1) != 0; | |
} | |
} | |
} | |
} | |
else | |
{ | |
if (c < 3242) | |
{ | |
if (c < 3168) | |
{ | |
c -= 3086; | |
if ((uint)c > 54) return false; | |
return ((33794314379198455L >> c) & 1) != 0; | |
} | |
else | |
{ | |
if (c < 3202) | |
{ | |
return ((65475L >> (c - 3168)) & 1) != 0; | |
} | |
else | |
{ | |
return ((549755779067L >> (c - 3202)) & 1) != 0; | |
} | |
} | |
} | |
else | |
{ | |
if (c < 3271) | |
{ | |
return ((131136511L >> (c - 3242)) & 1) != 0; | |
} | |
else | |
{ | |
return ((1729384453895143451L >> (c - 3271)) & 1) != 0; | |
} | |
} | |
} | |
} | |
else | |
{ | |
if (c < 3713) | |
{ | |
if (c < 3482) | |
{ | |
if (c < 3415) | |
{ | |
if (c < 3342) | |
{ | |
return c <= 3340; | |
} | |
else | |
{ | |
c -= 3342; | |
if ((uint)c > 62) return false; | |
return ((8576841607402225655L >> c) & 1) != 0; | |
} | |
} | |
else | |
{ | |
c -= 3415; | |
if ((uint)c > 63) return false; | |
return ((-43980431587839L >> c) & 1) != 0; | |
} | |
} | |
else | |
{ | |
if (c < 3544) | |
{ | |
return ((63085355800199167L >> (c - 3482)) & 1) != 0; | |
} | |
else | |
{ | |
if (c < 3634) | |
{ | |
return (uint)(c - 3585) <= 47 || c <= 3551 || (uint)(c - 3570) <= 2; | |
} | |
else | |
{ | |
c -= 3634; | |
if ((uint)c > 41) return false; | |
return ((4397511720963L >> c) & 1) != 0; | |
} | |
} | |
} | |
} | |
else | |
{ | |
if (c < 3776) | |
{ | |
return ((1154881210128274123L >> (c - 3713)) & 1) != 0; | |
} | |
else | |
{ | |
if (c < 3840) | |
{ | |
return ((872349791L >> (c - 3776)) & 1) != 0; | |
} | |
else | |
{ | |
return ((99079191751819263L >> (c - 3840)) & 1) != 0; | |
} | |
} | |
} | |
} | |
} | |
} | |
else | |
{ | |
if (c < 8319) | |
{ | |
if (c < 4936) | |
{ | |
if (c < 4680) | |
{ | |
if (c < 4145) | |
{ | |
if (c < 4039) | |
{ | |
if (c < 3913) | |
{ | |
return c <= 3911; | |
} | |
else | |
{ | |
if (c < 3976) | |
{ | |
return ((1170935920296198143L >> (c - 3913)) & 1) != 0; | |
} | |
else | |
{ | |
return ((4593671619917905935L >> (c - 3976)) & 1) != 0; | |
} | |
} | |
} | |
else | |
{ | |
if (c < 4096) | |
{ | |
return ((319L >> (c - 4039)) & 1) != 0; | |
} | |
else | |
{ | |
return ((25271587569663L >> (c - 4096)) & 1) != 0; | |
} | |
} | |
} | |
else | |
{ | |
if (c < 4352) | |
{ | |
if (c < 4256) | |
{ | |
c -= 4145; | |
if ((uint)c > 38) return false; | |
return ((549755781249L >> c) & 1) != 0; | |
} | |
else | |
{ | |
return c <= 4293 || (uint)(c - 4304) <= 40 || c == 4347; | |
} | |
} | |
else | |
{ | |
if (c < 4608) | |
{ | |
return c <= 4441 || (uint)(c - 4520) <= 81 || (uint)(c - 4447) <= 67; | |
} | |
else | |
{ | |
return (uint)(c - 4616) <= 62 || c <= 4614; | |
} | |
} | |
} | |
} | |
else | |
{ | |
if (c < 4792) | |
{ | |
if (c < 4744) | |
{ | |
return ((9223372036842028861L >> (c - 4680)) & 1) != 0; | |
} | |
else | |
{ | |
return ((67619965108029L >> (c - 4744)) & 1) != 0; | |
} | |
} | |
else | |
{ | |
if (c < 4848) | |
{ | |
return ((36028794863041919L >> (c - 4792)) & 1) != 0; | |
} | |
else | |
{ | |
if (c < 4880) | |
{ | |
return c <= 4878; | |
} | |
else | |
{ | |
return ((36028797018931005L >> (c - 4880)) & 1) != 0; | |
} | |
} | |
} | |
} | |
} | |
else | |
{ | |
if (c < 7840) | |
{ | |
if (c < 5998) | |
{ | |
if (c < 5888) | |
{ | |
if (c < 5121) | |
{ | |
return (uint)(c - 5024) <= 84 || c <= 4954 || (uint)(c - 4961) <= 27; | |
} | |
else | |
{ | |
return c <= 5750 || (uint)(c - 5792) <= 80 || (uint)(c - 5761) <= 25; | |
} | |
} | |
else | |
{ | |
if (c < 5941) | |
{ | |
return ((1125895612129279L >> (c - 5888)) & 1) != 0; | |
} | |
else | |
{ | |
return ((72048798481774595L >> (c - 5941)) & 1) != 0; | |
} | |
} | |
} | |
else | |
{ | |
if (c < 6078) | |
{ | |
return (uint)(c - 6016) <= 54 || c <= 6000; | |
} | |
else | |
{ | |
if (c < 6160) | |
{ | |
c -= 6078; | |
if ((uint)c > 43) return false; | |
return ((17576612595455L >> c) & 1) != 0; | |
} | |
else | |
{ | |
if (c < 6272) | |
{ | |
return (uint)(c - 6176) <= 87 || c <= 6169; | |
} | |
else | |
{ | |
return (uint)(c - 7680) <= 155 || c <= 6312; | |
} | |
} | |
} | |
} | |
} | |
else | |
{ | |
if (c < 8118) | |
{ | |
if (c < 7968) | |
{ | |
return c <= 7929 || (uint)(c - 7936) <= 21 || (uint)(c - 7960) <= 5; | |
} | |
else | |
{ | |
if (c < 8031) | |
{ | |
return ((3098264612764647423L >> (c - 7968)) & 1) != 0; | |
} | |
else | |
{ | |
return c <= 8061 || (uint)(c - 8064) <= 52; | |
} | |
} | |
} | |
else | |
{ | |
if (c < 8182) | |
{ | |
return ((8106475202818306431L >> (c - 8118)) & 1) != 0; | |
} | |
else | |
{ | |
return c <= 8188 || c == 8206 || c == 8305; | |
} | |
} | |
} | |
} | |
} | |
else | |
{ | |
if (c < 64275) | |
{ | |
if (c < 12445) | |
{ | |
if (c < 8450) | |
{ | |
return c == 8319; | |
} | |
else | |
{ | |
if (c < 8517) | |
{ | |
c -= 8450; | |
if ((uint)c > 61) return false; | |
return ((4106983054525595425L >> c) & 1) != 0; | |
} | |
else | |
{ | |
if (c < 12293) | |
{ | |
if (c < 9109) | |
{ | |
return (uint)(c - 9014) <= 68 || (uint)(c - 8544) <= 35 || c <= 8521; | |
} | |
else | |
{ | |
return (uint)(c - 9372) <= 77 || c == 9109; | |
} | |
} | |
else | |
{ | |
if (c < 12353) | |
{ | |
return ((70351289162137607L >> (c - 12293)) & 1) != 0; | |
} | |
else | |
{ | |
return c <= 12438; | |
} | |
} | |
} | |
} | |
} | |
else | |
{ | |
if (c < 13008) | |
{ | |
if (c < 12784) | |
{ | |
if (c < 12549) | |
{ | |
return (uint)(c - 12449) <= 89 || c <= 12447 || (uint)(c - 12540) <= 3; | |
} | |
else | |
{ | |
return (uint)(c - 12593) <= 93 || c <= 12588 || (uint)(c - 12688) <= 39; | |
} | |
} | |
else | |
{ | |
if (c < 12927) | |
{ | |
return c <= 12828 || (uint)(c - 12832) <= 35 || (uint)(c - 12896) <= 27; | |
} | |
else | |
{ | |
return c <= 12976 || (uint)(c - 12992) <= 11; | |
} | |
} | |
} | |
else | |
{ | |
if (c < 40960) | |
{ | |
if (c < 13280) | |
{ | |
return (uint)(c - 13056) <= 118 || (uint)(c - 13179) <= 98 || c <= 13054; | |
} | |
else | |
{ | |
return (uint)(c - 19968) <= 20901 || (uint)(c - 13312) <= 6581 || c <= 13310; | |
} | |
} | |
else | |
{ | |
if (c < 64048) | |
{ | |
return (uint)(c - 44032) <= 11171 || (uint)(c - 55296) <= 8749 || c <= 42124; | |
} | |
else | |
{ | |
return c <= 64106 || (uint)(c - 64256) <= 6; | |
} | |
} | |
} | |
} | |
} | |
else | |
{ | |
if (c < 119970) | |
{ | |
if (c < 66600) | |
{ | |
if (c < 65490) | |
{ | |
if (c < 65382) | |
{ | |
return (uint)(c - 65313) <= 25 || (uint)(c - 65345) <= 25 || c <= 64279; | |
} | |
else | |
{ | |
return c <= 65470 || (uint)(c - 65474) <= 5 || (uint)(c - 65482) <= 5; | |
} | |
} | |
else | |
{ | |
if (c < 66336) | |
{ | |
return (uint)(c - 66304) <= 30 || c <= 65495 || (uint)(c - 65498) <= 2; | |
} | |
else | |
{ | |
return (uint)(c - 66560) <= 37 || (uint)(c - 66352) <= 26 || c <= 66339; | |
} | |
} | |
} | |
else | |
{ | |
if (c < 119180) | |
{ | |
if (c < 119082) | |
{ | |
return (uint)(c - 118784) <= 245 || c <= 66637 || (uint)(c - 119040) <= 38; | |
} | |
else | |
{ | |
return c <= 119142 || (uint)(c - 119146) <= 8 || (uint)(c - 119171) <= 1; | |
} | |
} | |
else | |
{ | |
if (c < 119894) | |
{ | |
return (uint)(c - 119808) <= 84 || c <= 119209 || (uint)(c - 119214) <= 47; | |
} | |
else | |
{ | |
return c <= 119964 || (uint)(c - 119966) <= 1; | |
} | |
} | |
} | |
} | |
else | |
{ | |
if (c < 120094) | |
{ | |
if (c < 120005) | |
{ | |
return ((14948497305L >> (c - 119970)) & 1) != 0; | |
} | |
else | |
{ | |
if (c < 120071) | |
{ | |
return c <= 120069; | |
} | |
else | |
{ | |
return ((4177871L >> (c - 120071)) & 1) != 0; | |
} | |
} | |
} | |
else | |
{ | |
if (c < 120146) | |
{ | |
return ((2235848036712447L >> (c - 120094)) & 1) != 0; | |
} | |
else | |
{ | |
if (c < 194560) | |
{ | |
return (uint)(c - 131072) <= 42710 || c <= 120483 || (uint)(c - 120488) <= 289; | |
} | |
else | |
{ | |
return (uint)(c - 983040) <= 65533 || (uint)(c - 1048576) <= 65533 || c <= 195101; | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment