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

« back to all changes in this revision

Viewing changes to convert2skk/canna2skk.rb

  • Committer: Bazaar Package Importer
  • Author(s): Takao KAWAMURA
  • Date: 2003-09-18 15:31:09 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20030918153109-9ubs3wtb5pxtv8us
Tags: 1.1-1
* New upstream release.
* Fixed the extended description. (Closes: Bug#209892)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env ruby
 
2
# canna2skk.rb -- convert Canna dictionary to SKK-JISYO format.
 
3
#
 
4
# Copyright (C) 2003 NAKAJIMA Mikio <minakaji@namazu.org>
 
5
#
 
6
# Author: NAKAJIMA Mikio <minakaji@namazu.org>
 
7
# Created: March 23, 2003
 
8
# Last Modified: $Date: 2003/03/22 23:59:37 $
 
9
# Version: $Id: canna2skk.rb,v 1.1 2003/03/22 23:59:37 minakaji Exp $
 
10
 
 
11
# This file is part of Daredevil SKK.
 
12
 
 
13
# Daredevil SKK is free software; you can redistribute it and/or modify
 
14
# it under the terms of the GNU General Public License as published by
 
15
# the Free Software Foundation; either versions 2, or (at your option)
 
16
# any later version.
 
17
#
 
18
# Daredevil SKK is distributed in the hope that it will be useful
 
19
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
20
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
21
# GNU General Public License for more details.
 
22
#
 
23
# You should have received a copy of the GNU General Public License
 
24
# along with Daredevil SKK, see the file COPYING.  If not, write to the
 
25
# Free Software Foundation Inc., 59 Temple Place - Suite 330, Boston,
 
26
# MA 02111-1307, USA.
 
27
#
 
28
# Commentary:
 
29
# As to Canna dictionary, See
 
30
#   http://cannadic.oucrc.org/
 
31
#
 
32
# $ canna2skk.rb gcanna.t gcannaf.t > tmp.jisyo
 
33
# $ skkdic-expr2 tmp.jisyo > SKK-JISYO.canna
 
34
#
 
35
# ���� #JS*8 �� #CNSUC2*2 �� #JS �� �� #JSSUC ��
 
36
 
 
37
file = ARGV.shift
 
38
open(file).each{|line|
 
39
  if !(line =~ /([^ ]+) (.+) *$/)
 
40
    next
 
41
  else
 
42
    key = $1
 
43
    words = $2
 
44
    words.split(' ').each{|word|
 
45
      if (word =~ /[#*a-zA-Z0-9]+/ || key == word)
 
46
        next
 
47
      else
 
48
        print key, " /", word, "/\n"
 
49
      end
 
50
    }
 
51
  end
 
52
}
 
53
# end of canna2skk.rb