Debian Codegraph @

components/chsdet/src/mbclass/SJISLangModel.inc

raw
1 const
2
3
4 SJIS_cls: array [0..255] of byte = (
5 1,1,1,1,1,1,1,1, // 00 - 07
6 1,1,1,1,1,1,0,0, // 08 - 0f
7 1,1,1,1,1,1,1,1, // 10 - 17
8 1,1,1,0,1,1,1,1, // 18 - 1f
9 1,1,1,1,1,1,1,1, // 20 - 27
10 1,1,1,1,1,1,1,1, // 28 - 2f
11 1,1,1,1,1,1,1,1, // 30 - 37
12 1,1,1,1,1,1,1,1, // 38 - 3f
13 2,2,2,2,2,2,2,2, // 40 - 47
14 2,2,2,2,2,2,2,2, // 48 - 4f
15 2,2,2,2,2,2,2,2, // 50 - 57
16 2,2,2,2,2,2,2,2, // 58 - 5f
17 2,2,2,2,2,2,2,2, // 60 - 67
18 2,2,2,2,2,2,2,2, // 68 - 6f
19 2,2,2,2,2,2,2,2, // 70 - 77
20 2,2,2,2,2,2,2,1, // 78 - 7f
21 3,3,3,3,3,3,3,3, // 80 - 87
22 3,3,3,3,3,3,3,3, // 88 - 8f
23 3,3,3,3,3,3,3,3, // 90 - 97
24 3,3,3,3,3,3,3,3, // 98 - 9f
25 //0xa0 is illegal in sjis encoding, but some pages does
26 //contain such byte. We need to be more error forgiven.
27 2,2,2,2,2,2,2,2, // a0 - a7
28 2,2,2,2,2,2,2,2, // a8 - af
29 2,2,2,2,2,2,2,2, // b0 - b7
30 2,2,2,2,2,2,2,2, // b8 - bf
31 2,2,2,2,2,2,2,2, // c0 - c7
32 2,2,2,2,2,2,2,2, // c8 - cf
33 2,2,2,2,2,2,2,2, // d0 - d7
34 2,2,2,2,2,2,2,2, // d8 - df
35 3,3,3,3,3,3,3,3, // e0 - e7
36 3,3,3,3,3,4,4,4, // e8 - ef
37 4,4,4,4,4,4,4,4, // f0 - f7
38 4,4,4,4,4,0,0,0 // f8 - ff
39 );
40
41 SJIS_st: array [0..23] of byte = (
42 byte(eError),byte(eStart),byte(eStart), 3,byte(eError),byte(eError),byte(eError),byte(eError),//00-07
43 byte(eError),byte(eError),byte(eError),byte(eError),byte(eItsMe),byte(eItsMe),byte(eItsMe),byte(eItsMe),//08-0f
44 byte(eItsMe),byte(eItsMe),byte(eError),byte(eError),byte(eStart),byte(eStart),byte(eStart),byte(eStart) //10-17
45 );
46
47 SJISCharLenTable: array [0..5] of byte = (0, 1, 1, 2, 0, 0);
48
49 SJISLangModel: SMModel = (
50 classTable: @SJIS_cls;
51 classFactor: 6;
52 stateTable: @SJIS_st;
53 charLenTable: @SJISCharLenTable;
54 CharsetID: SHIFT_JIS_CHARSET;
55 );
56 // SJISLangModel: SMModel = (
57 // classTable: (
58 // idxsft: eIdxSft4bits;
59 // sftmsk: eSftMsk4bits;
60 // bitsft: eBitSft4bits;
61 // unitmsk: eUnitMsk4bits;
62 // data: @SJIS_cls;
63 // );
64 // classFactor: 6;
65 // stateTable: (
66 // idxsft: eIdxSft4bits;
67 // sftmsk: eSftMsk4bits;
68 // bitsft: eBitSft4bits;
69 // unitmsk: eUnitMsk4bits;
70 // data: @SJIS_st;
71 // );
72 // charLenTable: @SJISCharLenTable;
73 // CharsetID: SHIFT_JIS_CHARSET;
74 // );
75