~ubuntu-branches/ubuntu/trusty/skktools/trusty-proposed

« back to all changes in this revision

Viewing changes to convert2skk/edict2skk.awk

  • Committer: Bazaar Package Importer
  • Author(s): Takao KAWAMURA
  • Date: 2001-06-16 23:31:56 UTC
  • Revision ID: james.westby@ubuntu.com-20010616233156-zhpogneqxji6sv2y
Tags: upstream-1.0
Import upstream version 1.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# edict2skk.awk -- convert EDICT dictionary to SKK-JISYO format.
 
2
#
 
3
# Copyright (C) 1998, 1999, 2000 Mikio Nakajima <minakaji@osaka.email.ne.jp>
 
4
#
 
5
# Author: Mikio Nakajima <minakaji@osaka.email.ne.jp>
 
6
# Created: Dec. 5, 1998
 
7
# Last Modified: $Date: 2000/10/02 21:25:32 $
 
8
# Version: $Id: edict2skk.awk,v 1.3 2000/10/02 21:25:32 minakaji Exp $
 
9
 
 
10
# This file is part of Daredevil SKK.
 
11
 
 
12
# Daredevil SKK is free software; you can redistribute it and/or modify
 
13
# it under the terms of the GNU General Public License as published by
 
14
# the Free Software Foundation; either versions 2, or (at your option)
 
15
# any later version.
 
16
#
 
17
# Daredevil SKK is distributed in the hope that it will be useful
 
18
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
19
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
20
# GNU General Public License for more details.
 
21
#
 
22
# You should have received a copy of the GNU General Public License
 
23
# along with Daredevil SKK, see the file COPYING.  If not, write to the
 
24
# Free Software Foundation Inc., 59 Temple Place - Suite 330, Boston,
 
25
# MA 02111-1307, USA.
 
26
#
 
27
# Commentary:
 
28
# This file encoding should be Ja/EUC.
 
29
#
 
30
# ���Υ�����ץȤϡ�James William Breen �ˤ�� EDICT �� SKK-JISYO �ե���
 
31
# �ޥåȤ��Ѵ������ΤǤ����Ǥ������ä�����ϡ�SKK 10.x ���դ��Ƥ���
 
32
# skk-look.el ��Ȥ���ͭ�����ѤǤ���ΤǤϤʤ����ȹͤ��Ƥ��ޤ���
 
33
#
 
34
# EDICT �ϡ�
 
35
#   ftp://ftp.u-aizu.ac.jp:/pub/SciEng/nihongo/ftp.cc.monash.edu.au/
 
36
# ���� get �Ǥ��ޤ���
 
37
#
 
38
# ���� edict �� edict2skk.awk �� SKK jisyo-tools �Υ��ޥ�ɤ�ȤäƲ�
 
39
# �����ޤ���
 
40
#
 
41
#   % jgawk -f edict2skk.awk edict | skkdic-sort > SKK-JISYO.E2J
 
42
 
43
# SKK-JISYO.E2J �λȤ����Ͽ����ͤ����ޤ�����
 
44
#   % skkdic-expr SKK-JISYO.E2J + /usr/local/share/skk/SKK-JISYO.L | skkdic-sort > SKK-JISYO.L
 
45
# �ʤɤȤ��� SKK Large ����ȥޡ������ƻȤ��Τ���ñ�Ǥ���
 
46
 
47
# EDICT �ڤӤ��Υ��֥��å� (�ܥ�����ץȤˤ�� EDICT ��ȴ�褷����Τ�
 
48
# ���֥��åȤ�������Ǥ��礦) �ϡ�GPL �Ȥϰۤʤ����۾�郎�դ��Ƥ����
 
49
# �ǡ��ܺ٤ϡ�EDICT �ե��������Ƭ��ʬ�⤷���ϡ�EDICT ź�դ� edict.doc
 
50
# �򻲾Ȥ��Ʋ�������
 
51
#
 
52
# Code
 
53
BEGIN{
 
54
  print ";; okuri-ari entry";
 
55
  # all entries are `okuri-nasi'.
 
56
  print ";; okuri-nasi entry";
 
57
}
 
58
$1 !~ /^��/ {
 
59
    alt_yomi = 0; # initialize
 
60
    # plural words that contain spaces cannot be yomi.
 
61
    if (match($0, /\/[^ ][^ ]*\/$/) != 0) {
 
62
        entries = substr($0, RSTART + 1, RLENGTH - 2);
 
63
        num = split(entries, yomi, "/");
 
64
        for (i = 1; i <= num; i++) {
 
65
            gsub(/\"/, "", yomi[i]);
 
66
            if (match(yomi[i], /\(-*[a-z]*[a-z]*-*\)/) != 0) {
 
67
                head = substr(yomi[i], 1, RSTART - 1);
 
68
                middle = substr(yomi[i], RSTART + 1 , RLENGTH - 2);
 
69
                tail = substr(yomi[i], RSTART + RLENGTH);
 
70
                yomi[i] = head tail;
 
71
                gsub(/-/, "", middle);
 
72
                if (((middle != "") ||
 
73
                     # ����
 
74
                     (middle != "d") ||
 
75
                     # ʣ����
 
76
                     (middle != "s") ||
 
77
                     # ʣ����
 
78
                     (middle != "es") ||
 
79
                     # �ʹԷ�
 
80
                     (middle != "ing") ||
 
81
                     # �����ػ��Ѹ�
 
82
                     #(middle != "X") ||
 
83
                     # ����
 
84
                     (match(middle, /.ed/) == 0) ) &&
 
85
                    (yomi[i] != head middle tail) ) {
 
86
                    alt_yomi = head middle tail;
 
87
                    gsub(/\"/, "", alt_yomi);
 
88
                } else {
 
89
                    alt_yomi = 0;
 
90
                }
 
91
                printf("%s /%s/\n", yomi[i], $1);
 
92
                if (alt_yomi) {
 
93
                    printf("%s /%s/\n", alt_yomi, $1);
 
94
                }
 
95
            } else {
 
96
                printf("%s /%s/\n", yomi[i], $1);
 
97
            }
 
98
        }
 
99
    }
 
100
}
 
101
# end of edict2skk.awk