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

« back to all changes in this revision

Viewing changes to dbm/makedbmdic4

  • 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
#!/usr/bin/jperl4
 
2
#########################################################
 
3
# makedbmdic(perl4) version 4.0                1995.10.17
 
4
#
 
5
# This software is placed in the public domain.
 
6
#
 
7
#         Written by Masaaki Sato <msatoh@mrit.mei.co.jp>
 
8
#               Matsushita Research Institute Tokyo, Inc. 
 
9
#                      Human Interface Research Laboratry
 
10
#                                     Tel    044-911-6351
 
11
#                                     Fax    044-911-8760
 
12
#########################################################
 
13
 
 
14
# Author: Masaaki Sato <msatoh@mrit.mei.co.jp>
 
15
# Maintainer: Mikio Nakajima <minakaji@osaka.email.ne.jp>
 
16
# Version: $Id: makedbmdic4,v 1.1.1.1 2000/03/12 12:17:49 minakaji Exp $
 
17
# Keywords: jisyo, dbm, gdbm, perl
 
18
# Last Modified: $Date: 2000/03/12 12:17:49 $
 
19
 
 
20
$dot=20;
 
21
$line=$dot * 50;
 
22
 
 
23
($dicname) = @ARGV;
 
24
die "Usage: makedbmdic dict-file-name\n" unless $dicname;
 
25
 
 
26
open(DIC,$dicname);
 
27
 
 
28
dbmopen(%dbm_dic,$dicname,0644);
 
29
 
 
30
print "\nmakedbmdic by msatoh@mrit.mei.co.jp\n";
 
31
print "Make dbm format dic from SKK dic.\n";
 
32
print "The numbers mean how many lines have processed.\n";
 
33
print "A dot mean $dot lines, as you see.\n\n";
 
34
 
 
35
$|=1;
 
36
 
 
37
$max=0;
 
38
while(<DIC>){
 
39
        $max++;
 
40
}
 
41
 
 
42
seek(DIC,0,0);
 
43
 
 
44
$count=0;
 
45
while(<DIC>){
 
46
        ($key,$cont)=m#^(.+)\s(/.+/)$#;
 
47
        $dbm_dic{$key} = $cont;
 
48
        $count++;
 
49
        print "." if ($count % $dot) == 0;
 
50
        if (($count % $line) == 0){
 
51
                $per = $count*100/$max;
 
52
                printf("%d[%5.2f%%]\n",$count,$per);
 
53
        }
 
54
}
 
55
 
 
56
dbmclose(%dbm_dic);
 
57
 
 
58
print " done.\n";
 
59
# end of makedbmdic4