-
Notifications
You must be signed in to change notification settings - Fork 6
/
EUCJPStatistics.cs
242 lines (234 loc) · 9.4 KB
/
EUCJPStatistics.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
/*
* Created by SharpDevelop.
* User: Administrator
* Date: 2006-12-16
* Time: 3:11
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
namespace NChardet
{
/// <summary>
/// Description of EUCJPStatistics.
/// </summary>
public class EUCJPStatistics : EUCStatistics
{
static float[] _mFirstByteFreq ;
static float _mFirstByteStdDev;
static float _mFirstByteMean;
static float _mFirstByteWeight;
static float[] _mSecondByteFreq;
static float _mSecondByteStdDev;
static float _mSecondByteMean;
static float _mSecondByteWeight;
public override float[] mFirstByteFreq() { return _mFirstByteFreq; }
public override float mFirstByteStdDev() { return _mFirstByteStdDev; }
public override float mFirstByteMean() { return _mFirstByteMean; }
public override float mFirstByteWeight() { return _mFirstByteWeight; }
public override float[] mSecondByteFreq() { return _mSecondByteFreq; }
public override float mSecondByteStdDev() { return _mSecondByteStdDev; }
public override float mSecondByteMean() { return _mSecondByteMean; }
public override float mSecondByteWeight() { return _mSecondByteWeight; }
public EUCJPStatistics() {
_mFirstByteFreq = new float[] {
0.364808f, // FreqH[a1]
0.000000f, // FreqH[a2]
0.000000f, // FreqH[a3]
0.145325f, // FreqH[a4]
0.304891f, // FreqH[a5]
0.000000f, // FreqH[a6]
0.000000f, // FreqH[a7]
0.000000f, // FreqH[a8]
0.000000f, // FreqH[a9]
0.000000f, // FreqH[aa]
0.000000f, // FreqH[ab]
0.000000f, // FreqH[ac]
0.000000f, // FreqH[ad]
0.000000f, // FreqH[ae]
0.000000f, // FreqH[af]
0.001835f, // FreqH[b0]
0.010771f, // FreqH[b1]
0.006462f, // FreqH[b2]
0.001157f, // FreqH[b3]
0.002114f, // FreqH[b4]
0.003231f, // FreqH[b5]
0.001356f, // FreqH[b6]
0.007420f, // FreqH[b7]
0.004189f, // FreqH[b8]
0.003231f, // FreqH[b9]
0.003032f, // FreqH[ba]
0.033190f, // FreqH[bb]
0.006303f, // FreqH[bc]
0.006064f, // FreqH[bd]
0.009973f, // FreqH[be]
0.002354f, // FreqH[bf]
0.003670f, // FreqH[c0]
0.009135f, // FreqH[c1]
0.001675f, // FreqH[c2]
0.002792f, // FreqH[c3]
0.002194f, // FreqH[c4]
0.014720f, // FreqH[c5]
0.011928f, // FreqH[c6]
0.000878f, // FreqH[c7]
0.013124f, // FreqH[c8]
0.001077f, // FreqH[c9]
0.009295f, // FreqH[ca]
0.003471f, // FreqH[cb]
0.002872f, // FreqH[cc]
0.002433f, // FreqH[cd]
0.000957f, // FreqH[ce]
0.001636f, // FreqH[cf]
0.000000f, // FreqH[d0]
0.000000f, // FreqH[d1]
0.000000f, // FreqH[d2]
0.000000f, // FreqH[d3]
0.000000f, // FreqH[d4]
0.000000f, // FreqH[d5]
0.000000f, // FreqH[d6]
0.000000f, // FreqH[d7]
0.000000f, // FreqH[d8]
0.000000f, // FreqH[d9]
0.000000f, // FreqH[da]
0.000000f, // FreqH[db]
0.000000f, // FreqH[dc]
0.000000f, // FreqH[dd]
0.000080f, // FreqH[de]
0.000279f, // FreqH[df]
0.000000f, // FreqH[e0]
0.000000f, // FreqH[e1]
0.000000f, // FreqH[e2]
0.000000f, // FreqH[e3]
0.000000f, // FreqH[e4]
0.000000f, // FreqH[e5]
0.000000f, // FreqH[e6]
0.000000f, // FreqH[e7]
0.000000f, // FreqH[e8]
0.000000f, // FreqH[e9]
0.000000f, // FreqH[ea]
0.000000f, // FreqH[eb]
0.000000f, // FreqH[ec]
0.000000f, // FreqH[ed]
0.000000f, // FreqH[ee]
0.000000f, // FreqH[ef]
0.000000f, // FreqH[f0]
0.000000f, // FreqH[f1]
0.000000f, // FreqH[f2]
0.000000f, // FreqH[f3]
0.000000f, // FreqH[f4]
0.000000f, // FreqH[f5]
0.000000f, // FreqH[f6]
0.000000f, // FreqH[f7]
0.000000f, // FreqH[f8]
0.000000f, // FreqH[f9]
0.000000f, // FreqH[fa]
0.000000f, // FreqH[fb]
0.000000f, // FreqH[fc]
0.000080f, // FreqH[fd]
0.000000f // FreqH[fe]
};
_mFirstByteStdDev = 0.050407f; // Lead Byte StdDev
_mFirstByteMean = 0.010638f; // Lead Byte Mean
_mFirstByteWeight = 0.640871f; // Lead Byte Weight
_mSecondByteFreq = new float[] {
0.002473f, // FreqL[a1]
0.039134f, // FreqL[a2]
0.152745f, // FreqL[a3]
0.009694f, // FreqL[a4]
0.000359f, // FreqL[a5]
0.022180f, // FreqL[a6]
0.000758f, // FreqL[a7]
0.004308f, // FreqL[a8]
0.000160f, // FreqL[a9]
0.002513f, // FreqL[aa]
0.003072f, // FreqL[ab]
0.001316f, // FreqL[ac]
0.003830f, // FreqL[ad]
0.001037f, // FreqL[ae]
0.003590f, // FreqL[af]
0.000957f, // FreqL[b0]
0.000160f, // FreqL[b1]
0.000239f, // FreqL[b2]
0.006462f, // FreqL[b3]
0.001596f, // FreqL[b4]
0.031554f, // FreqL[b5]
0.001316f, // FreqL[b6]
0.002194f, // FreqL[b7]
0.016555f, // FreqL[b8]
0.003271f, // FreqL[b9]
0.000678f, // FreqL[ba]
0.000598f, // FreqL[bb]
0.206438f, // FreqL[bc]
0.000718f, // FreqL[bd]
0.001077f, // FreqL[be]
0.003710f, // FreqL[bf]
0.001356f, // FreqL[c0]
0.001356f, // FreqL[c1]
0.000439f, // FreqL[c2]
0.004388f, // FreqL[c3]
0.005704f, // FreqL[c4]
0.000878f, // FreqL[c5]
0.010172f, // FreqL[c6]
0.007061f, // FreqL[c7]
0.014680f, // FreqL[c8]
0.000638f, // FreqL[c9]
0.025730f, // FreqL[ca]
0.002792f, // FreqL[cb]
0.000718f, // FreqL[cc]
0.001795f, // FreqL[cd]
0.091551f, // FreqL[ce]
0.000758f, // FreqL[cf]
0.003909f, // FreqL[d0]
0.000558f, // FreqL[d1]
0.031195f, // FreqL[d2]
0.007061f, // FreqL[d3]
0.001316f, // FreqL[d4]
0.022579f, // FreqL[d5]
0.006981f, // FreqL[d6]
0.007260f, // FreqL[d7]
0.001117f, // FreqL[d8]
0.000239f, // FreqL[d9]
0.012127f, // FreqL[da]
0.000878f, // FreqL[db]
0.003790f, // FreqL[dc]
0.001077f, // FreqL[dd]
0.000758f, // FreqL[de]
0.002114f, // FreqL[df]
0.002234f, // FreqL[e0]
0.000678f, // FreqL[e1]
0.002992f, // FreqL[e2]
0.003311f, // FreqL[e3]
0.023416f, // FreqL[e4]
0.001237f, // FreqL[e5]
0.002753f, // FreqL[e6]
0.005146f, // FreqL[e7]
0.002194f, // FreqL[e8]
0.007021f, // FreqL[e9]
0.008497f, // FreqL[ea]
0.013763f, // FreqL[eb]
0.011768f, // FreqL[ec]
0.006303f, // FreqL[ed]
0.001915f, // FreqL[ee]
0.000638f, // FreqL[ef]
0.008776f, // FreqL[f0]
0.000918f, // FreqL[f1]
0.003431f, // FreqL[f2]
0.057603f, // FreqL[f3]
0.000439f, // FreqL[f4]
0.000439f, // FreqL[f5]
0.000758f, // FreqL[f6]
0.002872f, // FreqL[f7]
0.001675f, // FreqL[f8]
0.011050f, // FreqL[f9]
0.000000f, // FreqL[fa]
0.000279f, // FreqL[fb]
0.012127f, // FreqL[fc]
0.000718f, // FreqL[fd]
0.007380f // FreqL[fe]
};
_mSecondByteStdDev = 0.028247f; // Trail Byte StdDev
_mSecondByteMean = 0.010638f; // Trail Byte Mean
_mSecondByteWeight = 0.359129f; // Trial Byte Weight
}
}
}