/* -*- mode: C++; tab-width: 4; c-basic-offset: 4; -*- */ /* AbiSource * * Copyright (C) 2007 Philippe Milot * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA * 02111-1307, USA. */ /* C++ code produced by gperf version 3.0.3 */ /* Command-line: gperf gperf_input */ /* Computed positions: -k'1-2' */ #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \ && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \ && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \ && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \ && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \ && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \ && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \ && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \ && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \ && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \ && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \ && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \ && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \ && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \ && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \ && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \ && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \ && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \ && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \ && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \ && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \ && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126)) /* The character set is not based on ISO-646. */ #error "gperf generated tables don't work with this execution character set. Please report a bug to ." #endif #line 5 "gperf_input" struct OXML_LangScriptAsso { char *lang; char *script; }; #define TOTAL_KEYWORDS 185 #define MIN_WORD_LENGTH 2 #define MAX_WORD_LENGTH 2 #define MIN_HASH_VALUE 6 #define MAX_HASH_VALUE 501 /* maximum key range = 496, duplicates = 0 */ class OXML_LangToScriptConverter { private: static inline unsigned int hash (const char *str, unsigned int len); public: static struct OXML_LangScriptAsso *in_word_set (const char *str, unsigned int len); }; inline unsigned int OXML_LangToScriptConverter::hash (register const char *str, register unsigned int len) { static unsigned short asso_values[] = { 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 195, 95, 39, 255, 240, 254, 89, 19, 80, 14, 190, 94, 4, 165, 159, 214, 65, 99, 5, 0, 100, 38, 55, 23, 15, 245, 170, 13, 28, 4, 35, 502, 20, 185, 210, 179, 235, 119, 38, 502, 44, 239, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502 }; return len + asso_values[(unsigned char)str[1]+19] + asso_values[(unsigned char)str[0]+3]; } struct OXML_LangScriptAsso * OXML_LangToScriptConverter::in_word_set (register const char *str, register unsigned int len) { static struct OXML_LangScriptAsso wordlist[] = { {""}, {""}, {""}, {""}, {""}, {""}, #line 170 "gperf_input" {"tn", "Latn"}, #line 146 "gperf_input" {"sd", "Arab"}, {""}, {""}, #line 111 "gperf_input" {"mn", "Mong"}, #line 154 "gperf_input" {"sn", "Latn"}, #line 145 "gperf_input" {"sc", "Latn"}, {""}, {""}, #line 169 "gperf_input" {"tl", "Latn"}, {""}, #line 167 "gperf_input" {"ti", "Ethi"}, {""}, #line 110 "gperf_input" {"ml", "Mlym"}, #line 152 "gperf_input" {"sl", "Latn"}, #line 108 "gperf_input" {"mi", "Latn"}, #line 150 "gperf_input" {"si", "Sinh"}, {""}, {""}, #line 166 "gperf_input" {"th", "Thai"}, {""}, #line 156 "gperf_input" {"sq", "Latn"}, {""}, #line 107 "gperf_input" {"mh", "Latn"}, #line 149 "gperf_input" {"sh", "Cyrl"}, {""}, #line 187 "gperf_input" {"yi", "Hebr"}, {""}, {""}, #line 153 "gperf_input" {"sm", "Latn"}, #line 63 "gperf_input" {"hi", "Deva"}, #line 171 "gperf_input" {"to", "Latn"}, {""}, {""}, #line 175 "gperf_input" {"tw", "Latn"}, #line 112 "gperf_input" {"mo", "Cyrl"}, #line 155 "gperf_input" {"so", "Latn"}, {""}, {""}, #line 162 "gperf_input" {"sw", "Latn"}, #line 176 "gperf_input" {"ty", "Latn"}, {""}, #line 186 "gperf_input" {"xh", "Latn"}, {""}, #line 116 "gperf_input" {"my", "Mymr"}, {""}, #line 188 "gperf_input" {"yo", "Latn"}, {""}, {""}, #line 182 "gperf_input" {"vi", "Latn"}, #line 64 "gperf_input" {"ho", "Latn"}, #line 165 "gperf_input" {"tg", "Arab"}, {""}, {""}, {""}, #line 106 "gperf_input" {"mg", "Latn"}, #line 148 "gperf_input" {"sg", "Latn"}, {""}, {""}, #line 68 "gperf_input" {"hy", "Armn"}, {""}, #line 163 "gperf_input" {"ta", "Taml"}, {""}, {""}, {""}, {""}, #line 144 "gperf_input" {"sa", "Deva"}, {""}, {""}, #line 183 "gperf_input" {"vo", "Latn"}, #line 31 "gperf_input" {"co", "Latn"}, {""}, {""}, {""}, {""}, #line 80 "gperf_input" {"ja", "Jpan"}, #line 71 "gperf_input" {"id", "Latn"}, {""}, {""}, #line 36 "gperf_input" {"cy", "Latn"}, #line 61 "gperf_input" {"ha", "Latn"}, {""}, {""}, {""}, {""}, #line 56 "gperf_input" {"gd", "Latn"}, #line 185 "gperf_input" {"wo", "Latn"}, {""}, {""}, #line 58 "gperf_input" {"gn", "Latn"}, {""}, #line 74 "gperf_input" {"ii", "Yiii"}, {""}, {""}, #line 101 "gperf_input" {"ln", "Latn"}, #line 25 "gperf_input" {"bn", "Beng"}, #line 164 "gperf_input" {"te", "Telu"}, {""}, #line 57 "gperf_input" {"gl", "Latn"}, #line 140 "gperf_input" {"rn", "Latn"}, #line 29 "gperf_input" {"ca", "Latn"}, #line 147 "gperf_input" {"se", "Latn"}, {""}, {""}, {""}, #line 100 "gperf_input" {"li", "Latn"}, #line 23 "gperf_input" {"bi", "Latn"}, {""}, {""}, {""}, {""}, #line 76 "gperf_input" {"io", "Latn"}, {""}, {""}, #line 22 "gperf_input" {"bh", "Deva"}, #line 62 "gperf_input" {"he", "Hebr"}, #line 184 "gperf_input" {"wa", "Latn"}, {""}, {""}, #line 24 "gperf_input" {"bm", "Latn"}, #line 161 "gperf_input" {"sv", "Latn"}, {""}, {""}, #line 139 "gperf_input" {"rm", "Latn"}, {""}, #line 102 "gperf_input" {"lo", "Laoo"}, #line 26 "gperf_input" {"bo", "Tibt"}, {""}, {""}, #line 81 "gperf_input" {"jv", "Java"}, #line 141 "gperf_input" {"ro", "Latn"}, #line 73 "gperf_input" {"ig", "Latn"}, {""}, #line 143 "gperf_input" {"rw", "Latn"}, #line 181 "gperf_input" {"ve", "Latn"}, #line 30 "gperf_input" {"ce", "Cyrl"}, {""}, {""}, {""}, {""}, {""}, #line 70 "gperf_input" {"ia", "Latn"}, {""}, {""}, {""}, #line 99 "gperf_input" {"lg", "Latn"}, #line 21 "gperf_input" {"bg", "Cyrl"}, {""}, {""}, {""}, #line 55 "gperf_input" {"ga", "Latn"}, #line 177 "gperf_input" {"ug", "Arab"}, {""}, {""}, #line 35 "gperf_input" {"cv", "Cyrl"}, #line 97 "gperf_input" {"la", "Latn"}, #line 19 "gperf_input" {"ba", "Cyrl"}, {""}, {""}, {""}, #line 128 "gperf_input" {"oc", "Latn"}, #line 119 "gperf_input" {"nd", "Latn"}, {""}, {""}, {""}, #line 123 "gperf_input" {"nn", "Latn"}, #line 168 "gperf_input" {"tk", "Latn"}, {""}, {""}, {""}, #line 109 "gperf_input" {"mk", "Cyrl"}, #line 151 "gperf_input" {"sk", "Latn"}, {""}, {""}, #line 122 "gperf_input" {"nl", "Latn"}, #line 174 "gperf_input" {"tt", "Cyrl"}, #line 72 "gperf_input" {"ie", "Latn"}, {""}, {""}, #line 115 "gperf_input" {"mt", "Latn"}, #line 159 "gperf_input" {"st", "Latn"}, #line 172 "gperf_input" {"tr", "Latn"}, {""}, #line 130 "gperf_input" {"om", "Latn"}, {""}, #line 113 "gperf_input" {"mr", "Deva"}, #line 157 "gperf_input" {"sr", "Cyrl"}, {""}, {""}, #line 98 "gperf_input" {"lb", "Latn"}, #line 89 "gperf_input" {"kn", "Knda"}, #line 20 "gperf_input" {"be", "Cyrl"}, {""}, {""}, #line 66 "gperf_input" {"ht", "Latn"}, #line 13 "gperf_input" {"an", "Latn"}, #line 124 "gperf_input" {"no", "Latn"}, {""}, {""}, #line 87 "gperf_input" {"kl", "Latn"}, #line 65 "gperf_input" {"hr", "Latn"}, #line 84 "gperf_input" {"ki", "Latn"}, {""}, {""}, #line 60 "gperf_input" {"gv", "Latn"}, #line 127 "gperf_input" {"ny", "Latn"}, #line 173 "gperf_input" {"ts", "Latn"}, {""}, {""}, #line 105 "gperf_input" {"lv", "Latn"}, #line 114 "gperf_input" {"ms", "Latn"}, #line 158 "gperf_input" {"ss", "Latn"}, {""}, {""}, #line 88 "gperf_input" {"km", "Khmr"}, {""}, #line 121 "gperf_input" {"ng", "Latn"}, {""}, {""}, #line 12 "gperf_input" {"am", "Ethi"}, #line 32 "gperf_input" {"cr", "Cans"}, #line 90 "gperf_input" {"ko", "Hang"}, {""}, #line 135 "gperf_input" {"pl", "Latn"}, #line 95 "gperf_input" {"kw", "Latn"}, #line 134 "gperf_input" {"pi", "Deva"}, #line 117 "gperf_input" {"na", "Latn"}, {""}, {""}, #line 10 "gperf_input" {"af", "Latn"}, #line 96 "gperf_input" {"ky", "Cyrl"}, {""}, {""}, {""}, {""}, #line 17 "gperf_input" {"ay", "Latn"}, #line 160 "gperf_input" {"su", "Latn"}, {""}, {""}, {""}, #line 43 "gperf_input" {"en", "Latn"}, #line 83 "gperf_input" {"kg", "Latn"}, {""}, {""}, {""}, #line 33 "gperf_input" {"cs", "Latn"}, #line 75 "gperf_input" {"ik", "Latn"}, {""}, {""}, #line 42 "gperf_input" {"el", "Grek"}, #line 67 "gperf_input" {"hu", "Latn"}, #line 82 "gperf_input" {"ka", "Geor"}, {""}, {""}, #line 69 "gperf_input" {"hz", "Latn"}, #line 78 "gperf_input" {"it", "Latn"}, #line 7 "gperf_input" {"aa", "Ethi"}, {""}, {""}, {""}, #line 118 "gperf_input" {"nb", "Latn"}, #line 120 "gperf_input" {"ne", "Deva"}, {""}, {""}, #line 190 "gperf_input" {"zh", "Hans"}, #line 50 "gperf_input" {"fi", "Latn"}, #line 178 "gperf_input" {"uk", "Cyrl"}, {""}, {""}, #line 103 "gperf_input" {"lt", "Latn"}, #line 34 "gperf_input" {"cu", "Cyrl"}, #line 44 "gperf_input" {"eo", "Latn"}, {""}, {""}, {""}, #line 133 "gperf_input" {"pa", "Guru"}, #line 27 "gperf_input" {"br", "Latn"}, {""}, {""}, {""}, #line 126 "gperf_input" {"nv", "Latn"}, #line 179 "gperf_input" {"ur", "Arab"}, {""}, {""}, {""}, #line 52 "gperf_input" {"fo", "Latn"}, #line 77 "gperf_input" {"is", "Latn"}, {""}, #line 49 "gperf_input" {"ff", "Latn"}, {""}, #line 8 "gperf_input" {"ab", "Cyrl"}, #line 9 "gperf_input" {"ae", "Avst"}, {""}, {""}, #line 54 "gperf_input" {"fy", "Latn"}, {""}, #line 138 "gperf_input" {"qu", "Latn"}, {""}, {""}, {""}, {""}, #line 28 "gperf_input" {"bs", "Latn"}, {""}, {""}, {""}, #line 94 "gperf_input" {"kv", "Cyrl"}, #line 189 "gperf_input" {"za", "Latn"}, {""}, {""}, {""}, #line 16 "gperf_input" {"av", "Cyrl"}, #line 79 "gperf_input" {"iu", "Cans"}, {""}, {""}, {""}, #line 48 "gperf_input" {"fa", "Arab"}, #line 37 "gperf_input" {"da", "Latn"}, {""}, {""}, {""}, #line 59 "gperf_input" {"gu", "Gujr"}, {""}, {""}, {""}, {""}, #line 104 "gperf_input" {"lu", "Latn"}, {""}, {""}, {""}, {""}, #line 142 "gperf_input" {"ru", "Cyrl"}, {""}, {""}, {""}, {""}, #line 180 "gperf_input" {"uz", "Cyrl"}, #line 41 "gperf_input" {"ee", "Latn"}, {""}, {""}, {""}, #line 131 "gperf_input" {"or", "Orya"}, {""}, {""}, {""}, {""}, {""}, #line 125 "gperf_input" {"nr", "Latn"}, {""}, {""}, {""}, {""}, #line 38 "gperf_input" {"de", "Latn"}, {""}, {""}, {""}, {""}, #line 86 "gperf_input" {"kk", "Cyrl"}, {""}, {""}, {""}, {""}, #line 11 "gperf_input" {"ak", "Latn"}, {""}, {""}, {""}, #line 132 "gperf_input" {"os", "Cyrl"}, {""}, {""}, {""}, {""}, #line 39 "gperf_input" {"dv", "Thaa"}, #line 91 "gperf_input" {"kr", "Arab"}, {""}, {""}, {""}, {""}, #line 14 "gperf_input" {"ar", "Arab"}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, #line 137 "gperf_input" {"pt", "Latn"}, {""}, {""}, {""}, {""}, {""}, {""}, #line 92 "gperf_input" {"ks", "Arab"}, {""}, {""}, {""}, #line 129 "gperf_input" {"oj", "Cans"}, #line 15 "gperf_input" {"as", "Beng"}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, #line 46 "gperf_input" {"et", "Latn"}, {""}, {""}, {""}, {""}, #line 136 "gperf_input" {"ps", "Arab"}, #line 93 "gperf_input" {"ku", "Arab"}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, #line 18 "gperf_input" {"az", "Latn"}, #line 85 "gperf_input" {"kj", "Latn"}, {""}, {""}, {""}, #line 53 "gperf_input" {"fr", "Latn"}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, #line 45 "gperf_input" {"es", "Latn"}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, #line 47 "gperf_input" {"eu", "Latn"}, {""}, {""}, {""}, {""}, #line 191 "gperf_input" {"zu", "Latn"}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, #line 40 "gperf_input" {"dz", "Tibt"}, {""}, {""}, {""}, {""}, #line 51 "gperf_input" {"fj", "Latn"} }; if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) { register int key = hash (str, len); if (key <= MAX_HASH_VALUE && key >= 0) { register const char *s = wordlist[key].lang; if (*str == *s && !strcmp (str + 1, s + 1)) return &wordlist[key]; } } return 0; }