From 01f8a8729eb7fc675cc383ce7d2981b18ed289e9 Mon Sep 17 00:00:00 2001 From: eto Date: Thu, 8 Jul 2004 15:41:49 +0000 Subject: [PATCH] update. --- README.en | 49 ++- README.ja | 49 +-- chise.rb | 4 + chise/char.rb | 3 +- chise/chisedb.rb | 2 +- chise/config.rb | 17 +- doc/index.html | 462 +++++++++++--------- doc/style.css | 280 +++++++----- ext/.cvsignore | 1 - ext/config.h | 5 + install.rb | 1098 ----------------------------------------------- sample/sample-lc2003.rb | 25 +- sample/sample1.rb | 20 +- tools/README | 32 +- tools/scp-chisedb | 4 - 15 files changed, 525 insertions(+), 1526 deletions(-) create mode 100755 chise.rb create mode 100755 ext/config.h delete mode 100755 tools/make_ids_db.rb delete mode 100755 tools/scp-chisedb diff --git a/README.en b/README.en index 85dcf37..c3916d8 100755 --- a/README.en +++ b/README.en @@ -1,38 +1,37 @@ -Ruby/CHISE README -============ +* Ruby/CHISE README - Ruby/CHISE is a library for implementation Chaon model. +Ruby/CHISE is a llibrary to use Chaon model. +** Requirements -Requirements ------------- +- ruby 1.8 +- Berkeley DB +- Ruby/BDB - * ruby 1.8 - * Berkeley DB +** Install -Install -------- +Move "chise" directory to somewhere. +eg. + # mv chise /usr/local/lib/ruby/site_ruby/1.8 - De-Compress archive and enter its top directory. - Then type: +Cd to "ext" directory, do like this. + % ruby extconf.rb + % make + # make install - $ ruby install.rb config - $ ruby install.rb setup - # ruby install.rb install +You can use Ruby/CHISE without extension. +If you have extension, Ruby/CHISE works faster. - You can also install files into your favorite directory - by supplying install.rb some options. Try "ruby install.rb --help". +** Usage -Usage ------ +See "doc/index.html". (in Japanese) +See "sample", "test" directories. +Please check http://eto.com/2003/ruby/ for imformation. - Please see "doc/index.html". (in Japanese) - Please check http://eto.com/2003/ruby/ for imformation. +** License -License -------- +This software is distributed under the GPL2. See COPYING. - This software is distributed under the GPL2. See COPYING. +** Author - -Kouichirou Eto <2004@eto.com> +Kouichirou Eto <2004 at eto.com> diff --git a/README.ja b/README.ja index c9c420e..d88474e 100755 --- a/README.ja +++ b/README.ja @@ -1,39 +1,36 @@ -Ruby/CHISE README -============ +* Ruby/CHISE README - Ruby/CHISE¤ÏRuby¤Ë¤ª¤±¤ëChaon¼ÂÁõ¤Ç¤¹¡£ +Ruby/CHISE¤ÏRuby¤Ë¤ª¤±¤ëChaon¼ÂÁõ¤Ç¤¹¡£ +** ɬÍ״Ķ­ -ɬÍ״Ķ­ --------- +- ruby 1.8 +- Berkeley DB +- Ruby/BDB - * ruby 1.8 - * Berkeley DB +** ¥¤¥ó¥¹¥È¡¼¥ëÊýË¡ -¥¤¥ó¥¹¥È¡¼¥ëÊýË¡ ----------------- +chise°Ê²¼¤ò¡¢Å¬Åö¤Êdirectory¤Ë°ÜÆ°¤·¤Æ¤¯¤À¤µ¤¤¡£ +Îã: + # mv chise /usr/local/lib/ruby/site_ruby/1.8 - ¥³¥Þ¥ó¥É¥é¥¤¥ó¤Ç°Ê²¼¤Î¤è¤¦¤Ë¤¦¤Á¤³¤ó¤Ç¤¯¤À¤µ¤¤¡£ - UNIX ·Ï OS ¤Ç¤Ï¤ª¤½¤é¤¯ root ¸¢¸Â¤¬É¬Íפˤʤê¤Þ¤¹¡£ +³ÈÄ¥¥é¥¤¥Ö¥é¥ê¤Ï¡¢ext°Ê²¼¤Ëcd¤·¤Æ¡¢²¼µ­¤Î¤è¤¦¤ËÂǤÁ¹þ¤ó¤Ç¤¯¤À¤µ¤¤¡£ + % ruby extconf.rb + % make + # make install - $ ruby install.rb config - $ ruby install.rb setup - # ruby install.rb install +³ÈÄ¥¥é¥¤¥Ö¥é¥ê¤¬Ìµ¤¯¤Æ¤âÆ°¤­¤Þ¤¹¡£¤¢¤ë¤È¹â®²½¤·¤Þ¤¹¡£ - ¥¤¥ó¥¹¥È¡¼¥ëÀè¤òÊѹ¹¤·¤¿¤ê¤¹¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹¡£ - ¤½¤Î¾ì¹ç¤Ï ruby install.rb --help ¤ò¼Â¹Ô¤·¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£ +** »È¤¤Êý -´Êñ¤Ê»È¤¤Êý¤È¤« ----------------- +doc/index.html¤ò¸«¤Æ¤ß¤Æ¤¯¤À¤µ¤¤ +¤Þ¤¿¡¢sample°Ê²¼¡¢test°Ê²¼¤¬»²¹Í¤Ë¤Ê¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¡£ +ºÇ¿·ÈǤξðÊó¤Ï http://eto.com/2003/ruby/ ¤ò¤´¤é¤ó²¼¤µ¤¤¡£ - doc/index.html¤ò¸«¤Æ¤ß¤Æ¤¯¤À¤µ¤¤ - ºÇ¿·ÈǤξðÊó¤Ï http://eto.com/2003/ruby/ ¤ò¤´¤é¤ó²¼¤µ¤¤¡£ +** ¥é¥¤¥»¥ó¥¹ +GPL¤Ç¤¹¡£COPYING¤ò¤´¤é¤ó¤¯¤À¤µ¤¤¡£ -¥é¥¤¥»¥ó¥¹ ----------- +** ºî¼Ô - GPL¤Ç¤¹¡£COPYING¤ò¤´¤é¤ó¤¯¤À¤µ¤¤¡£ - - -Kouichirou Eto <2004@eto.com> +Kouichirou Eto <2004 at eto.com> diff --git a/chise.rb b/chise.rb new file mode 100755 index 0000000..8441ae6 --- /dev/null +++ b/chise.rb @@ -0,0 +1,4 @@ +# Copyright (C) 2002-2004 Kouichirou Eto, All rights reserved. + +require "chise/character" +require "chise/string" diff --git a/chise/char.rb b/chise/char.rb index 8441ae6..072b998 100755 --- a/chise/char.rb +++ b/chise/char.rb @@ -1,4 +1,3 @@ # Copyright (C) 2002-2004 Kouichirou Eto, All rights reserved. -require "chise/character" -require "chise/string" +require "chise" diff --git a/chise/chisedb.rb b/chise/chisedb.rb index 78a6e81..2969383 100755 --- a/chise/chisedb.rb +++ b/chise/chisedb.rb @@ -117,7 +117,7 @@ module CHISE alias close sync def set_value(cid, value) - @feature.set_value(cid, value) + @feature.set_value(cid, value.to_s) end def get_value(cid) diff --git a/chise/config.rb b/chise/config.rb index 578ab0e..c52395e 100755 --- a/chise/config.rb +++ b/chise/config.rb @@ -4,6 +4,14 @@ require "singleton" require "chise/version" module CHISE + # on Winodws + DB_DIR = "c:/chise/chise-db" # /character/feature/=ucs + IDS_DIR = "c:/chise/ids" # /IDS-JIS-X0208-1990.txt + + # on Unix + #DB_DIR = "/usr/local/lib/xemacs-21.4.14/i686-pc-linux/chise-db" + #IDS_DIR = "/home/eto/work/chise/ids" + def windows?() rp = RUBY_PLATFORM rp.index("cygwin") || rp.index("mswin32") || rp.index("mingw32") @@ -20,13 +28,8 @@ module CHISE @base_dir = File.expand_path(File.dirname(__FILE__)+"/../..") @csf_dir = @base_dir+"/csf" - if CHISE.windows?() - @db_dir = @base_dir+"/chise-db" # /character/feature/=ucs - @ids_dir = @base_dir+"/ids" # /IDS-JIS-X0208-1990.txt - else - @db_dir = "/usr/local/lib/xemacs-21.4.14/i686-pc-linux/chise-db" - @ids_dir = "/home/eto/work/chise/ids" - end + @db_dir = DB_DIR + @ids_dir = IDS_DIR instance_variables.each {|name| self.class.class_eval { attr_reader name.delete("@") } diff --git a/doc/index.html b/doc/index.html index 72ac3bd..9f71b71 100755 --- a/doc/index.html +++ b/doc/index.html @@ -1,3 +1,4 @@ + Ruby/CHISE @@ -5,194 +6,146 @@ -
-

Ruby/CHISE

+
+
-