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