forked from skk-dev/dict
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ivd.el
37 lines (28 loc) · 1.16 KB
/
ivd.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
;;; ivd.el --- generate IVD SKK-JISYO from Unicode -*- coding: utf-8 -*-
;;; Commentary:
;; About the IVD, see UTS #37:
;; http://www.unicode.org/reports/tr37/
;;; License:
;; https://www.unicode.org/license.html
;;; Code:
(defun get-string (s)
(char-to-string (string-to-number s 16)))
(defun make-ivd-jisyo ()
(with-temp-buffer
(insert-file-contents "IVD_Sequences.txt")
(goto-char (point-min))
(while (not (eobp))
(let ((line (replace-regexp-in-string ";" "" (buffer-substring (point)
(progn
(end-of-line)
(point))))))
(when (not (string-match "#" line))
(let* ((data (split-string line " "))
(base (get-string (nth 0 data)))
(ivs (format "%s%s" base (get-string (nth 1 data))))
(reg (nth 2 data))
(code (nth 3 data)))
(princ (format "%s /%s;%s(%s)/\n" base ivs reg code)))))
(forward-line))))
(provide 'ivd)
;;; ivd.el ends here