| 1 |
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
| 2 |
/* ***** BEGIN LICENSE BLOCK ***** |
| 3 |
* Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
| 4 |
* |
| 5 |
* The contents of this file are subject to the Mozilla Public License Version |
| 6 |
* 1.1 (the "License"); you may not use this file except in compliance with |
| 7 |
* the License. You may obtain a copy of the License at |
| 8 |
* http://www.mozilla.org/MPL/ |
| 9 |
* |
| 10 |
* Software distributed under the License is distributed on an "AS IS" basis, |
| 11 |
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License |
| 12 |
* for the specific language governing rights and limitations under the |
| 13 |
* License. |
| 14 |
* |
| 15 |
* The Original Code is Mozilla Communicator client code. |
| 16 |
* |
| 17 |
* The Initial Developer of the Original Code is |
| 18 |
* Netscape Communications Corporation. |
| 19 |
* Portions created by the Initial Developer are Copyright (C) 1998 |
| 20 |
* the Initial Developer. All Rights Reserved. |
| 21 |
* |
| 22 |
* Contributor(s): |
| 23 |
* |
| 24 |
* Alternatively, the contents of this file may be used under the terms of |
| 25 |
* either the GNU General Public License Version 2 or later (the "GPL"), or |
| 26 |
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), |
| 27 |
* in which case the provisions of the GPL or the LGPL are applicable instead |
| 28 |
* of those above. If you wish to allow use of your version of this file only |
| 29 |
* under the terms of either the GPL or the LGPL, and not to allow others to |
| 30 |
* use your version of this file under the terms of the MPL, indicate your |
| 31 |
* decision by deleting the provisions above and replace them with the notice |
| 32 |
* and other provisions required by the GPL or the LGPL. If you do not delete |
| 33 |
* the provisions above, a recipient may use your version of this file under |
| 34 |
* the terms of any one of the MPL, the GPL or the LGPL. |
| 35 |
* |
| 36 |
* ***** END LICENSE BLOCK ***** */ |
| 37 |
|
| 38 |
#include "../nsSBCharSetProber.h" |
| 39 |
|
| 40 |
/********* Language model for: Greek *********/ |
| 41 |
|
| 42 |
/** |
| 43 |
* Generated by BuildLangModel.py |
| 44 |
* On: 2016-05-25 15:21:50.073117 |
| 45 |
**/ |
| 46 |
|
| 47 |
/* Character Mapping Table: |
| 48 |
* ILL: illegal character. |
| 49 |
* CTR: control character specific to the charset. |
| 50 |
* RET: carriage/return. |
| 51 |
* SYM: symbol (punctuation) that does not belong to word. |
| 52 |
* NUM: 0 - 9. |
| 53 |
* |
| 54 |
* Other characters are ordered by probabilities |
| 55 |
* (0 is the most common character in the language). |
| 56 |
* |
| 57 |
* Orders are generic to a language. So the codepoint with order X in |
| 58 |
* CHARSET1 maps to the same character as the codepoint with the same |
| 59 |
* order X in CHARSET2 for the same language. |
| 60 |
* As such, it is possible to get missing order. For instance the |
| 61 |
* ligature of 'o' and 'e' exists in ISO-8859-15 but not in ISO-8859-1 |
| 62 |
* even though they are both used for French. Same for the euro sign. |
| 63 |
*/ |
| 64 |
static const unsigned char Windows_1253_CharToOrderMap[] = |
| 65 |
{ |
| 66 |
CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */ |
| 67 |
CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */ |
| 68 |
SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */ |
| 69 |
NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */ |
| 70 |
SYM, 32, 46, 41, 40, 30, 52, 48, 42, 33, 56, 49, 39, 44, 36, 34, /* 4X */ |
| 71 |
47, 59, 35, 38, 37, 43, 54, 50, 58, 53, 57,SYM,SYM,SYM,SYM,SYM, /* 5X */ |
| 72 |
SYM, 32, 46, 41, 40, 30, 52, 48, 42, 33, 56, 49, 39, 44, 36, 34, /* 6X */ |
| 73 |
47, 59, 35, 38, 37, 43, 54, 50, 58, 53, 57,SYM,SYM,SYM,SYM,CTR, /* 7X */ |
| 74 |
SYM,ILL,SYM,SYM,SYM,SYM,SYM,SYM,ILL,SYM,ILL,SYM,ILL,ILL,ILL,ILL, /* 8X */ |
| 75 |
ILL,SYM,SYM,SYM,SYM,SYM,SYM,SYM,ILL,SYM,ILL,SYM,ILL,ILL,ILL,ILL, /* 9X */ |
| 76 |
SYM,SYM, 17,SYM,SYM,SYM,SYM,SYM,SYM,SYM,ILL,SYM,SYM,SYM,SYM,SYM, /* AX */ |
| 77 |
SYM,SYM,SYM,SYM,SYM, 62,SYM,SYM, 19, 22, 15,SYM, 16,SYM, 24, 28, /* BX */ |
| 78 |
55, 0, 25, 18, 20, 5, 29, 10, 26, 3, 8, 14, 13, 4, 31, 1, /* CX */ |
| 79 |
11, 6,ILL, 7, 2, 12, 27, 23, 45, 21, 51, 60, 17, 19, 22, 15, /* DX */ |
| 80 |
61, 0, 25, 18, 20, 5, 29, 10, 26, 3, 8, 14, 13, 4, 31, 1, /* EX */ |
| 81 |
11, 6, 9, 7, 2, 12, 27, 23, 45, 21, 51, 60, 16, 24, 28,ILL, /* FX */ |
| 82 |
}; |
| 83 |
/*X0 X1 X2 X3 X4 X5 X6 X7 X8 X9 XA XB XC XD XE XF */ |
| 84 |
|
| 85 |
static const unsigned char Iso_8859_7_CharToOrderMap[] = |
| 86 |
{ |
| 87 |
CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,RET,CTR,CTR,RET,CTR,CTR, /* 0X */ |
| 88 |
CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 1X */ |
| 89 |
SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM, /* 2X */ |
| 90 |
NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,SYM,SYM,SYM,SYM,SYM,SYM, /* 3X */ |
| 91 |
SYM, 32, 46, 41, 40, 30, 52, 48, 42, 33, 56, 49, 39, 44, 36, 34, /* 4X */ |
| 92 |
47, 59, 35, 38, 37, 43, 54, 50, 58, 53, 57,SYM,SYM,SYM,SYM,SYM, /* 5X */ |
| 93 |
SYM, 32, 46, 41, 40, 30, 52, 48, 42, 33, 56, 49, 39, 44, 36, 34, /* 6X */ |
| 94 |
47, 59, 35, 38, 37, 43, 54, 50, 58, 53, 57,SYM,SYM,SYM,SYM,CTR, /* 7X */ |
| 95 |
CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 8X */ |
| 96 |
CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR,CTR, /* 9X */ |
| 97 |
SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,SYM,ILL,SYM, /* AX */ |
| 98 |
SYM,SYM,SYM,SYM,SYM,SYM, 17,SYM, 19, 22, 15,SYM, 16,SYM, 24, 28, /* BX */ |
| 99 |
55, 0, 25, 18, 20, 5, 29, 10, 26, 3, 8, 14, 13, 4, 31, 1, /* CX */ |
| 100 |
11, 6,ILL, 7, 2, 12, 27, 23, 45, 21, 51, 60, 17, 19, 22, 15, /* DX */ |
| 101 |
61, 0, 25, 18, 20, 5, 29, 10, 26, 3, 8, 14, 13, 4, 31, 1, /* EX */ |
| 102 |
11, 6, 9, 7, 2, 12, 27, 23, 45, 21, 51, 60, 16, 24, 28,ILL, /* FX */ |
| 103 |
}; |
| 104 |
/*X0 X1 X2 X3 X4 X5 X6 X7 X8 X9 XA XB XC XD XE XF */ |
| 105 |
|
| 106 |
|
| 107 |
/* Model Table: |
| 108 |
* Total sequences: 1579 |
| 109 |
* First 512 sequences: 0.958419074626211 |
| 110 |
* Next 512 sequences (512-1024): 0.03968891876305471 |
| 111 |
* Rest: 0.0018920066107342773 |
| 112 |
* Negative sequences: TODO |
| 113 |
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
0,0,0,0,0,0,1,3,0,3,3,3,2,1,2,2,2,1,1,3,2,2,0, |
| 192 |
0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0, |
| 193 |
0,0,0,0,0,0,0,2,0,2,2,2,1,1,3,2,2,1,2,2,2,2,0, |
| 194 |
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, |
| 195 |
0,0,0,0,0,0,0,3,0,3,3,2,1,1,2,2,2,2,1,1,2,2,0, |
| 196 |
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, |
| 197 |
0,0,0,0,0,0,0,3,0,2,2,2,2,1,1,2,2,1,2,1,2,1,0, |
| 198 |
0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, |
| 199 |
0,0,0,0,0,0,0,2,0,2,2,2,2,1,2,1,2,2,2,3,2,1,0, |
| 200 |
0,0,0,0,0,0,0,0,0,0,0,1,0,2,0,0,0,0,0,0,0,0,0, |
| 201 |
0,0,0,0,0,0,0,3,0,2,2,2,2,2,2,1,2,1,1,1,2,2,0, |
| 202 |
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, |
| 203 |
0,0,0,0,0,0,0,2,0,2,2,1,2,2,2,2,2,2,2,1,1,2,0, |
| 204 |
1,0,0,1,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0, |
| 205 |
0,0,0,0,0,0,0,3,0,2,2,2,1,1,1,2,2,1,1,1,2,2,0, |
| 206 |
2,2,0,2,0,3,0,0,0,0,3,0,2,0,0,2,1,1,0,1,0,1,2, |
| 207 |
0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, |
| 208 |
}; |
| 209 |
|
| 210 |
|
| 211 |
const SequenceModel Windows_1253GreekModel = |
| 212 |
{ |
| 213 |
Windows_1253_CharToOrderMap, |
| 214 |
GreekLangModel, |
| 215 |
46, |
| 216 |
(float)0.958419074626211, |
| 217 |
PR_FALSE, |
| 218 |
"WINDOWS-1253" |
| 219 |
}; |
| 220 |
|
| 221 |
const SequenceModel Iso_8859_7GreekModel = |
| 222 |
{ |
| 223 |
Iso_8859_7_CharToOrderMap, |
| 224 |
GreekLangModel, |
| 225 |
46, |
| 226 |
(float)0.958419074626211, |
| 227 |
PR_FALSE, |
| 228 |
"ISO-8859-7" |
| 229 |
}; |