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

243

244

245

246

247

248

249

250

251

252

253

254

255

256

257

258

259

260

261

262

263

264

265

266

267

268

269

270

271

272

273

274

275

276

277

278

279

280

281

282

283

284

285

286

287

288

289

290

291

292

293

294

295

296

297

298

299

300

301

302

303

304

305

306

307

308

309

310

311

312

313

314

315

316

317

318

319

320

321

322

323

324

325

326

327

328

329

330

331

332

333

######################## BEGIN LICENSE BLOCK ######################## 

# The Original Code is Mozilla Communicator client code. 

# 

# The Initial Developer of the Original Code is 

# Netscape Communications Corporation. 

# Portions created by the Initial Developer are Copyright (C) 1998 

# the Initial Developer. All Rights Reserved. 

# 

# Contributor(s): 

# Mark Pilgrim - port to Python 

# 

# This library is free software; you can redistribute it and/or 

# modify it under the terms of the GNU Lesser General Public 

# License as published by the Free Software Foundation; either 

# version 2.1 of the License, or (at your option) any later version. 

# 

# This library 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 

# Lesser General Public License for more details. 

# 

# You should have received a copy of the GNU Lesser General Public 

# License along with this library; if not, write to the Free Software 

# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 

# 02110-1301 USA 

######################### END LICENSE BLOCK ######################### 

 

# KOI8-R language model 

# Character Mapping Table: 

KOI8R_char_to_order_map = ( 

255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255, # 00 

255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, # 10 

253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253, # 20 

252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253, # 30 

253,142,143,144,145,146,147,148,149,150,151,152, 74,153, 75,154, # 40 

155,156,157,158,159,160,161,162,163,164,165,253,253,253,253,253, # 50 

253, 71,172, 66,173, 65,174, 76,175, 64,176,177, 77, 72,178, 69, # 60 

67,179, 78, 73,180,181, 79,182,183,184,185,253,253,253,253,253, # 70 

191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206, # 80 

207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222, # 90 

223,224,225, 68,226,227,228,229,230,231,232,233,234,235,236,237, # a0 

238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253, # b0 

27, 3, 21, 28, 13, 2, 39, 19, 26, 4, 23, 11, 8, 12, 5, 1, # c0 

15, 16, 9, 7, 6, 14, 24, 10, 17, 18, 20, 25, 30, 29, 22, 54, # d0 

59, 37, 44, 58, 41, 48, 53, 46, 55, 42, 60, 36, 49, 38, 31, 34, # e0 

35, 43, 45, 32, 40, 52, 56, 33, 61, 62, 51, 57, 47, 63, 50, 70, # f0 

) 

 

win1251_char_to_order_map = ( 

255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255, # 00 

255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, # 10 

253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253, # 20 

252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253, # 30 

253,142,143,144,145,146,147,148,149,150,151,152, 74,153, 75,154, # 40 

155,156,157,158,159,160,161,162,163,164,165,253,253,253,253,253, # 50 

253, 71,172, 66,173, 65,174, 76,175, 64,176,177, 77, 72,178, 69, # 60 

67,179, 78, 73,180,181, 79,182,183,184,185,253,253,253,253,253, # 70 

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,243,244,245,246, 68,247,248,249,250,251,252,253, 

37, 44, 33, 46, 41, 48, 56, 51, 42, 60, 36, 49, 38, 31, 34, 35, 

45, 32, 40, 52, 53, 55, 58, 50, 57, 63, 70, 62, 61, 47, 59, 43, 

3, 21, 10, 19, 13, 2, 24, 20, 4, 23, 11, 8, 12, 5, 1, 15, 

9, 7, 6, 14, 39, 26, 28, 22, 25, 29, 54, 18, 17, 30, 27, 16, 

) 

 

