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

     1  // Copyright 2022 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  // Latin1_german1_ci_RuneWeight returns the weight of a given rune based on its relational sort order from
    18  // the `latin1_german1_ci` collation.
    19  func Latin1_german1_ci_RuneWeight(r rune) int32 {
    20  	weight, ok := latin1_german1_ci_Weights[r]
    21  	if ok {
    22  		return weight
    23  	} else {
    24  		return 2147483647
    25  	}
    26  }
    27  
    28  // latin1_german1_ci_Weights contain a map from rune to weight for the `latin1_german1_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 latin1_german1_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  	32:   32,
    65  	33:   33,
    66  	34:   34,
    67  	35:   35,
    68  	36:   36,
    69  	37:   37,
    70  	38:   38,
    71  	39:   39,
    72  	40:   40,
    73  	41:   41,
    74  	42:   42,
    75  	43:   43,
    76  	44:   44,
    77  	45:   45,
    78  	46:   46,
    79  	47:   47,
    80  	48:   48,
    81  	49:   49,
    82  	50:   50,
    83  	51:   51,
    84  	52:   52,
    85  	53:   53,
    86  	54:   54,
    87  	55:   55,
    88  	56:   56,
    89  	57:   57,
    90  	58:   58,
    91  	59:   59,
    92  	60:   60,
    93  	61:   61,
    94  	62:   62,
    95  	63:   63,
    96  	64:   64,
    97  	65:   65,
    98  	97:   65,
    99  	192:  65,
   100  	193:  65,
   101  	194:  65,
   102  	195:  65,
   103  	196:  65,
   104  	197:  65,
   105  	198:  65,
   106  	224:  65,
   107  	225:  65,
   108  	226:  65,
   109  	227:  65,
   110  	228:  65,
   111  	229:  65,
   112  	230:  65,
   113  	66:   66,
   114  	98:   66,
   115  	67:   67,
   116  	99:   67,
   117  	199:  67,
   118  	231:  67,
   119  	68:   68,
   120  	100:  68,
   121  	69:   69,
   122  	101:  69,
   123  	200:  69,
   124  	201:  69,
   125  	202:  69,
   126  	203:  69,
   127  	232:  69,
   128  	233:  69,
   129  	234:  69,
   130  	235:  69,
   131  	70:   70,
   132  	102:  70,
   133  	71:   71,
   134  	103:  71,
   135  	72:   72,
   136  	104:  72,
   137  	73:   73,
   138  	105:  73,
   139  	204:  73,
   140  	205:  73,
   141  	206:  73,
   142  	207:  73,
   143  	236:  73,
   144  	237:  73,
   145  	238:  73,
   146  	239:  73,
   147  	74:   74,
   148  	106:  74,
   149  	75:   75,
   150  	107:  75,
   151  	76:   76,
   152  	108:  76,
   153  	77:   77,
   154  	109:  77,
   155  	78:   78,
   156  	110:  78,
   157  	209:  78,
   158  	241:  78,
   159  	79:   79,
   160  	111:  79,
   161  	210:  79,
   162  	211:  79,
   163  	212:  79,
   164  	213:  79,
   165  	214:  79,
   166  	216:  79,
   167  	242:  79,
   168  	243:  79,
   169  	244:  79,
   170  	245:  79,
   171  	246:  79,
   172  	248:  79,
   173  	80:   80,
   174  	112:  80,
   175  	81:   81,
   176  	113:  81,
   177  	82:   82,
   178  	114:  82,
   179  	83:   83,
   180  	115:  83,
   181  	223:  83,
   182  	84:   84,
   183  	116:  84,
   184  	85:   85,
   185  	117:  85,
   186  	217:  85,
   187  	218:  85,
   188  	219:  85,
   189  	220:  85,
   190  	249:  85,
   191  	250:  85,
   192  	251:  85,
   193  	252:  85,
   194  	86:   86,
   195  	118:  86,
   196  	87:   87,
   197  	119:  87,
   198  	88:   88,
   199  	120:  88,
   200  	89:   89,
   201  	121:  89,
   202  	221:  89,
   203  	253:  89,
   204  	90:   90,
   205  	122:  90,
   206  	91:   91,
   207  	92:   92,
   208  	93:   93,
   209  	94:   94,
   210  	95:   95,
   211  	96:   96,
   212  	123:  97,
   213  	124:  98,
   214  	125:  99,
   215  	126:  100,
   216  	127:  101,
   217  	8364: 102,
   218  	129:  103,
   219  	8218: 104,
   220  	402:  105,
   221  	8222: 106,
   222  	8230: 107,
   223  	8224: 108,
   224  	8225: 109,
   225  	710:  110,
   226  	8240: 111,
   227  	352:  112,
   228  	8249: 113,
   229  	338:  114,
   230  	141:  115,
   231  	381:  116,
   232  	143:  117,
   233  	144:  118,
   234  	8216: 119,
   235  	8217: 120,
   236  	8220: 121,
   237  	8221: 122,
   238  	8226: 123,
   239  	8211: 124,
   240  	8212: 125,
   241  	732:  126,
   242  	8482: 127,
   243  	353:  128,
   244  	8250: 129,
   245  	339:  130,
   246  	157:  131,
   247  	382:  132,
   248  	376:  133,
   249  	160:  134,
   250  	161:  135,
   251  	162:  136,
   252  	163:  137,
   253  	164:  138,
   254  	165:  139,
   255  	166:  140,
   256  	167:  141,
   257  	168:  142,
   258  	169:  143,
   259  	170:  144,
   260  	171:  145,
   261  	172:  146,
   262  	173:  147,
   263  	174:  148,
   264  	175:  149,
   265  	176:  150,
   266  	177:  151,
   267  	178:  152,
   268  	179:  153,
   269  	180:  154,
   270  	181:  155,
   271  	182:  156,
   272  	183:  157,
   273  	184:  158,
   274  	185:  159,
   275  	186:  160,
   276  	187:  161,
   277  	188:  162,
   278  	189:  163,
   279  	190:  164,
   280  	191:  165,
   281  	208:  166,
   282  	240:  166,
   283  	215:  167,
   284  	222:  168,
   285  	254:  168,
   286  	247:  169,
   287  	255:  170,
   288  }