From 467c95b4a879f5f72c7bca2c541680269db18c92 Mon Sep 17 00:00:00 2001 From: rodri Date: Sun, 17 Jul 2022 14:10:31 +0000 Subject: [PATCH] /lib/ktrans: added tools to fetch skk dicts and convert them to ktrans jishos --- lib/ktrans/README | 12 ++++++++++++ lib/ktrans/grabskkdicts | 2 ++ lib/ktrans/skk2ktrans | 2 ++ 3 files changed, 16 insertions(+) create mode 100644 lib/ktrans/README create mode 100755 lib/ktrans/grabskkdicts create mode 100755 lib/ktrans/skk2ktrans 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}'