latin5_char_to_order_map = ( 

255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255, # 00 

255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, # 10 

253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253, # 20 

252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253, # 30 

253,142,143,144,145,146,147,148,149,150,151,152, 74,153, 75,154, # 40 

155,156,157,158,159,160,161,162,163,164,165,253,253,253,253,253, # 50 

253, 71,172, 66,173, 65,174, 76,175, 64,176,177, 77, 72,178, 69, # 60 

67,179, 78, 73,180,181, 79,182,183,184,185,253,253,253,253,253, # 70 

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, 

37, 44, 33, 46, 41, 48, 56, 51, 42, 60, 36, 49, 38, 31, 34, 35, 

45, 32, 40, 52, 53, 55, 58, 50, 57, 63, 70, 62, 61, 47, 59, 43, 

3, 21, 10, 19, 13, 2, 24, 20, 4, 23, 11, 8, 12, 5, 1, 15, 

9, 7, 6, 14, 39, 26, 28, 22, 25, 29, 54, 18, 17, 30, 27, 16, 

239, 68,240,241,242,243,244,245,246,247,248,249,250,251,252,255, 

) 

 

macCyrillic_char_to_order_map = ( 

255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255, # 00 

255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, # 10 

253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253, # 20 

252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253, # 30 

253,142,143,144,145,146,147,148,149,150,151,152, 74,153, 75,154, # 40 

155,156,157,158,159,160,161,162,163,164,165,253,253,253,253,253, # 50 

253, 71,172, 66,173, 65,174, 76,175, 64,176,177, 77, 72,178, 69, # 60 

67,179, 78, 73,180,181, 79,182,183,184,185,253,253,253,253,253, # 70 

37, 44, 33, 46, 41, 48, 56, 51, 42, 60, 36, 49, 38, 31, 34, 35, 

45, 32, 40, 52, 53, 55, 58, 50, 57, 63, 70, 62, 61, 47, 59, 43, 

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,243,244,245,246,247,248,249,250,251,252, 68, 16, 

3, 21, 10, 19, 13, 2, 24, 20, 4, 23, 11, 8, 12, 5, 1, 15, 

9, 7, 6, 14, 39, 26, 28, 22, 25, 29, 54, 18, 17, 30, 27,255, 

) 

 

IBM855_char_to_order_map = ( 

255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255, # 00 

255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, # 10 

253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253, # 20 

252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253, # 30 

253,142,143,144,145,146,147,148,149,150,151,152, 74,153, 75,154, # 40 

155,156,157,158,159,160,161,162,163,164,165,253,253,253,253,253, # 50 

253, 71,172, 66,173, 65,174, 76,175, 64,176,177, 77, 72,178, 69, # 60 

67,179, 78, 73,180,181, 79,182,183,184,185,253,253,253,253,253, # 70 

191,192,193,194, 68,195,196,197,198,199,200,201,202,203,204,205, 

206,207,208,209,210,211,212,213,214,215,216,217, 27, 59, 54, 70, 

3, 37, 21, 44, 28, 58, 13, 41, 2, 48, 39, 53, 19, 46,218,219, 

220,221,222,223,224, 26, 55, 4, 42,225,226,227,228, 23, 60,229, 

230,231,232,233,234,235, 11, 36,236,237,238,239,240,241,242,243, 

8, 49, 12, 38, 5, 31, 1, 34, 15,244,245,246,247, 35, 16,248, 

43, 9, 45, 7, 32, 6, 40, 14, 52, 24, 56, 10, 33, 17, 61,249, 

250, 18, 62, 20, 51, 25, 57, 30, 47, 29, 63, 22, 50,251,252,255, 

) 

 

IBM866_char_to_order_map = ( 

255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255, # 00 

255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, # 10 

253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253, # 20 

252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253, # 30 

253,142,143,144,145,146,147,148,149,150,151,152, 74,153, 75,154, # 40 

155,156,157,158,159,160,161,162,163,164,165,253,253,253,253,253, # 50 

253, 71,172, 66,173, 65,174, 76,175, 64,176,177, 77, 72,178, 69, # 60 

67,179, 78, 73,180,181, 79,182,183,184,185,253,253,253,253,253, # 70 

37, 44, 33, 46, 41, 48, 56, 51, 42, 60, 36, 49, 38, 31, 34, 35, 

45, 32, 40, 52, 53, 55, 58, 50, 57, 63, 70, 62, 61, 47, 59, 43, 

3, 21, 10, 19, 13, 2, 24, 20, 4, 23, 11, 8, 12, 5, 1, 15, 

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, 

9, 7, 6, 14, 39, 26, 28, 22, 25, 29, 54, 18, 17, 30, 27, 16, 

239, 68,240,241,242,243,244,245,246,247,248,249,250,251,252,255, 

) 

 

