Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change character encoding of skk-jisyo-code to utf-8 #392

Merged
merged 5 commits into from
Sep 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions .emacs.d/bin/skkdic-maintenance.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
#!/usr/bin/env bash

CURRENT_DIR=$(cd $(dirname $0); pwd)
ONEDRIVE_DIR="${HOME}/OneDrive - Skirnir Inc/emacs/ddskk"

mkdir -p skk-jisyo
cd skk-jisyo

# https://skk-dev.github.io/dict/
while read -r line; do
echo "Downloading $line"
curl -O "https://skk-dev.github.io/dict/${line}.gz"
gunzip -d "${line}.gz"
iconv -f euc-jisx0213 -t utf8 "${line}" \
| sed -e 's/coding: euc-jp/coding: utf-8/g' \
| sed -e 's/coding: euc-jis-2004/coding: utf-8/g' \
> "${ONEDRIVE_DIR}/${line}.utf8"
done < <(cat <<EOF
SKK-JISYO.JIS2
SKK-JISYO.JIS2004
SKK-JISYO.JIS3_4
SKK-JISYO.L
SKK-JISYO.assoc
SKK-JISYO.fullname
SKK-JISYO.geo
SKK-JISYO.itaiji
SKK-JISYO.jinmei
SKK-JISYO.law
SKK-JISYO.lisp
SKK-JISYO.mazegaki
SKK-JISYO.okinawa
SKK-JISYO.propernoun
SKK-JISYO.pubdic+
SKK-JISYO.station
EOF
)

while read -r line; do
echo "Downloading $line"
curl -O "https://skk-dev.github.io/dict/$line"
tar xf "$line"
done < <(cat <<EOF
SKK-JISYO.edict.tar.gz
zipcode.tar.gz
EOF
)

iconv -f euc-jisx0213 -t utf8 SKK-JISYO.edict | sed -e 's/coding: euc-jp/coding: utf-8/g' > "${ONEDRIVE_DIR}/SKK-JISYO.edict.utf8"
iconv -f euc-jisx0213 -t utf8 zipcode/SKK-JISYO.zipcode | sed -e 's/coding: euc-jis-2004/coding: utf-8/g' > "${ONEDRIVE_DIR}/SKK-JISYO.zipcode.utf8"
iconv -f euc-jisx0213 -t utf8 zipcode/SKK-JISYO.office.zipcode | sed -e 's/coding: euc-jis-2004/coding: utf-8/g' > "${ONEDRIVE_DIR}/SKK-JISYO.office.zipcode.utf8"

curl -O https://raw.githubusercontent.com/uasi/skk-emoji-jisyo/master/SKK-JISYO.emoji.utf8
cp -rp SKK-JISYO.emoji.utf8 "${ONEDRIVE_DIR}/SKK-JISYO.emoji.utf8"

skkdic-expr2 \
SKK-JISYO.L + \
SKK-JISYO.assoc + \
SKK-JISYO.edict + \
SKK-JISYO.fullname + \
SKK-JISYO.geo + \
SKK-JISYO.jinmei + \
SKK-JISYO.law + \
SKK-JISYO.propernoun + \
SKK-JISYO.station + \
zipcode/SKK-JISYO.zipcode + \
zipcode/SKK-JISYO.office.zipcode + \
SKK-JISYO.JIS2 + \
SKK-JISYO.JIS2004 + \
SKK-JISYO.JIS3_4 \
> SKK-JISYO.all.euc-jisx0213

cat <(iconv -f euc-jisx0213 -t utf8 SKK-JISYO.all.euc-jisx0213) <(cat SKK-JISYO.emoji.utf8) > SKK-JISYO.all.utf8

