github.com/dolthub/go-mysql-server@v0.18.0/sql/encodings/latin7_general_ci.go (about)

     1  // Copyright 2023 Dolthub, Inc.
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //     http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  package encodings
    16  
    17  // Latin7_general_ci_RuneWeight returns the weight of a given rune based on its relational sort order from
    18  // the `latin7_general_ci` collation.
    19  func Latin7_general_ci_RuneWeight(r rune) int32 {
    20  	weight, ok := latin7_general_ci_Weights[r]
    21  	if ok {
    22  		return weight
    23  	} else {
    24  		return 2147483647
    25  	}
    26  }
    27  
    28  // latin7_general_ci_Weights contain a map from rune to weight for the `latin7_general_ci` collation. The
    29  // map primarily contains mappings that have a random order. Mappings that fit into a sequential range (and are long
    30  // enough) are defined in the calling function to save space.
    31  var latin7_general_ci_Weights = map[rune]int32{
    32  	0:    0,
    33  	1:    1,
    34  	2:    2,
    35  	3:    3,
    36  	4:    4,
    37  	5:    5,
    38  	6:    6,
    39  	7:    7,
    40  	8:    8,
    41  	9:    9,
    42  	10:   10,
    43  	11:   11,
    44  	12:   12,
    45  	13:   13,
    46  	14:   14,
    47  	15:   15,
    48  	16:   16,
    49  	17:   17,
    50  	18:   18,
    51  	19:   19,
    52  	20:   20,
    53  	21:   21,
    54  	22:   22,
    55  	23:   23,
    56  	24:   24,
    57  	25:   25,
    58  	26:   26,
    59  	27:   27,
    60  	28:   28,
    61  	29:   29,
    62  	30:   30,
    63  	31:   31,
    64  	127:  32,
    65  	129:  33,
    66  	131:  34,
    67  	136:  35,
    68  	138:  36,
    69  	140:  37,
    70  	144:  38,
    71  	152:  39,
    72  	154:  40,
    73  	156:  41,
    74  	159:  42,
    75  	39:   43,
    76  	45:   44,
    77  	173:  45,
    78  	216:  45,
    79  	150:  46,
    80  	151:  47,
    81  	32:   48,
    82  	160:  49,
    83  	33:   50,
    84  	34:   51,
    85  	35:   52,
    86  	36:   53,
    87  	37:   54,
    88  	38:   55,
    89  	40:   56,
    90  	41:   57,
    91  	42:   58,
    92  	44:   59,
    93  	46:   60,
    94  	47:   61,
    95  	58:   62,
    96  	59:   63,
    97  	63:   64,
    98  	64:   65,
    99  	91:   66,
   100  	92:   67,
   101  	93:   68,
   102  	94:   69,
   103  	95:   70,
   104  	96:   71,
   105  	123:  72,
   106  	124:  73,
   107  	125:  74,
   108  	126:  75,
   109  	166:  76,
   110  	141:  77,
   111  	157:  78,
   112  	8220: 79,
   113  	143:  80,
   114  	142:  81,
   115  	8217: 82,
   116  	158:  83,
   117  	145:  84,
   118  	146:  85,
   119  	130:  86,
   120  	147:  87,
   121  	148:  88,
   122  	132:  89,
   123  	139:  90,
   124  	155:  91,
   125  	43:   92,
   126  	60:   93,
   127  	61:   94,
   128  	62:   95,
   129  	177:  96,
   130  	171:  97,
   131  	187:  98,
   132  	215:  99,
   133  	247:  100,
   134  	162:  101,
   135  	163:  102,
   136  	164:  103,
   137  	167:  104,
   138  	169:  105,
   139  	172:  106,
   140  	174:  107,
   141  	176:  108,
   142  	181:  109,
   143  	182:  110,
   144  	183:  111,
   145  	134:  112,
   146  	135:  113,
   147  	149:  114,
   148  	133:  115,
   149  	137:  116,
   150  	128:  117,
   151  	48:   118,
   152  	188:  119,
   153  	189:  120,
   154  	190:  121,
   155  	49:   122,
   156  	185:  123,
   157  	50:   124,
   158  	178:  125,
   159  	51:   126,
   160  	179:  127,
   161  	52:   128,
   162  	53:   129,
   163  	54:   130,
   164  	55:   131,
   165  	56:   132,
   166  	57:   133,
   167  	65:   134,
   168  	97:   134,
   169  	196:  135,
   170  	228:  135,
   171  	256:  136,
   172  	257:  136,
   173  	197:  137,
   174  	229:  137,
   175  	260:  138,
   176  	261:  138,
   177  	198:  139,
   178  	230:  139,
   179  	66:   140,
   180  	98:   140,
   181  	67:   141,
   182  	99:   141,
   183  	262:  142,
   184  	263:  142,
   185  	268:  143,
   186  	269:  143,
   187  	68:   144,
   188  	100:  144,
   189  	69:   145,
   190  	101:  145,
   191  	201:  146,
   192  	233:  146,
   193  	278:  147,
   194  	279:  147,
   195  	274:  148,
   196  	275:  148,
   197  	280:  149,
   198  	281:  149,
   199  	70:   150,
   200  	102:  150,
   201  	71:   151,
   202  	103:  151,
   203  	290:  152,
   204  	291:  152,
   205  	72:   153,
   206  	104:  153,
   207  	73:   154,
   208  	105:  154,
   209  	298:  155,
   210  	299:  155,
   211  	302:  156,
   212  	303:  156,
   213  	74:   157,
   214  	106:  157,
   215  	75:   158,
   216  	107:  158,
   217  	310:  159,
   218  	311:  159,
   219  	76:   160,
   220  	108:  160,
   221  	321:  161,
   222  	322:  161,
   223  	315:  162,
   224  	316:  162,
   225  	77:   163,
   226  	109:  163,
   227  	78:   164,
   228  	110:  164,
   229  	323:  165,
   230  	324:  165,
   231  	325:  166,
   232  	326:  166,
   233  	79:   167,
   234  	111:  167,
   235  	211:  168,
   236  	243:  168,
   237  	214:  169,
   238  	246:  169,
   239  	332:  170,
   240  	333:  170,
   241  	213:  171,
   242  	245:  171,
   243  	248:  172,
   244  	80:   173,
   245  	112:  173,
   246  	81:   174,
   247  	113:  174,
   248  	82:   175,
   249  	114:  175,
   250  	342:  176,
   251  	343:  177,
   252  	83:   178,
   253  	115:  178,
   254  	346:  179,
   255  	347:  179,
   256  	223:  180,
   257  	352:  181,
   258  	353:  181,
   259  	116:  182,
   260  	84:   183,
   261  	153:  184,
   262  	85:   185,
   263  	117:  185,
   264  	220:  186,
   265  	252:  186,
   266  	362:  187,
   267  	363:  187,
   268  	370:  188,
   269  	371:  188,
   270  	86:   189,
   271  	118:  189,
   272  	87:   190,
   273  	119:  190,
   274  	88:   191,
   275  	120:  191,
   276  	89:   192,
   277  	121:  192,
   278  	90:   193,
   279  	122:  193,
   280  	377:  194,
   281  	378:  194,
   282  	379:  195,
   283  	380:  195,
   284  	381:  196,
   285  	382:  196,
   286  	8221: 197,
   287  	8222: 198,
   288  }