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