cd $CURRENT_DIR
cp -rp skk-jisyo/SKK-JISYO.all.utf8 "${ONEDRIVE_DIR}/SKK-JISYO.all.utf8"
# backword compatibility
cp -rp skk-jisyo/SKK-JISYO.all.euc-jisx0213 "${ONEDRIVE_DIR}/SKK-JISYO.ALL.nosort"
cp -rp skk-jisyo/SKK-JISYO.all.euc-jisx0213 "${ONEDRIVE_DIR}/SKK-JISYO.ALL"
rm -rf skk-jisyo
7 changes: 4 additions & 3 deletions .emacs.d/el-get.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
(setq el-get-lock-package-versions
'((modus-themes :checksum "243fc35181db62e4cadc10b29a8950072443eea0")
'((emacs-todoist :checksum "205c730a4615dec20ea71ccd0a09479a420cb974")
(modus-themes :checksum "243fc35181db62e4cadc10b29a8950072443eea0")
(dired-preview :checksum "411a6fd3608a42a5cb5a166ed9613366f426b664")
(ddskk :checksum "8c47f46e38a29a0f3eabcd524268d20573102467")
(ebuild-mode :checksum "529191d3b6691401f9612e761e1c5448f9359857")
Expand All @@ -12,13 +13,13 @@
(tree-sitter-php-mode :checksum "2f791d9d83c35b11e9a14daf9a58dd7e23566041")
(php-ts-mode :checksum "6c0214eb1a323cfc9cedb5e187c4ed20da763e9b")
(jq-mode :checksum "d533567a680bc87060c56a50f83d80e58646d2f2")
(terraform-mode :checksum "a645c32a8f0f0d04034262ae5fea330d5c7a33c6")
(terraform-mode :checksum "abfc10f5e313c4bb99de136a14636e9bc6df74f6")
(hcl-mode :checksum "ec27736c4c16fbf7f1ecab0210ec3c71ac2406fa")
(elisp-tree-sitter :checksum "fa5a072128da1235e237da827daf53f71a2cd562")
(fosi :checksum "c1d5ed6bc4c6c1e5d8c14c21ff0d6234e65bc83a")
(wakatime-mode :checksum "25fb775178d16decb818b75f32fd23301c0f5da0")
(compat :checksum "8d4e8a366681def88751f5e9975738ecd3180deb")
(lsp-bridge :checksum "d54ffdf127e92c0faae96e005026833c44007aa8")
(lsp-bridge :checksum "fe7a0729f9f46a0713b7049d20b25bb78d93f68f")
(copilot :checksum "f831b2b8375950eb1cc282d15ccc78ed90f30a1a")
(eldoc-box :checksum "5c067f5c195198ffd16df2f455da95e46cc8ce02")
(consult-tramp :checksum "befa62baca768caa457b167e773b91f1bc7d661f")
Expand Down
13 changes: 6 additions & 7 deletions .emacs.d/init.d/skk-init.el
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@
;;

(setq skk-cdb-large-jisyo nil)
(setq skk-large-jisyo (concat external-directory "ddskk/SKK-JISYO.L"))
(setq skk-jisyo-code 'euc-jis-2004-unix)

(setq skk-large-jisyo (concat external-directory "ddskk/SKK-JISYO.L.utf8"))
(setq skk-jisyo-code 'utf-8)
(dolist (JISYO
(list "assoc" "edict" "fullname" "geo" "itaiji" "jinmei"
"law" "lisp" "mazegaki" "okinawa" "propernoun" "pubdic+" "station"
"zipcode" "office.zipcode" "JIS3_4" "JIS2004"))
(list "emoji" "JIS2004" "JIS3_4" "JIS2" "office.zipcode" "zipcode" "station"
"pubdic+" "propernoun" "propernoun" "law" "jinmei" "itaiji" "geo"
"fullname" "edict" "assoc"))
(add-to-list 'skk-extra-jisyo-file-list
(concat external-directory "ddskk/SKK-JISYO." JISYO)))
(concat external-directory "ddskk/SKK-JISYO." JISYO ".utf8")))

(setq-default skk-kutouten-type 'en)
(setq-default skk-kuten-touten-alist
Expand Down
8 changes: 6 additions & 2 deletions .emacs.d/init.el
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,10 @@
(,el-get-emacs "-batch" "-q" "-no-site-file" "-l" "SKK-MK" "-f" "SKK-MK-compile")
;; (,el-get-emacs "-batch" "-q" "-no-site-file" "-l" "SKK-MK" "-f" "SKK-MK-compile-info")
("cp" "skk-setup.el.in" "skk-setup.el")))
(setopt skk-user-directory (concat external-directory "ddskk")
(setopt
skk-server-host nil
skk-server-portnum nil
skk-user-directory (concat external-directory "ddskk")
skk-init-file (concat user-initial-directory "skk-init.el")
skk-isearch-start-mode 'latin)
(setq skk-preload nil)
Expand Down Expand Up @@ -879,7 +882,7 @@
:type github
:pkgname "manateelazycat/lsp-bridge"
:depends (posframe markdown-mode yasnippet orderless))
(add-hook 'emacs-startup-hook
(add-hook 'prog-mode-hook
#'(lambda ()
;; (setq lsp-bridge-enable-mode-line nil)
(global-lsp-bridge-mode)))
Expand Down Expand Up @@ -950,6 +953,7 @@
(add-hook 'web-mode-hook
#'(lambda ()
(setq web-mode-enable-auto-indentation nil)))
(add-hook 'web-mode-hook 'editorconfig-apply)
(add-hook 'web-mode-hook 'prettier-js-mode)
(add-hook 'web-mode-hook
#'(lambda ()
Expand Down
Loading