github.com/dolthub/go-mysql-server@v0.18.0/sql/encodings/swe7_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  // Swe7_swedish_ci_RuneWeight returns the weight of a given rune based on its relational sort order from
    18  // the `swe7_swedish_ci` collation.
    19  func Swe7_swedish_ci_RuneWeight(r rune) int32 {
    20  	weight, ok := swe7_swedish_ci_Weights[r]
    21  	if ok {
    22  		return weight
    23  	} else {
    24  		return 2147483647
    25  	}
    26  }
    27  
    28  // swe7_swedish_ci_Weights contain a map from rune to weight for the `swe7_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 swe7_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  	65:  64,
    97  	97:  64,
    98  	66:  65,
    99  	98:  65,
   100  	67:  66,
   101  	99:  66,
   102  	68:  67,
   103  	100: 67,
   104  	69:  68,
   105  	101: 68,
   106  	201: 68,
   107  	233: 68,
   108  	70:  69,
   109  	102: 69,
   110  	71:  70,
   111  	103: 70,
   112  	72:  71,
   113  	104: 71,
   114  	73:  72,
   115  	105: 72,
   116  	74:  73,
   117  	106: 73,
   118  	75:  74,
   119  	107: 74,
   120  	76:  75,
   121  	108: 75,
   122  	77:  76,
   123  	109: 76,
   124  	78:  77,
   125  	110: 77,
   126  	79:  78,
   127  	111: 78,
   128  	80:  79,
   129  	112: 79,
   130  	81:  80,
   131  	113: 80,
   132  	82:  81,
   133  	114: 81,
   134  	83:  82,
   135  	115: 82,
   136  	84:  83,
   137  	116: 83,
   138  	85:  84,
   139  	117: 84,
   140  	86:  85,
   141  	118: 85,
   142  	87:  86,
   143  	119: 86,
   144  	88:  87,
   145  	120: 87,
   146  	89:  88,
   147  	121: 88,
   148  	220: 88,
   149  	252: 88,
   150  	90:  89,
   151  	122: 89,
   152  	197: 90,
   153  	229: 90,
   154  	196: 91,
   155  	228: 91,
   156  	214: 92,
   157  	246: 92,
   158  	95:  93,
   159  }