トップ «前の日記(2012年09月13日) 最新 次の日記(2012年10月31日)» 編集

Masa's blog

検索キーワード:

2012年10月29日 Converter for SKK's dictionary to OpenPOBox's dictionary [長年日記]

_ Converter for SKK's dictionary to OpenPOBox's dictionary

#! /bin/sh
#
# skk2pbdic.sh
#
for i in `cat $* |\
	egrep -v '^;' |\
	sed -e 's/  */=/g'`
do
	yomi=`echo $i |\
		cut -d '=' -f 1 |\
		sed -e 's/ー/-/g;s/ン/nn/g;s/ん/nn/g' |\
		kakasi -rk -Ea -Ka -Ha -Ja |\
		tr 'A-Z' 'a-z'`
	tangos=`echo $i |\
		cut -d '=' -f 2- |\
		sed -e 's/;[^/]*\//\//g;
			s/^\///;
			s/\/$//;
			s/\// /g'`
	for j in ${tangos}
	do
		tango=`echo $j |\
			tr '=' ' '`
		echo -e "${yomi}\t${tango}"
	done
done

How to use

skk2pbdic.sh SKK-JISYO.L | sort | uniq >staticdic

Links