-
Notifications
You must be signed in to change notification settings - Fork 3
/
unicad.el
4857 lines (4588 loc) · 251 KB
/
unicad.el
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
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
;;; unicad.el --- An elisp port of Mozilla Universal Charset Auto Detector -*- lexical-binding: t; -*-
;;;{{{ Copyright and License
;; Copyright (C) 2006, 2007, 2008, 2010 Qichen Huang
;; $Id$
;; Author: Qichen Huang <[email protected]>
;; MELPA recipe author: chendianbuji <[email protected]>
;; Package-Requires: ((emacs "24") (nadvice "0.3"))
;; Time-stamp: <2010-04-21 15:07:12>
;; Version: 1.1.7
;; Keywords: i18n
;; URL: https://github.com/ukari/unicad
;;}}}
;; 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 3 of the License, or
;; (at your option) any later version.
;;;{{{ Commentary
;;; Commentary:
;; unicad.el is an Elisp program port from Mozilla universal charset
;; auto detector. After loading unicad in GNU Emacs, it can automatically
;; detect multiple charsets, and you will never encounter garbled files
;; in the future.
;; Put this file into your load-path and the following into your ~/.emacs:
;; (require 'unicad)
;;
;; You can toggle unicad by M-x `unicad-mode'.
;;
;; It may take a few seconds to detect some large latin-1 or latin-2 files,
;; you can byte-compile this file to speed up detecting process.
;; Following coding systems can be auto detected:
;; * (BOM detect)
;; * (ascii)
;; * multibyte coding systems:
;; - gb18030 (gb2312)
;; - big5
;; - sjis
;; - euc-jp
;; - euc-kr
;; - euc-tw
;; - utf-8
;; - utf-16le (also without signature)
;; - utf-16be (also without signature)
;; * singlebyte coding systems:
;; - greek
;; > iso-8859-7
;; > windows-1253
;; - russian
;; > koi8-r
;; > windows-1251
;; > iso-8859-5
;; > ibm855
;; - bulgarian
;; > iso-8859-5
;; > windows-1251
;; - sjis (singlebyte only)
;; * latin-1
;; * latin-2
;;; TODO:
;; Endline pattern
;; Follows are planned to be involved in next version:
;; - iso-8859-9 (turkish, latin-5)
;; - hebrew
;; - thai
;; - x-mac-cyrillic
;; - ibm866
;; - iso-2022 (Emacs itself can detect iso-2022-cn -jp and -kr corretly)
;; - hz
;; Local Variables
;;; KNOWN BUGS:
;; - (REMOVED) Conflict with ido when exit Emacs. Add `unicad-disable' to `kill-emacs-hook' to avoid this problem.
;; - Some files are too short to be detected.
;; - Some don't contain the most frequently characters, so that they can't be detected.
;; - If a japanese text file is encoded with gb18030, it's very hard to be detected.
;; - GBK characters like "毛(#xC3AB), 狮(#xCAA8)" are similar to utf-8, could be incorrectly detected.
;; So I made the priority of gbk and other charsets higher than utf-8.
;; - Detecting traditional chinese encoded in gbk is not supported in Emacs 22.1 and below,
;; because the function `decode-char' only support `ucs'.
;;
;; *** If you find undetected files, please send me a bug report and attach the files. Many thanks. ***
;;; NEED HELP:
;; If some one can provide a language model of japanese katakana (for
;; detecting sjis halfwidth katakana only files), please contact me.
;; Thanks!
;; This is an elisp port of Universal Charset Detector. However, some
;; small changes have been made to make the dectection more
;; comfortable and quickly in Emacs. For more information about
;; Mozilla Universal Charset Detector, please refer to:
;; 1. https://www-archive.mozilla.org/projects/intl/chardetinterface
;; 2. https://www-archive.mozilla.org/projects/intl/universalcharsetdetection
;;;}}}
;;;{{{ Changelog
;; v1.1.7 partially code refactoring, remove M-x `unicad', M-x `unicad-enable', M-x `unicad-disable',
;; support M-x `unicad-mode'
;; v1.1.6 do not invoke unicad by file saving.
;; v1.1.5 fixed bug in `unicad-char-after' and `unicad-universal-charset-detect' (size calc was wrong)
;; v1.1.4 Add function and variable `unicad-version'. small bug fix, correct unicad-eol from unicad-eof.
;; v1.1.3 detect dos eol-type
;; v1.1.2 (add-to-hook 'kill-emacs-hook 'unicad-disable) to avoid conflict with ido, session, etc.
;; v1.1.1 Fixed a bug in `unicad-sjis-sb-prober', added a char2order 256 for impossible char.
;; v1.1.0 Added interactive functions `unicad-enable', `unicad-disable' and `unicad'.
;; Add support for compressed files.
;; v1.0.6 Fixed a bug in `unicad-gbkcht-analyser' for some incompatitable reason.
;; v1.0.5 Changed define order to eliminate byte-compile warnings.
;; v1.0.4 remove simplified chinese in big5, it's nonsense.
;; v1.0.3 fixed charset names of utf-16le and utf-16be (without signature),
;; minor changes for `unicad-ucs2le-prober' and `unicad-ucs2be-prober'
;; v1.0.2 changed the sequence of `unicad-multibyte-group-list',
;; fixed a bug in `unicad-dist-table-get-confidence'
;; v1.0.1 add support for simplified chinese encoded in big5
;; v1.0.0 minor changes, just some tidy works
;; v0.65 fixed a bug in `unicad-gbkcht-analyser'
;; v0.64 add support for traditional chinese encoded in gbk
;; v0.63 changed the threhold in `unicad-dist-table-get-confidence'
;; v0.62 allow esc(0x1B) as legal value in utf-8, gb18030, sjis, big5, euckr
;; v0.61 add a `unicad-quick-multibyte-words', increase `unicad-quick-size' to 500
;; add support for sjis single byte only katakana files
;; v0.60 delete singlebyte-model, replace it with more reasonable variables
;; v0.52 change singlebyte-dist-table to vectors, and some other changes
;; v0.50 add support for bulgarian and latin2, change prefix to unicad-*
;; v0.40 add support for single byte coding systems
;; v0.30 change variable and function names to ucad-* prefix
;; v0.22 add BOM detector
;; v0.21 use vectors instead of class bits as it was in original Mozilla cpp code
;;}}}
;;; Code:
(require 'nadvice)
;;{{{ define variable
(defgroup unicad nil "An elisp port of Mozilla Universal Charset Auto Detector" :group 'i18n)
;;;###autoload
(define-minor-mode unicad-mode
"Toggle unicad mode"
:init-value nil
:global t
:lighter " Unicad"
:group 'unicad
(if unicad-mode
(unicad-enable)
(unicad-disable)))
(defvar unicad-version "1.1.7")
(defvar unicad-global-enable unicad-mode)
(defvar unicad-eol nil)
(defvar unicad-quick-size 500)
(defvar unicad-quick-multibyte-words 50)
(defvar unicad-quick-singlebyte-words 50)
(defvar unicad-max-size 10000)
(defvar unicad-default-coding-system 'nil)
(defvar unicad-threshold 0.95)
(defvar unicad-data-threshold 1024)
(defvar unicad-minimum-data-threshold 1)
(defvar unicad-minimum-size-threshold 10)
(defvar unicad-cjk-prefer nil
"Set preference encoding system (only for chinese, japanese, korean coding systems.).")
(defconst unicad--sure-yes 0.99)
(defconst unicad--sure-no 0.01)
(defvar unicad-best-guess nil
"(MACHINE-BEST-GUESS BEST-CONFIDENCE).")
;; (make-variable-buffer-local 'unicad-best-guess)
(defvar unicad-singlebyte-best-guess nil)
(defvar unicad-singlebyte-group-guess nil)
(defvar unicad-latin-best-guess '(latin-1 0.0))
(defvar unicad-latin1-guess
'(latin-1 0.0))
(defvar unicad-latin2-guess
'(latin-2 0.0))
(defvar unicad-chosen-gb-coding-system
(cond
((coding-system-p 'gb18030)
'gb18030)
((coding-system-p 'gbk)
'gbk)
(t 'gb2312)))
(defvar unicad-multibyte-group-list
`([sjis 0 unicad-sjis-prober]
[euc-jp 0 unicad-eucjp-prober]
[,unicad-chosen-gb-coding-system 0 unicad-gb2312-prober]
[euc-kr 0 unicad-euckr-prober]
[big5 0 unicad-big5-prober]
[euc-tw 0 unicad-euctw-prober]
[,unicad-chosen-gb-coding-system 0 unicad-gbkcht-prober]
[utf-8 0 unicad-utf8-prober]
[utf-16le 0 unicad-ucs2le-prober]
[utf-16be 0 unicad-ucs2be-prober])
"([CODING-SYSTEM BEST-CONFIDENCE PROBER-FUNCTION] ...).")
;;}}}
;;{{{ unicad-enable, unicad-disable
(defun unicad-version (&optional here)
"Return unicad version.
If optional argument HERE is non-nil, insert string at point."
(interactive "P")
(if here
(insert unicad-version)
(if (called-interactively-p 'any)
(message "%s" unicad-version)
unicad-version)))
(defun unicad-auto-chardet-wrapper (origin &rest rest)
"Wrapper for auto charset detecting.
ORIGIN is function `find-file-noselect'.
REST is the arguements for function `find-file-noselect'."
(if (>= emacs-major-version 22)
(let ((auto-coding-functions (cons 'unicad-universal-charset-detect auto-coding-functions)))
(apply origin rest))
(let ((set-auto-coding-function 'unicad-emacs21-check-coding-system))
(apply origin rest))))
(defun unicad-enable ()
"Enable Unicad function."
(advice-add #'find-file-noselect :around #'unicad-auto-chardet-wrapper))
(defun unicad-disable ()
"Disable Unicad function."
(advice-remove #'find-file-noselect #'unicad-auto-chardet-wrapper))
;;}}}
;;{{{ Auto Coding Function
(defun unicad-char-after (&optional pos)
"Get next char by POS."
(let (char)
(if pos
(setq char (char-after pos))
(setq char (char-after)))
(if (numberp char)
(progn
(if (> char #xff)
(setq char (logand char #xff)))
char)
nil)))
;; ePureAscii, eEscAscii -> unicad-default-coding-system
;; eHighbyte -> multibyte-group-prober -> latin1->prober
(defun unicad-universal-charset-detect (size)
"Detect charset with SIZE range."
;;(goto-char (point-min))
(when (and (not (local-variable-p 'buffer-file-coding-system))
(not (buffer-modified-p)))
(let ((_buf (current-buffer)))
;; (make-local-variable 'unicad-best-guess)
;; (make-local-variable 'unicad-singlebyte-best-guess)
;; (make-local-variable 'unicad-singlebyte-group-guess)
;; (make-local-variable 'unicad-latin-best-guess)
;; (make-local-variable 'unicad-latin1-guess)
;; (make-local-variable 'unicad-latin2-guess)
;; (make-local-variable 'unicad-multibyte-group-list)
(save-excursion
(goto-char (point-min))
(let (;;(end (+ (point) (min size unicad-max-size)))
(end (min size (+ (point) unicad-max-size)))
(input-state 'ePureAscii)
(code0 0)
prober-result
code1 _code2 state
start quick-start quick-end)
(setq unicad-eol nil)
(unless (setq prober-result (unicad-bom-detect))
(goto-char (point-min))
(while (and (not (eq state 'mDone))
(eq input-state 'ePureAscii)
(< (point) end))
(setq code1 (unicad-char-after))
;; (if (not (numberp code1))
;; (message "code1 nil %d, end point %d" (point) end))
(forward-char 1)
(if (and (= code0 #x0D) (= code1 #x0A))
(setq unicad-eol 1))
(if (and (>= code1 #x80)
(/= code1 #xA0)) ;; since many Ascii only page contains NBSP
;; we got a non-ascii byte (high-byte)
(setq input-state 'eHighbyte
start (1- (point)))
;; OK, just pure ascii so far
(if (and (eq input-state 'ePureAscii)
(or (= code1 #x1B) ;; ESC char
(and (= code1 ?{ ) (= code0 ?~ )))) ;; HZ "~{"
;; found escape character or HZ "~{"
(setq input-state 'eEscAscii
start (1- (point))))
(setq code0 code1)))
(cond
((eq input-state 'eEscAscii)
;; actually emacs itself can tell the esc charset very well
;; so we don't need to do ourselves
;; (unicad-esc-group-prober (point-min) end)
)
((eq input-state 'eHighbyte)
(if (> (- end start) unicad-quick-size)
(setq quick-start start
quick-end (+ unicad-quick-size start))
(setq quick-start start
quick-end end))
(let ((maxConfidence 0.0)
quick-status)
(cond
((eq (setq quick-status
(unicad-multibyte-group-prober quick-start quick-end)) 'eFoundIt)
(setq prober-result (car unicad-best-guess))
(setq maxConfidence unicad--sure-yes))
((and (not (eq quick-status 'eNotMe))
(/= quick-end end)
(eq (unicad-multibyte-group-prober start end) 'eFoundIt))
(setq prober-result (car unicad-best-guess))
(setq maxConfidence unicad--sure-yes))
((eq (unicad-singlebyte-group-prober start end) 'eFoundIt)
(setq prober-result (car unicad-singlebyte-best-guess)))
(t
(setq maxConfidence (unicad-latin-group-prober start end))
(if (> (cadr unicad-singlebyte-best-guess) (cadr unicad-best-guess))
;; (set (make-local-variable 'unicad-best-guess) unicad-singlebyte-best-guess)
(setq unicad-best-guess unicad-singlebyte-best-guess))
(if (> maxConfidence (cadr unicad-best-guess))
(setq prober-result (car unicad-latin-best-guess)
unicad-best-guess unicad-latin-best-guess)
(setq prober-result (car unicad-best-guess)
maxConfidence (cadr unicad-best-guess)))))))))
;; (test-foo)
;; (message "%S" (current-buffer))
(unless (coding-system-p prober-result)
(setq prober-result unicad-default-coding-system))
(if (null prober-result) (setq prober-result 'undecided))
(when (numberp unicad-eol)
(if (null (numberp (coding-system-eol-type prober-result)))
(if (and unicad-eol (= unicad-eol 1))
;; i want to skip unix eol
(setq prober-result (aref (coding-system-eol-type prober-result) unicad-eol)))))
;; (if (and unicad-eol (= unicad-eol 1))
;; (message "unicad dos.")
;; (message "unicad unix/mac."))
(or prober-result unicad-default-coding-system))))))
(defun unicad-emacs21-check-coding-system (filename size)
"Check coding system with FILENAME and within SIZE range."
(let (coding-system)
(setq coding-system (set-auto-coding filename size))
(unless coding-system
(setq coding-system (unicad-universal-charset-detect size)))
coding-system))
;;}}}
;;{{{ BOM detector
(defun unicad-bom-detect ()
"BOM detector.
For detecting the signature of utf-8, utf-16le, utf-16be ..."
(save-excursion
(goto-char (point-min))
(when (> (point-max) 3)
(let (code0 code1 code2 code3)
(setq code0 (unicad-char-after))
(forward-char)
(setq code1 (unicad-char-after))
(forward-char)
(setq code2 (unicad-char-after))
(forward-char)
(setq code3 (unicad-char-after))
(forward-char)
(cond
((and (= code0 #xEF)
(= code1 #xBB)
(= code2 #xBF))
'utf-8)
((and (= code0 #xFE)
(= code1 #xFF)
(= code2 #x00)
(= code3 #x00))
;; unusual octet order BOM (3412)
nil)
((and (= code0 #xFE)
(= code1 #xFF))
'utf-16be-with-signature)
((and (= code0 0)
(= code1 0)
(= code2 #xFE)
(= code3 #xFF))
;;utf-32be is not supported by emacs23
nil)
((and (= code0 0)
(= code1 0)
(= code2 #xFF)
(= code3 #xFE))
;; ucs-4 unusual octet order BOM (2143)
nil)
((and (= code0 #xFF)
(= code1 #xFE)
(= code2 #x00)
(= code3 #x00))
;; utf-32 little-endian not supported by emacs23
nil)
((and (= code0 #xFF)
(= code1 #xFE))
'utf-16le-with-signature))))))
;;}}}
;;{{{ some chardet functions
(defsubst unicad-chardet-prober (chardet)
"Fetch the multibyte CHARDET prober function."
(aref chardet 2))
(defsubst unicad-chardet-name (chardet)
"Get the coding system name of a multibyte CHARDET."
(aref chardet 0))
(defsubst unicad-chardet-set-confidence (chardet confidence)
"Set the CONFIDENCE (probability) of a multibyte CHARDET."
(aset chardet 1 confidence))
(defsubst unicad-chardet-confidence (chardet)
"Get the confidence of a CHARDET."
(aref chardet 1))
(defun unicad-chardet (group prober)
"Search for detector in chardet GROUP list by comparing PROBER."
(let ((lists group)
chardet)
(while lists
(setq chardet (pop lists))
(if (eq (unicad-chardet-prober chardet) prober)
(setq lists nil)
(setq chardet nil)))
chardet))
;;}}}
;;{{{ Greek Model
;; ****************************************************************
;; 255: Control characters that usually does not exist in any text
;; 254: Carriage/Return
;; 253: symbol (punctuation) that does not belong to word
;; 252: 0 - 9
;; *****************************************************************/
;;Character Mapping Table:
(defvar unicad-latin7-char2order-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 82 100 104 94 98 101 116 102 111 187 117 92 88 113 85 ;;40
79 118 105 83 67 114 119 95 99 109 188 253 253 253 253 253 ;;50
253 72 70 80 81 60 96 93 89 68 120 97 77 86 69 55 ;;60
78 115 65 66 58 76 106 103 87 107 112 253 253 253 253 253 ;;70
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 ;;80
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 ;;90
253 233 90 253 253 253 253 253 253 253 253 253 253 74 253 253 ;;a0
253 253 253 253 247 248 61 36 46 71 73 253 54 253 108 123 ;;b0
110 31 51 43 41 34 91 40 52 47 44 53 38 49 59 39 ;;c0
35 48 250 37 33 45 56 50 84 57 120 121 17 18 22 15 ;;d0
124 1 29 20 21 3 32 13 25 5 11 16 10 6 30 4 ;;e0
9 8 14 7 2 12 28 23 42 24 64 75 19 26 27 253 ;;f0
])
(defvar unicad-win1253-char2order-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 82 100 104 94 98 101 116 102 111 187 117 92 88 113 85 ;;40
79 118 105 83 67 114 119 95 99 109 188 253 253 253 253 253 ;;50
253 72 70 80 81 60 96 93 89 68 120 97 77 86 69 55 ;;60
78 115 65 66 58 76 106 103 87 107 112 253 253 253 253 253 ;;70
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 ;;80
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 ;;90
253 233 61 253 253 253 253 253 253 253 253 253 253 74 253 253 ;;a0
253 253 253 253 247 253 253 36 46 71 73 253 54 253 108 123 ;;b0
110 31 51 43 41 34 91 40 52 47 44 53 38 49 59 39 ;;c0
35 48 250 37 33 45 56 50 84 57 120 121 17 18 22 15 ;;d0
124 1 29 20 21 3 32 13 25 5 11 16 10 6 30 4 ;;e0
9 8 14 7 2 12 28 23 42 24 64 75 19 26 27 253 ;;f0
])
;;Model Table:
;;total sequences: 100%
;;first 512 sequences: 98.2851%
;;first 1024 sequences:1.7001%
;;rest sequences: 0.0359%
;;negative sequences: 0.0148%
(defvar unicad-greek-lang-model
[
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 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 0 0 0 0
0 0 3 2 2 3 3 3 3 3 3 3 3 1 3 3 3 0 2 2 3 3 0 3 0 3 2 0 3 3 3 0
3 0 0 0 2 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 3 3 3 3 3 0 3 3 0 3 2 3 3 0 3 2 3 3 3 0 0 3 0 3 0 3 3 2 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 2 0 0 0 0 0 0 0 0
0 2 3 2 2 3 3 3 3 3 3 3 3 0 3 3 3 3 0 2 3 3 0 3 3 3 3 2 3 3 3 0
2 0 0 0 2 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 2 3 3 2 3 3 3 3 3 3 3 3 3 3 3 3 0 2 1 3 3 3 3 2 3 3 2 3 3 2 0
0 0 0 0 2 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 3 3 3 3 0 3 3 3 3 3 3 0 3 3 0 3 3 3 3 3 3 3 3 3 3 0 3 2 3 3 0
2 0 1 0 2 0 0 0 0 0 2 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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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 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 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
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 0 0
])
;;}}}
;;{{{ Russian Model
;;KOI8-R language model
;;Character Mapping Table:
(defvar unicad-koi8r-char2order-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
])
(defvar unicad-win1251-char2order-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
])
(defvar unicad-latin5-char2order-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
])
(defvar unicad-maccyrillic-char2order-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
])
(defvar unicad-ibm855-char2order-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
])
(defvar unicad-ibm866-char2order-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%
(defvar unicad-russian-lang-model
`[
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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 0 1 1 0 0 0 0 1 0 0 0 0 0 1 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0
1 0 2 1 2 0 0 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0
0 0 1 0 1 1 0 0 0 0 1 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0
1 0 0 0 0 2 0 1 2 1 0 1 1 1 0 1 0 0 0 1 0 1 0 0 1 0 1 0 0 0 0 1
0 0 0 0 0 1 0 0 1 1 0 0 1 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1
2 2 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 1
1 0 0 0 1 0 0 0 1 1 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 1 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 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
])
;;}}}
;;{{{ Bulgarian Model
;; ****************************************************************
;; 255: Control characters that usually does not exist in any text
;; 254: Carriage/Return
;; 253: symbol (punctuation) that does not belong to word
;; 252: 0 - 9
;; *****************************************************************
;;Character Mapping Table:
;;this talbe is modified base on win1251BulgarianCharToOrderMap, so
;;only number <64 is sure valid
(defconst unicad-latin5-bulgarian-char2order-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 77 90 99 100 72 109 107 101 79 185 81 102 76 94 82 ;;40
110 186 108 91 74 119 84 96 111 187 115 253 253 253 253 253 ;;50
253 65 69 70 66 63 68 112 103 92 194 104 95 86 87 71 ;;60
116 195 85 93 97 113 196 197 198 199 200 253 253 253 253 253 ;;70
194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 ;;80
210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 ;;90
81 226 227 228 229 230 105 231 232 233 234 235 236 45 237 238 ;;a0
31 32 35 43 37 44 55 47 40 59 33 46 38 36 41 30 ;;b0
39 28 34 51 48 49 53 50 54 57 61 239 67 240 60 56 ;;c0
1 18 9 20 11 3 23 15 2 26 12 10 14 6 4 13 ;;d0
7 8 5 19 29 25 22 21 27 24 17 75 52 241 42 16 ;;e0
62 242 243 244 58 245 98 246 247 248 249 250 251 91 252 253 ;;f0
])
(defconst unicad-win1251-bulgarian-char2order-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 77 90 99 100 72 109 107 101 79 185 81 102 76 94 82 ;;40
110 186 108 91 74 119 84 96 111 187 115 253 253 253 253 253 ;;50
253 65 69 70 66 63 68 112 103 92 194 104 95 86 87 71 ;;60
116 195 85 93 97 113 196 197 198 199 200 253 253 253 253 253 ;;70
206 207 208 209 210 211 212 213 120 214 215 216 217 218 219 220 ;;80
221 78 64 83 121 98 117 105 222 223 224 225 226 227 228 229 ;;90
88 230 231 232 233 122 89 106 234 235 236 237 238 45 239 240 ;;a0
73 80 118 114 241 242 243 244 245 62 58 246 247 248 249 250 ;;b0
31 32 35 43 37 44 55 47 40 59 33 46 38 36 41 30 ;;c0
39 28 34 51 48 49 53 50 54 57 61 251 67 252 60 56 ;;d0
1 18 9 20 11 3 23 15 2 26 12 10 14 6 4 13 ;;e0
7 8 5 19 29 25 22 21 27 24 17 75 52 253 42 16 ;;f0
])
;;Model Table:
;;total sequences: 100%
;;first 512 sequences: 96.9392%
;;first 1024 sequences:3.0618%
;;rest sequences: 0.2992%
;;negative sequences: 0.0020%
(defconst unicad-bulgarian-lang-model
`[
0 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 2 3 3 3 3 3 3 3 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 3 0 3 3 3 2 2 3 2 2 1 2 2
3 1 3 3 2 3 3 3 3 3 3 3 3 3 3 3 3 0 3 3 3 3 3 3 3 3 3 3 0 3 0 1
0 0 0 0 0 0 0 0 0 0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 2 3 2 3 3 3 3 3 3 3 3 0 3 1 0
0 1 0 0 0 0 0 0 0 0 1 1 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
3 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 1 3 2 3 3 3 3 3 3 3 3 0 3 0 0
0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
3 2 3 3 2 3 3 3 3 3 3 3 3 3 3 3 3 1 3 2 3 3 3 3 3 3 3 3 0 3 0 0
0 0 0 0 0 0 0 0 0 0 1 0 0 1 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 2 3 2 2 1 3 3 3 3 2 2 2 1 1 2 0 1 0 1 0 0
0 0 0 0 0 0 0 0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