# Model Table: 

# total sequences: 100% 

# first 512 sequences: 97.6601% 

# first 1024 sequences: 2.3389% 

# rest sequences: 0.1237% 

# negative sequences: 0.0009% 

RussianLangModel = ( 

0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,1,1,3,3,3,3,1,3,3,3,2,3,2,3,3, 

3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,3,2,2,2,2,2,0,0,2, 

3,3,3,2,3,3,3,3,3,3,3,3,3,3,2,3,3,0,0,3,3,3,3,3,3,3,3,3,2,3,2,0, 

0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 

3,3,3,2,2,3,3,3,3,3,3,3,3,3,2,3,3,0,0,3,3,3,3,3,3,3,3,2,3,3,1,0, 

0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 

3,2,3,2,3,3,3,3,3,3,3,3,3,3,3,3,3,0,0,3,3,3,3,3,3,3,3,3,3,3,2,1, 

0,0,0,0,0,0,0,2,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 

3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,0,0,3,3,3,3,3,3,3,3,3,3,3,2,1, 

0,0,0,0,0,1,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 

3,3,3,3,3,3,3,3,2,2,2,3,1,3,3,1,3,3,3,3,2,2,3,0,2,2,2,3,3,2,1,0, 

0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0, 

3,3,3,3,3,3,2,3,3,3,3,3,2,2,3,2,3,3,3,2,1,2,2,0,1,2,2,2,2,2,2,0, 

0,0,0,0,0,0,0,2,0,0,0,0,0,0,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0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1, 

1,1,1,0,1,0,1,0,0,1,1,1,1,0,0,0,1,0,0,0,0,1,0,0,0,1,0,1,0,0,0,0, 

1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1, 

1,1,0,1,1,0,1,0,1,0,0,0,0,1,1,0,1,1,0,0,0,0,0,1,0,1,1,0,1,0,0,0, 

0,1,1,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 

0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0, 

) 

 

Koi8rModel = { 

'char_to_order_map': KOI8R_char_to_order_map, 

'precedence_matrix': RussianLangModel, 

'typical_positive_ratio': 0.976601, 

'keep_english_letter': False, 

'charset_name': "KOI8-R", 

'language': 'Russian', 

} 

 

Win1251CyrillicModel = { 

'char_to_order_map': win1251_char_to_order_map, 

'precedence_matrix': RussianLangModel, 

'typical_positive_ratio': 0.976601, 

'keep_english_letter': False, 

'charset_name': "windows-1251", 

'language': 'Russian', 

} 

 

Latin5CyrillicModel = { 

'char_to_order_map': latin5_char_to_order_map, 

'precedence_matrix': RussianLangModel, 

'typical_positive_ratio': 0.976601, 

'keep_english_letter': False, 

'charset_name': "ISO-8859-5", 

'language': 'Russian', 

} 

 

MacCyrillicModel = { 

'char_to_order_map': macCyrillic_char_to_order_map, 

'precedence_matrix': RussianLangModel, 

'typical_positive_ratio': 0.976601, 

'keep_english_letter': False, 

'charset_name': "MacCyrillic", 

'language': 'Russian', 

} 

 

Ibm866Model = { 

'char_to_order_map': IBM866_char_to_order_map, 

'precedence_matrix': RussianLangModel, 

'typical_positive_ratio': 0.976601, 

'keep_english_letter': False, 

'charset_name': "IBM866", 

'language': 'Russian', 

} 

 

Ibm855Model = { 

'char_to_order_map': IBM855_char_to_order_map, 

'precedence_matrix': RussianLangModel, 

'typical_positive_ratio': 0.976601, 

'keep_english_letter': False, 

'charset_name': "IBM855", 

'language': 'Russian', 

}