summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorrodri <rgl@antares-labs.eu>2022-07-17 14:10:31 +0000
committerrodri <rgl@antares-labs.eu>2022-07-17 14:10:31 +0000
commit467c95b4a879f5f72c7bca2c541680269db18c92 (patch)
tree1ad62baf781b6498a28c8f42b79f088fdfc680e5 /lib
parent498e9e7d838e7c02e8387f853cc5fe0a22349124 (diff)
/lib/ktrans: added tools to fetch skk dicts and convert them to ktrans jishos
Diffstat (limited to 'lib')
-rw-r--r--lib/ktrans/README12
-rwxr-xr-xlib/ktrans/grabskkdicts2
-rwxr-xr-xlib/ktrans/skk2ktrans2
3 files changed, 16 insertions, 0 deletions
diff --git a/lib/ktrans/README b/lib/ktrans/README
new file mode 100644
index 000000000..bcc40b5a0
--- /dev/null
+++ b/lib/ktrans/README
@@ -0,0 +1,12 @@
+#
+# The following are a set of tools to obtain and process dictionaries from the SKK project in order to use them with ktrans(1).
+#
+# grabskkdicts pulls the skk kana-kanji conversion dictionaries from the skk-dev/dict repo.
+# skk2ktrans takes an skk dictionary and converts it into a kanji jisho suitable to be used with ktrans(1).
+#
+# You can fetch and convert all the dictionaries by running this file.
+#
+
+grabskkdicts
+for(d in skkdicts/SKK-JISYO.*)
+ <$d skk2ktrans >$d.jisho
diff --git a/lib/ktrans/grabskkdicts b/lib/ktrans/grabskkdicts
new file mode 100755
index 000000000..3ce0bfb6d
--- /dev/null
+++ b/lib/ktrans/grabskkdicts
@@ -0,0 +1,2 @@
+#!/bin/rc
+git/clone https://github.com/skk-dev/dict skkdicts
diff --git a/lib/ktrans/skk2ktrans b/lib/ktrans/skk2ktrans
new file mode 100755
index 000000000..94da097fa
--- /dev/null
+++ b/lib/ktrans/skk2ktrans
@@ -0,0 +1,2 @@
+#!/bin/rc
+tcs -sf jis | awk '$1 !~ /;;/ {gsub("(^\/|\/$)", "", $2); gsub(" ", " "); gsub("\/", " ", $2);} {print}'