sdic-2.1.3/0000777000175000017500000000000007512046270006207 5sdic-2.1.3/Makefile.in0000644000175000017500000003434507512046267010207 # Makefile.in generated automatically by automake 1.4-p4 from Makefile.am # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. # -*- Makefile -*- # # $Id: Makefile.am,v 1.11 1999/07/23 10:11:16 satoru Exp $ # SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include DESTDIR = pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = . ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : BZIP2 = @BZIP2@ CP = @CP@ DICTDIR = @DICTDIR@ EIJIROU_DIR = @EIJIROU_DIR@ EIWA_DICT = @EIWA_DICT@ EIWA_DICT_LIST = @EIWA_DICT_LIST@ EMACS = @EMACS@ GZIP = @GZIP@ MAKEINFO = @MAKEINFO@ MULTI_DICT = @MULTI_DICT@ NKF = @NKF@ PACKAGE = @PACKAGE@ PERL = @PERL@ SORT = @SORT@ VERSION = @VERSION@ WAEIJIROU_DIR = @WAEIJIROU_DIR@ WAEI_DICT = @WAEI_DICT@ WAEI_DICT_LIST = @WAEI_DICT_LIST@ emacsdir = @emacsdir@ lispdir = @lispdir@ EXTRA_DIST = install.el texi/sdic.texi contrib/edict.perl contrib/eijirou.perl contrib/gene.perl contrib/jgene.perl DISTCLEANFILES = install.el texi/sdic.info SUBDIRS = lisp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_CLEAN_FILES = install.el DIST_COMMON = README AUTHORS COPYING ChangeLog INSTALL Makefile.am \ Makefile.in NEWS THANKS TODO acinclude.m4 aclocal.m4 configure \ configure.in install-sh install.el.in missing mkinstalldirs DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) TAR = tar GZIP_ENV = --best all: all-redirect .SUFFIXES: $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status $(ACLOCAL_M4): configure.in acinclude.m4 cd $(srcdir) && $(ACLOCAL) config.status: $(srcdir)/configure.in $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) cd $(srcdir) && $(AUTOCONF) install.el: $(top_builddir)/config.status install.el.in cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. @SET_MAKE@ all-recursive install-data-recursive install-exec-recursive \ installdirs-recursive install-recursive uninstall-recursive \ check-recursive installcheck-recursive info-recursive dvi-recursive: @set fnord $(MAKEFLAGS); amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @set fnord $(MAKEFLAGS); amf=$$2; \ dot_seen=no; \ rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \ rev="$$subdir $$rev"; \ test "$$subdir" = "." && dot_seen=yes; \ done; \ test "$$dot_seen" = "no" && rev=". $$rev"; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ awk ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ here=`pwd` && cd $(srcdir) \ && mkid -f$$here/ID $$unique $(LISP) TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) tags=; \ here=`pwd`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ awk ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) mostlyclean-tags: clean-tags: distclean-tags: -rm -f TAGS ID maintainer-clean-tags: distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist -rm -rf $(distdir) GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz mkdir $(distdir)/=build mkdir $(distdir)/=inst dc_install_base=`cd $(distdir)/=inst && pwd`; \ cd $(distdir)/=build \ && ../configure --srcdir=.. --prefix=$$dc_install_base \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) dist -rm -rf $(distdir) @banner="$(distdir).tar.gz is ready for distribution"; \ dashes=`echo "$$banner" | sed s/./=/g`; \ echo "$$dashes"; \ echo "$$banner"; \ echo "$$dashes" dist: distdir -chmod -R a+r $(distdir) GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) -rm -rf $(distdir) dist-all: distdir -chmod -R a+r $(distdir) GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) -rm -rf $(distdir) distdir: $(DISTFILES) -rm -rf $(distdir) mkdir $(distdir) -chmod 777 $(distdir) $(mkinstalldirs) $(distdir)/contrib $(distdir)/texi @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ || cp -p $$d/$$file $(distdir)/$$file || :; \ fi; \ done for subdir in $(SUBDIRS); do \ if test "$$subdir" = .; then :; else \ test -d $(distdir)/$$subdir \ || mkdir $(distdir)/$$subdir \ || exit 1; \ chmod 777 $(distdir)/$$subdir; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \ || exit 1; \ fi; \ done info-am: info: info-recursive dvi-am: dvi: dvi-recursive check-am: all-am check: check-recursive installcheck-am: installcheck: installcheck-recursive install-exec-am: install-exec: install-exec-recursive install-data-am: install-data: install-data-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-recursive uninstall-am: uninstall: uninstall-recursive all-am: Makefile all-redirect: all-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: installdirs-recursive installdirs-am: mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) -rm -f config.cache config.log stamp-h stamp-h[0-9]* -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: mostlyclean-am: mostlyclean-tags mostlyclean-generic mostlyclean: mostlyclean-recursive clean-am: clean-tags clean-generic mostlyclean-am clean: clean-recursive distclean-am: distclean-tags distclean-generic clean-am distclean: distclean-recursive -rm -f config.status maintainer-clean-am: maintainer-clean-tags maintainer-clean-generic \ distclean-am @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." maintainer-clean: maintainer-clean-recursive -rm -f config.status .PHONY: install-data-recursive uninstall-data-recursive \ install-exec-recursive uninstall-exec-recursive installdirs-recursive \ uninstalldirs-recursive all-recursive check-recursive \ installcheck-recursive info-recursive dvi-recursive \ mostlyclean-recursive distclean-recursive clean-recursive \ maintainer-clean-recursive tags tags-recursive mostlyclean-tags \ distclean-tags clean-tags maintainer-clean-tags distdir info-am info \ dvi-am dvi check check-am installcheck-am installcheck install-exec-am \ install-exec install-data-am install-data install-am install \ uninstall-am uninstall all-redirect all-am all installdirs-am \ installdirs mostlyclean-generic distclean-generic clean-generic \ maintainer-clean-generic clean mostlyclean distclean maintainer-clean dict: @EIWA_DICT@ @WAEI_DICT@ # info_TEXINFOS = sdic.texi # this requires makeinfo install-dict: $(mkinstalldirs) @DICTDIR@ $(INSTALL_DATA) @EIWA_DICT@ @DICTDIR@ $(INSTALL_DATA) @WAEI_DICT@ @DICTDIR@ install-info: texi/sdic.info $(INSTALL_DATA) texi/sdic.info @infodir@ info: texi/sdic.info texi/sdic.info: texi/sdic.texi $(EMACS) -batch -q -l install.el -f batch-texinfo-format $? config: lisp/sample.emacs @echo -n "本当に $$HOME/.emacs を書き換えますか[yes/no] " ;\ read YN ;\ test "$$YN" = yes @if [ -f "$$HOME/.emacs" ] ;\ then \ echo "元の $$HOME/.emacs を $$HOME/.emacs.orig として保存します";\ cp -p $$HOME/.emacs $$HOME/.emacs.orig ;\ fi ( echo ; cat lisp/sample.emacs )>>$$HOME/.emacs gene.dic: contrib/gene.perl gene.txt @NKF@ -S -e gene.txt | @PERL@ contrib/gene.perl --compat > $@ gene.sdic: contrib/gene.perl gene.txt @NKF@ -S -e gene.txt | @PERL@ contrib/gene.perl > $@ jgene.dic: contrib/jgene.perl gene.dic @PERL@ contrib/jgene.perl --compat < gene.dic > $@ jgene.sdic: gene.dic @PERL@ contrib/jgene.perl < gene.dic > $@ gene.txt: test -f gene95.lzh -o -f gene95.tar.gz -o -f gene95.tar.bz2 if [ -f gene95.lzh ]; then \ lha x gene95.lzh gene.txt; \ elif [ -f gene95.tar.gz ]; then \ @GZIP@ -dc gene95.tar.gz | tar xf - gene.txt; \ else \ @BZIP2@ -dc gene95.tar.bz2 | tar xf - gene.txt; \ fi test -s gene.txt eijirou.dic: contrib/eijirou.perl @NKF@ -S -e @EIJIROU_DIR@/*.txt | @PERL@ contrib/eijirou.perl --compat > $@ eijirou.sdic: contrib/eijirou.perl @NKF@ -S -e @EIJIROU_DIR@/*.txt | @PERL@ contrib/eijirou.perl > $@ waeijirou.dic: contrib/eijirou.perl @NKF@ -S -e @WAEIJIROU_DIR@/*.txt | @PERL@ contrib/eijirou.perl --waei --compat > $@ waeijirou.sdic: contrib/eijirou.perl @NKF@ -S -e @WAEIJIROU_DIR@/*.txt | @PERL@ contrib/eijirou.perl --waei > $@ jedict.sdic: edict contrib/edict.perl @PERL@ contrib/edict.perl edict > $@ j4jwords.sdic: 4jwords contrib/edict.perl @PERL@ contrib/edict.perl 4jwords > $@ jcompdic.sdic: compdic contrib/edict.perl @PERL@ contrib/edict.perl compdic > $@ jenamdict.sdic: enamdict contrib/edict.perl @PERL@ contrib/edict.perl enamdict > $@ eedict.sdic: edict contrib/edict.perl @PERL@ contrib/edict.perl --reverse edict > $@ e4jwords.sdic: 4jwords contrib/edict.perl @PERL@ contrib/edict.perl --reverse 4jwords > $@ ecompdic.sdic: compdic contrib/edict.perl @PERL@ contrib/edict.perl --reverse compdic > $@ eenamdict.sdic: enamdict contrib/edict.perl @PERL@ contrib/edict.perl --reverse enamdict > $@ jedict.dic: edict @NKF@ -deZ2 edict | \ @PERL@ -pe 's!\s+/!\t!;s!/!, !g;s!, $$!!' | @SORT@ -f > $@ j4jwords.dic: 4jwords @NKF@ -deZ2 4jwords | \ @PERL@ -pe 's!\s+/!\t!;s!/!, !g;s!, $$!!' | @SORT@ -f > $@ jcompdic.dic: compdic @NKF@ -deZ2 compdic | \ @PERL@ -pe 's!\s+/!\t!;s!/!, !g;s!, $$!!' | @SORT@ -f > $@ jenamdict.dic: enamdict @NKF@ -deZ2 enamdict | \ @PERL@ -pe 's!\s+/!\t!;s!/!, !g;s!, $$!!' | @SORT@ -f > $@ eedict.dic: edict @PERL@ contrib/edict.perl --reverse edict | \ @PERL@ contrib/gene.perl --sdic-to-compat > $@ e4jwords.dic: 4jwords @PERL@ contrib/edict.perl --reverse 4jwords | \ @PERL@ contrib/gene.perl --sdic-to-compat > $@ ecompdic.dic: compdic @PERL@ contrib/edict.perl --reverse compdic | \ @PERL@ contrib/gene.perl --sdic-to-compat > $@ eenamdict.dic: enamdict @PERL@ contrib/edict.perl --reverse enamdict | \ @PERL@ contrib/gene.perl --sdic-to-compat > $@ edict: test -f $@.gz -o -f $@.bz2 if [ -f $@.gz ]; then \ @GZIP@ -dc $@.gz >$@ ;\ else \ @BZIP2@ -dc $@.bz2 >$@ ;\ fi test -s $@ 4jwords: test -f $@.gz -o -f $@.bz2 if [ -f $@.gz ]; then \ @GZIP@ -dc $@.gz >$@ ;\ else \ @BZIP2@ -dc $@.bz2 >$@ ;\ fi test -s $@ compdic: test -f $@.gz -o -f $@.bz2 if [ -f $@.gz ]; then \ @GZIP@ -dc $@.gz >$@ ;\ else \ @BZIP2@ -dc $@.bz2 >$@ ;\ fi test -s $@ enamdict: test -f $@.gz -o -f $@.bz2 if [ -f $@.gz ]; then \ @GZIP@ -dc $@.gz >$@ ;\ else \ @BZIP2@ -dc $@.bz2 >$@ ;\ fi test -s $@ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: sdic-2.1.3/contrib/0000755000175000017500000000000007512046270007643 5sdic-2.1.3/contrib/edict.perl0000555000175000017500000000730307510505074011543 #!/usr/local/bin/perl # Author: TSUCHIYA Masatoshi # Keywords: dictionary # EDICT形式の辞書をSDIC形式に変換する Perl スクリプト # EDICT形式は、オーストラリア・Monash大学の Jim Breen 教授が収集されて # いる和英辞書のフォーマットです。このフォーマットの辞書は、以下のURL # から入手できます。 # # ftp://ftp.u-aizu.ac.jp/pub/SciEng/nihongo/ftp.cc.monash.edu.au/ # # SDIC形式に変換する場合は、次のように利用して下さい。 # # perl edict.perl edict >edict.sdic # # SDIC形式の詳細については sdic.texi を参照して下さい。英和辞書に変換 # するためには、 # # perl edict.perl --reverse edict >edict.sdic # # と --reverse オプションを追加して実行して下さい。ただし、あまり良い # 英和辞書は得られません。これを改良して下さる方を募集中です。 eval { binmode(STDOUT); }; if( $ARGV[0] eq '--reverse' ){ shift; &reverse(); } else { &normal(); } # 通常のSDIC形式の辞書を作る関数 sub normal { $_ = <>; # 最初の1行は著作権表示である s!^[^/]+/!!; s!/$!!; s!\s*$!\n!; # 改行コードを変換 [sdic:00428] print "# ",$_; while( <> ){ s/\s+$//; # 行末の空白文字を削除 s!/\(P\)/$!!; # 外来語のマークを削除する [sdic:00430] s/&/&/g; # メタキャラクタを置換する s//>/g; s/^([\200-\377]+) +//; # 見出し語を切り出す $head = $1; $key = $head; while( s/^\[([\200-\377]+)\] +// ){ $key .= ">$1"; } s!^/!!; s!/$!!; $KEY{ sprintf("%s>%s",$head,$_) } .= ">$key"; } for $str ( keys %KEY ){ ( $head,$content ) = split( />/,$str ); $KEY{$str} =~ s/^>//; for( split(/>/,$KEY{$str}) ){ $key{$_}++; } push( @LINE,sprintf( "%s%s%s\n", $head, join( "", map( sprintf("%s",$_), grep( $_ ne $head, sort keys %key ) ) ), $content ) ); undef %key; } undef %KEY; print sort @LINE; } # 逆向きのSDIC形式の辞書を作る関数 sub reverse { $_ = <>; # 最初の1行は著作権表示である s!^[^/]+/!!; s!/$!!; s!\s*$!\n!; # 改行コードを変換 [sdic:00428] print "# ",$_; while( <> ){ s/\s+$//; # 行末の空白文字を削除 s!/\(P\)/$!!; # 外来語のマークを削除する [sdic:00430] s/&/&/g; # メタキャラクタを置換する s//>/g; s/^([\200-\377]+) +//; # 見出し語を切り出す $content = $1; # 見出し語が説明文になる while( s/^\[([\200-\377]+)\] +// ){ ; } # 振り仮名を捨てる s!^/!!; s!/$!!; for $head ( split( "/",$_ ) ){ $STR{$head} .= ">$content"; } } for $head ( keys %STR ){ for( split( />/,substr($STR{$head},1) ) ){ $content{$_}++; } for( keys %content ){ if( /^([\200-\377]{2})\1/ && $content{sprintf("%s々%s",$1,substr($_,4))} ){ $content{$_}=0; } } $str = $head; $str =~ tr/A-Z/a-z/; $str =~ s/\s+/ /; $key = $str; # $key = 空白と英大文字/小文字の正規化を行なった文字列 $str =~ s/^(\([^\)]+\) *)+//; $str =~ s/( *\([^\)]+\))+$//; $str =~ s/^~ //; $str =~ s/ ~$//; # $str = (...) や ~ を取り除いた文字列 $str = $key unless $str; if( $str eq $head ){ push( @LINE, sprintf( "%s\x00%s\x00<%s%s\n", $str, $head, $head, join("/",grep($content{$_}>0,keys %content)) )); } elsif( $key eq $head ){ push( @LINE, sprintf( "%s\x00%s\x00<%s%s%s\n", $str, $head, $head, $str, join("/",grep($content{$_}>0,keys %content)) )); } elsif( $key eq $str ){ push( @LINE, sprintf( "%s\x00%s\x00<%s%s%s\n", $str, $head, $head, $str, join("/",grep($content{$_}>0,keys %content)) )); } else { push( @LINE, sprintf( "%s\x00%s\x00<%s%s%s%s\n", $str, $head, $head, $str, $key, join("/",grep($content{$_}>0,keys %content)) )); } undef %content; } undef %STR; for( sort @LINE ){ @f = split( / # Keywords: dictionary # 『英辞郎』を変換する Perl スクリプト # 英辞郎は、非常に巨大なテキストベースの辞書です。しかし、Internet 上 # では配布されておらず、Nifty-Serve からダウンロードするか、CD-ROM ま # たは書籍を購入する必要があります。 # # COMPAT形式に変換する場合は、 # # nkf -S -e [file]... | perl eijirou.perl --compat >eijirou.dic # # SDIC形式に変換する場合は、 # # nkf -S -e [file]... | perl eijirou.perl >eijirou.sdic # # と指定して下さい。それぞれの形式の詳細については sdic.texi を参照。 $CHAR = "(?:[\xa1-\xfe][\xa1-\xfe]|[^\xa1-\xfe])"; $HIRAGANA = "(?:[\xa4][\xa1-\xf3])"; for( @ARGV ){ if( $_ eq '--unsort' ){ $UNSORT = 1; } elsif( $_ eq '--compat' ){ $COMPAT = 1; } elsif( $_ eq '--waei' ){ $WAEI = 1; } else { push( @tmp, $_ ); } } @ARGV = @tmp; eval { binmode(STDOUT); }; if( $COMPAT ){ &compat(); } else { &sdic(); } # COMPAT形式の辞書を生成する関数 sub compat { while( <> ){ s/\s+$//; # 行末の改行コードを削除 s/\t/ /g; # タブを空白8文字に置換 s/^[\200-\377]{2}//; # 行頭の全角文字を削除 s/(\{[^\}]+\}) : / : $1 /; # {…} を説明文に移動する ( $key,$content ) = split( / +: /,$_,2 ); $head = $key; $key =~ tr/A-Z/a-z/; if( $UNSORT ){ print "$head\t$content\n"; } else { push( @line, "$key\x00$head\x00\t$head\t$content\n" ); } } unless( $UNSORT ){ for( sort @line ){ @f = split(/\t/,$_,3); print "$f[1]\t$f[2]"; } } } # SDIC 形式の辞書を生成する関数 sub sdic { while( <> ){ s/\s+$//; # 行末の改行コードを削除 s/&/&/g; # メタキャラクタを置換する s//>/g; s/^[\200-\377]{2}//; # 行頭の全角文字を削除 ( $head,$content ) = split( / +: /,$_,2 ); $key = $head; $key =~ s/ +\{[^\}]+\}//; # {…} を検索キーから削除する $key =~ s/ +\(\d+\)//; # (…) を検索キーから削除する $key =~ tr/A-Z/a-z/; $key =~ s/\s+/ /; if( $WAEI ){ # 和英辞朗に特有の調整を行う while( $content =~ s/^($CHAR*?)●/$1 \/ /o ){ ; } $key =~ s/^($CHAR*?);(?:($CHAR*?)|〜)$HIRAGANA?$/$1/o; $key =~ s/^($CHAR*?)◆$CHAR*?$/$1/o; } if( $UNSORT ){ if( $key eq $head ){ print "$key$content\n"; } else { print "$head$key$content\n"; } } else { if( $key eq $head ){ push( @line,"$key\x00$head\x00<$key$content\n" ); } else { push( @line,"$key\x00$head\x00<$head$key$content\n" ); } } } unless( $UNSORT ){ for( sort @line ){ @f = split(/ # Keywords: dictionary # GENE95辞書を変換する Perl スクリプト # GENE95辞書は、Kurumi さんが Nifty-Serve 英会話フォーラムで公開されて # いる英和辞書です。「窓の杜」や SDIC のページから入手できます。 # # http://pine.kuee.kyoto-u.ac.jp/member/tsuchiya/elisp/gene.html # # COMPAT形式に変換する場合は、 # # nkf -S -e gene.txt | perl gene.perl --compat >gene.dic # # SDIC形式に変換する場合は、 # # nkf -S -e gene.txt | perl gene.perl >gene.sdic # # と指定して下さい。それぞれの形式の詳細については sdic.texi を参照。 # # なお、COMPAT形式の辞書をSDIC形式に変換する場合は、 # # perl gene.perl --compat-to-sdic gene.dic >gene.sdic # # として下さい。 # # SDIC形式の辞書をCOMPAT形式に変換する場合は、 # # perl gene.perl --sdic-to-compat gene.sdic >gene.dic # # として下さい。SDIC形式のほうが情報が豊かなので、この変換を行うと一般 # 的には情報が欠落しますので、注意して使って下さい。 eval { binmode(STDOUT); }; if(( $ARGV[0] eq '--compat' )){ shift; &compat(); } elsif(( $ARGV[0] eq '--compat-to-sdic' )){ shift; &compat_to_sdic(); } elsif(( $ARGV[0] eq '--sdic-to-compat' )){ shift; &sdic_to_compat(); } else { &sdic(); } # SDIC形式の辞書をつくる関数 sub sdic { $_ = <>; # 2行読み飛ばす s/\s*$/\n/; # 改行コードを変換 [sdic:00428] print "# ",$_; $_ = <>; s/\s*$/\n/; print "# ",$_; for( $i=0; <>; $i++ ){ s/\s+$//; # 行末の空白文字を削除 s/&/&/g; # メタキャラクタを置換する s//>/g; if( $i%2==0 ){ $key = $_; }else{ $head = $key; $key =~ tr/A-Z/a-z/; $key =~ s/\s+/ /; $key =~ s/ \+\d+//; if( $key eq $head ){ push( @line, "$key\x00$head\x00<$key$_\n" ); } else { push( @line, "$key\x00$head\x00<$head$key$_\n" ); } } } for( sort @line ){ @f = split(/; # 2行読み飛ばす <>; for( $i=0; <>; $i++ ){ s/\s+$//; s/\t/ /g; if( $i%2==0 ){ $word = $_; }else{ $orig = $word; $word =~ tr/A-Z/a-z/; push( @line, "$word\x00$orig\x00\t$orig\t$_\n" ); } } for( sort @line ){ @f = split(/\t/,$_,3); print "$f[1]\t$f[2]"; } } # COMPAT形式の辞書をSDIC形式に変換する関数 sub compat_to_sdic { while( <> ){ s/\s+$//; # 行末の空白文字を削除 s/&/&/g; # メタキャラクタを置換する s//>/g; @f = split( /\t/,$_,2 ); $k = $f[0]; $k =~ tr/A-Z/a-z/; $k =~ s/\s+/ /; $k =~ s/ \+\d+//; if( $k eq $f[0] ){ push( @line, "$k\x00$f[0]\x00<$k$f[1]\n" ); } else { push( @line, "$k\x00$f[0]\x00<$f[0]$k$f[1]\n" ); } } for( sort @line ){ @f = split(/ ){ next unless /^(.*?)!!; # 見出し語を取り出す $head = $2; $head =~ s/<//g; $head =~ s/&/&/g; while( s!^(.*)!! ){ ; } s/<//g; s/&/&/g; s/\t/ /g; $key = $head; $key =~ tr/A-Z/a-z/; push( @line, "$key\x00$head\x00\t$head\t$_\n" ); } for( sort @line ){ @f = split(/\t/,$_,3); print "$f[1]\t$f[2]"; } } sdic-2.1.3/contrib/jgene.perl0000755000175000017500000001170206746021164011546 #!/usr/bin/perl -w # # EJ to JE dictionary converter for gene.dic [1/25/1999] # # Copyright (C) 1998-1999 Satoru Takabayashi All rights reserved. # This is free software with ABSOLUTELY NO WARRANTY. # # You can redistribute it and/or modify it under the terms of # the GNU General Public License version 2. # # gene.dic を元に和英辞書を作成します。 # gene.dic の書式に合わせてそれなりの処理を行います。 # かなり書式に揺れがあるので調整するのはなかなか難解でした。 # Perl 5.003 以降が必要です。 JPerl で動くかは分かりません。 # このファイルは日本語 EUC でなければなりません。 # # 使い方: jgene.pl [--compat] < gene.dic > jgene.dic # --compat: 互換モード # # Pentium 133MHz, 64MB のマシンで約 2分かかります。 # # 既知の問題点 # * ・・から積み荷をおろす unload # * ーとの交換で in barter with ~ # * 〜(いやなこと)を経験させる put someone through ~ # のように先頭が記号で始まるものをそのままにしている。 # require 5.004; use strict; use IO::File; my $CHOON = "(?:[\xa1][\xbc])"; # ー my $CHOON2 = "(?:[\xa1][\xc1])"; # 〜 my $NAKAGURO = "(?:[\xa1][\xa6])"; # ・ my $HIRAGANA = "(?:[\xa4][\xa1-\xf3])"; my $KANJI = "(?:[\xb0-\xfe][\xa1-\xfe]|\xa1\xb9)"; my $CHAR = "(?:[\xa1-\xfe][\xa1-\xfe]|[^\xa1-\xfe])"; my $KAKASI = "kakasi"; my %je; my $Compatible = 0; $Compatible = 1, shift @ARGV if defined($ARGV[0]) && $ARGV[0] eq "--compat"; $| = 1; print STDERR "reading input...\n"; eval { binmode(STDOUT); }; while(<>) { /(.*)\t(.*)/; my $term = $1; my $definition = $2; # 括弧内などのカンマをエスケイプしておく $definition =~ s/(\/.*) /escape_commas($1)/e; $definition =~ s/(\(.*?\))/escape_commas($1)/ge; $definition =~ s/(\".*?\")/escape_commas($1)/ge; $definition =~ s/(\<.*?\>)/escape_commas($1)/ge; # ★マークの注釈を前の意味に繋げる # cable lock ワイヤ錠,★南京錠はpadlock $definition =~ s/, *(★)/$1/g; my @meanings = split(/, */, $definition); for my $meaning (@meanings) { # いい加減な変換を2重に行う $meaning = transform($meaning); $meaning = transform($meaning); # = マークならばその元の単語にくっつける # (二つ目以降の項目にこれがくると良くないんだけど) # business trend =economic trend,景気動向 if ($meaning =~ /^=/) { $meaning =~ s/\x0/,/g; $term .= " $meaning"; next; } # エスケイプしておいたカンマを復活 $meaning =~ s/\x0/,/g; # 先頭が日本語ならば登録する $je{$meaning} .= $term . ", " if $meaning =~ /^[\xa1-\xfe]/; } } # ひらがなの読みを KAKASI に作ってもらう and 出力 # IPC::Open2 はいまいちなので一旦ファイルに書き出す if ($Compatible) { for my $tmp (sort keys (%je)) { $je{$tmp} =~ s/, *$//; print $tmp, "\t", $je{$tmp}, "\n"; } } else { print STDERR "working KAKASI...\n"; my $fname = "tmp.$$"; { my $fh = new IO::File; $fh->open("|$KAKASI -JH -KH > $fname") or die $!; for my $tmp (sort keys(%je)) { if ($tmp =~ /^$CHAR*$KANJI/o) { print $fh $tmp, "\n"; } else { print $fh "\n"; } } } my @results = (); { my $fh = new IO::File; $fh->open("$fname") or die $!; @results = <$fh>; } print STDERR "outputting results to stdout...\n"; my $i = 0; for my $tmp (sort keys (%je)) { $je{$tmp} =~ s/, *$//; $je{$tmp} =~ s/&/&/g; $je{$tmp} =~ s//>/g; $results[$i++] =~ /^((?:$HIRAGANA|$CHOON|$CHOON2|$NAKAGURO)+)/o; my $yomi = $1; if ($yomi && $tmp =~ /^$CHAR*$KANJI/o) { print "$tmp", "$yomi", $je{$tmp}, "\n"; } else { print "$tmp", $je{$tmp}, "\n"; } } unlink $fname; } # おしまい sub escape_commas ($) { my ($str) = @_; $str =~ s/,/\x0/g; $str; } sub transform($) { my ($meaning) = @_; # 先頭の空白を捨てる $meaning =~ s/^ +//; # 見出しの数字部分を削除 # bottle 1.ビン,瓶,2.ビンに入れる,ビンに入れて密封する,抑える $meaning =~ s/^(\d+\. *)|(\(\d+\) *)//; # (the 〜) を削除 # brink of bankruptcy (the 〜)破産の瀬戸際 $meaning =~ s/\(the .*?\)//; # 先頭の (a 〜) を削除 # bottle of ~ (a 〜)一ビンの $meaning =~ s/^\(a .*?\)//; # 先頭の ? を後ろへ持っていく # BIL ? 基準衝撃絶縁強度 $meaning =~ s/^\? (.*)/$1 ?/; # 先頭の 【...】 を後ろへ持っていく # British Columbia 【地名】ブリティッシュコロンビア;略:BC # 先頭の 《...》 を後ろへ持っていく # beanery 1.《米会話》安レストラン,大衆食堂,2.《米暗黒街》留置場 # 先頭の <...> を後ろへ持っていく # benign 1.<人・性格などが>親切な,優しい, # 2.<気候・風土が>健康に良い,温和な # 先頭の (...) を後ろへ持っていく # captivate (〜の心を)捕える,魅惑する,人をうっとりさせる,心を奪う # 先頭の [...] を後ろへ持っていく # ciao 《伊》[感]<話>チャオ,こんにちは,さようなら $meaning =~ s/^((?:(?:【$CHAR*?】)|(?:《$CHAR*?》)|(?:<.*?>)|(?:\(.*?\))|(?:\[.*?\]) *)+)(.*)/$2 $1/; # 先頭の "..." から "" を取る # European Free Trade Association "エフタ",欧州自由貿易連合;略:EFTA $meaning =~ s/"(.*?)"/$1/; $meaning; } sdic-2.1.3/texi/0000755000175000017500000000000007512046270007154 5sdic-2.1.3/texi/sdic.texi0000444000175000017500000010377007510306113010710 \input texinfo @c -*-texinfo-*- @c $Id: sdic.texi,v 1.12 2002/07/02 11:19:39 tsuchiya Exp $ @c %**start of header @setfilename sdic.info @settitle SDIC Reference Manual @setchapternewpage odd @c %**end of header @ifinfo This file documents about SDIC, an Emacs-Lisp program to look dictionaries. Copyright @copyright{} 1998,1999 TSUCHIYA Masatoshi Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. $BCx:n8"I=<($H$3$N5v2DJ8$,$9$Y$F$NJ#@=$KB8:_$9$k8B$j!"$3$N@bL@=q$N$^$C$?$/(B $BF10l$NJ#@=$r:n$j!"G[I[$9$k$3$H$r5v2D$9$k!#(B Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. $BF10lJ#@=$N>r7o$N2<$G!"$=$l$K$h$C$FF@$i$l$?7k2L$r$3$N5v2DJ8$NI=<($HF10l$N(B $B>r7o$N$b$H$GG[I[$9$k8B$j!"$3$N@bL@=q$N=$@5HG$NJ#@=$r$7!"G[I[$9$k$3$H$r5v(B $B2D$9$k!#(B Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions. $B>e5-$N=$@5HG$K4X$9$k>r7o$N2<$G!"$3$N@bL@=q$NK]Lu$NJ#@=$r:n$j!"G[I[$9$k$3(B $B$H$r5v2D$9$k!#(B @end ifinfo @titlepage @title SDIC Reference Manual @author by TSUCHIYA Masatoshi @page @vskip 0pt plus 1filll Copyright @copyright{} 1998,1999 TSUCHIYA Masatoshi Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. $BCx:n8"I=<($H$3$N5v2DJ8$,$9$Y$F$NJ#@=$KB8:_$9$k8B$j!"$3$N@bL@=q$N$^$C$?$/(B $BF10l$NJ#@=$r:n$j!"G[I[$9$k$3$H$r5v2D$9$k!#(B Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. $BF10lJ#@=$N>r7o$N2<$G!"$=$l$K$h$C$FF@$i$l$?7k2L$r$3$N5v2DJ8$NI=<($HF10l$N(B $B>r7o$N$b$H$GG[I[$9$k8B$j!"$3$N@bL@=q$N=$@5HG$NJ#@=$r$7!"G[I[$9$k$3$H$r5v(B $B2D$9$k!#(B Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions. $B>e5-$N=$@5HG$K4X$9$k>r7o$N2<$G!"$3$N@bL@=q$NK]Lu$NJ#@=$r:n$j!"G[I[$9$k$3(B $B$H$r5v2D$9$k!#(B @end titlepage @node Top, Overview, (dir), (dir) @comment node-name, next, previous, up @ifinfo SDIC $B$O!"(BEmacs $B>e$G1QOB(B/$BOB1Q<-=q$r1\Mw$9$k$?$a$N4J7i(B( simple )$B$G!">.$5$/(B ( small )$B$F!"7Z$/(B( speedy )$B$F!">.?h(B( smart )$B$J%W%m%0%i%`$G$9!#(B $B$3$N@bL@=q$O!"(BSDIC-2.1 $B$KBP1~$7$^$9!#(B @end ifinfo @menu * Overview:: $B35MW(B * Search Dictionary:: $B<-=q$r8!:w$9$k(B * Customizations:: SDIC $B$r@_Dj$9$k(B * Dictionaries:: $BMxMQe$G1QOB(B/$BOB1Q<-=q$r1\Mw$9$k$?$a$N4J7i(B( simple )$B$G!">.$5$/(B ( small )$B$F!"7Z$/(B( speedy )$B$F!">.?h(B( smart )$B$J%W%m%0%i%`$G$9!#7h$7$F!"(B Stupid DICtionary $B$NN,$G$O$"$j$^$;$s!#(B Internet $B$rDL$7$F!"MF0W$KF~]$H(B $B$7$F$$$^$9!#;HMQl9g!"<+(B $BF0E*$K85!9$N8l$r8!:w$7$^$9!#(B @item $BF0;l$d7AMF;l$N5,B'JQ2=$dL>;l$NJ#?t7A$r<+F0E*$Kr7o$K=>$C$F$/$@$5$$!#@53N$J>r7o$K$D$$$F$O!"%Q%C(B $B%1!<%8$KF1:-$5$l$F$$$k(B @file{COPYING} $B$r;2>H$7$F$/$@$5$$!#(B $B$^$?!"(BSDIC $B$K$D$$$F5DO@$9$k$?$a$N%a!<%j%s%0%j%9%H(B $B$,3+@_$5$l$F$$$^$9!#;22C$r4uK>$5$l$kJ}$O!"(B @example sdic-ctl@@namazu.org @end example $B08$K(B subscribe ANATANO Namae $B$H$$$&K\J8$N%a!<%k$rAw$C$F2<$5$$!#(B @node Search Dictionary, Customizations, Overview, Top @comment node-name, next, previous, up @chapter $B<-=q$r8!:w$9$k(B $BE,@Z$K%$%s%9%H!<%k$5$l$F$$$l$P!"(BSDIC $B$rMxMQ$9$k$N$O6K$a$F4JC1$G$9!#C1=c(B $B$K(B @key{M-x sdic} $B$H$7$F2<$5$$!#(B @menu * Input Query:: $B8!:w8l$rF~NO$9$k(B * Keymap:: $B1\Mw;~$K;H$($k%-!<(B * Functions:: $B8!:w8l$rF~NO$9$k4X?t(B @end menu @node Input Query, Keymap, Search Dictionary, Search Dictionary @comment node-name, next, previous, up @section $B8!:w8l$rF~NO$9$k(B @kindex M-x sdic $BE,@Z$K%$%s%9%H!<%k$5$l$F$$$l$P!"(BSDIC $B$rMxMQ$9$k$N$O6K$a$F4JC1$G$9!#C1=c(B $B$K(B @key{M-x sdic} $B$H$7$F2<$5$$!#$9$k$H!"(B @example Input word : @end example $B$HI=<($5$lC18l$NF~NO$,B%$5$l$^$9$+$i!"%_%K%P%C%U%!$KC18l$rF~NO$9$k$H!"<-(B $B=q$r%-!<%o!<%I8!:w$r9T$J$$$^$9!#$3$N7k2L$H$7$FI=<($5$l$k<-=q1\Mw%&%$%s%I(B $B%&Fb$GMxMQ2DG=$J%-!<$K$D$$$F$O(B@xref{Keymap},$B$r;2>H!#(B $B$J$*!"@_DjNcDL$j$K@_Dj$7$?>l9g$O!"(B@key{C-c w} $B$H$9$l$P(B SDIC $B$,5/F0$5$l$^(B $B$9!#(B $B%-!<%o!<%I8!:w0J30$N8!:w$r9T$J$&$?$a$K$O!"$C$F8!(B $B:w8l$rF~NO$7$F2<$5$$!#(B @table @samp @item 'word' $B8!:w8l(B word $B$r%7%s%0%k%/%*!<%H$G0O$`$H!"(Bword $B$K40A40lCW$9$kC18l$r8!:w$7(B $B$^$9!#(B @item word* $B8!:w8l(B word $B$N:G8e$K%"%9%?%j%9%/$rIU$12C$($k$H!"(Bword $B$KA0J}0lCW$9$kC18l(B $B$r8!:w$7$^$9!#(B @item *word $B8!:w8l(B word $B$N@hF,$K%"%9%?%j%9%/$rIU$12C$($k$H!"(Bword $B$K8eJ}0lCW$9$kC18l(B $B$r8!:w$7$^$9!#(B @item /word $B8!:w8l(B word $B$N@hF,$K%9%i%C%7%e$rIU$12C$($k$H$r!"(Bword $B$r%-!<$H$7$FA4J88!(B $B:w$r9T$J$$$^$9!#(B @end table @node Keymap, Functions, Input Query, Search Dictionary @comment node-name, next, previous, up @section $B%-!<%^%C%W(B $B<-=q1\Mw%&%$%s%I%&Fb$G$O0J2<$N%-!<$,MxMQ$G$-$^$9!#(B @table @samp @item w $B?7$?$JC18l$r8!:w$9$k!#(B @item ' $B?7$?$JC18l$r40A40lCW8!:w$9$k(B @item ^ $B?7$?$JC18l$rA0J}0lCW8!:w$9$k(B @item $ $B?7$?$JC18l$r8eJ}0lCW8!:w$9$k(B @item / $B?7$?$JC18l$rA4J88!:w$9$k(B @item SPC $B<-=q1\Mw%&%$%s%I%&$r%9%/%m!<%k%"%C%W$9$k!#(B @item b @itemx BS @itemx Delete $B<-=q1\Mw%&%$%s%I%&$r%9%/%m!<%k%@%&%s$9$k!#(B @item n @itemx TAB $B$N%&%$%s%I%&$K0\$k!#(B @item q $B<-=q1\Mw%&%$%s%I%&$r>C$9!#(B @item < $B<-=q1\Mw%&%$%s%I%&$N@hF,$K0\F0$9$k!#(B @item > $B<-=q1\Mw%&%$%s%I%&$N=*C<$K0\F0$9$k!#(B @item ? $B%X%k%W$rI=<($9$k!#(B @item Q SDIC $B$r=*N;$9$k!#(B @end table @code{sdic-disable-vi-key}, @code{sdic-mode-hook} $B$J$I$NJQ?t$r;H$&$3$H$K(B $B$h$C$F!"$3$N%-!<%^%C%W$rD4@a$9$k$3$H$,=PMh$^$9!#(B@xref{Variables}. @node Functions, , Keymap, Search Dictionary @comment node-name, next, previous, up @section $B8!:w8l$rF~NO$9$k4X?t(B $B8!:w8l$rF~NO$9$k$?$a$K4v$D$+$N4X?t$,Dj5A$5$l$F$$$^$9!#9%$_$K$"$C$?4X?t$r(B $BMxMQ$7$F2<$5$$!#(B @defun sdic @defunx sdic-describe-word $B%+!<%=%k0LCV$NC18l$r%G%U%)%k%H$N8!:w8l$H$7!"$=$N8l$r%_%K%P%C%U%!Fb$GJT=8(B $B$7$F$+$i8!:w$r9T$J$&4X?t(B @end defun @defun sdic-describe-word-at-point $B%+!<%=%k0LCV$NC18l$r%G%U%)%k%H$N8!:w8l$H$7$F%-!<%o!<%I8!:w$r9T$J$&4X?t!#(B @code{sdic-describe-word} $B$KHf$Y$FM>J,$JF~NO$rI,MW$H$7$J$$$,!"$=$NBe$o$j(B $B$K8!:w8l$r=$@5$G$-$J$$!#(B @end defun @defun sdic-describe-region $B%j!<%8%g%s$G0O$C$?HO0O$r8!:w8l$H$7$F%-!<%o!<%I8!:w$r9T$J$&4X?t(B @end defun @node Customizations, Dictionaries, Search Dictionary, Top @comment node-name, next, previous, up @chapter $B%+%9%?%^%$%:(B $B$3$N>O$G$O!"<-=q$rDI2C$7$?$j!"(BSDIC $B$NF0:n$rD4@a$9$kJ}K!$K$D$$$F@bL@$7$F$$$^$9!#(B SDIC $B$+$iMxMQ$9$k$3$H$N=PMh$k<-=q$K$D$$$F$O!"(B@xref{Dictionaries}. @menu * Variables:: $BF0:n$rD4@a$9$kJQ?t(B * Setting Dictionary List:: $BMxMQ$9$k<-=q$N%j%9%H$r@_Dj$9$k(B * Library for SDIC:: SDIC$B7A<0$N<-=q$r8!:w$9$k(B * Libraries for COMPAT:: COMPAT$B7A<0$N<-=q$r8!:w$9$k(B * Samples:: $B@_DjNc(B * Trouble Shooting:: $B%H%i%V%k$N2r7h(B @end menu @node Variables, Setting Dictionary List, Customizations, Customizations @comment node-name, next, previous, up @section Lisp $BJQ?t(B @defvar sdic-left-margin $B8+=P$78l$KBP$7$F$N@bL@J8$N;z2<$2I}$r@_Dj$9$kJQ?t$G$9!#%G%U%)%k%H$NCM$O(B 2 $B$G$9!#(B @end defvar @defvar sdic-fill-column $B@bL@J8$r@07A$9$kI}!#%G%U%)%k%H$NCM$H$7$F(B @code{default-fill-column} $B$,@_(B $BDj$5$l$F$$$^$9!#(B @end defvar @defvar sdic-window-height $B8!:w7k2LI=<(%&%$%s%I%&$N9b$5!#%G%U%)%k%H$NCM$O(B 10 $B$G$9!#(B @end defvar @defvar sdic-warning-hidden-entry $B$3$NJQ?t$K(B nil $B0J30$NCM$,@_Dj$5$l$F$$$k>l9g!"8!:w7k2LI=<(%&%$%s%I%&$KI=(B $B<($7$-$l$J$+$C$?>pJs$,$"$l$P7Y9p$7$^$9!#(B @end defvar @defvar sdic-disable-select-window $B$3$NJQ?t$K(B nil $B0J30$NCM$,@_Dj$5$l$F$$$k>l9g!"8!:w7k2LI=<(%&%$%s%I%&$K%+!<(B $B%=%k$r0\F0$7$J$$$h$&$K$7$^$9!#(B @end defvar @defvar sdic-face-style @defvarx sdic-face-color $B8+=P$78l$rAu>~$9$kJ}K!$r;XDj$7$^$9!#%G%U%)%k%H$NCM$O!"(BBold Font $B$r;H$C$F(B $B8+=P$78l$rI=<($9$k$h$&$K$J$C$F$$$^$9!#(B @end defvar @defvar sdic-disable-vi-key $B$3$NJQ?t$K(B nil $B0J30$NCM$,@_Dj$5$l$F$$$k>l9g!"<-=q1\Mw;~$K(B vi $B%i%$%/$N%-!<(B $B$r;H$o$J$$$h$&$K$7$^$9!#(B @end defvar @defvar sdic-mode-hook $B<-=q1\Mw;~$NF0:n$rD4@a$9$k$?$a$N(B hook $BJQ?t(B @end defvar @defvar sdic-eiwa-dictionary-list SDIC $B$+$iMxMQ2DG=$J1QOB<-=q$N%j%9%H$r@_Dj$7$F$*$/JQ?t!#IaDL$K%$%s%9%H!<(B $B%k$7$?>l9g$O!"F1;~$K%$%s%9%H!<%k$7$?1QOB<-=q$,@_Dj$5$l$F$$$^$9!#(B @end defvar @defvar sdic-waei-dictionary-list SDIC $B$+$iMxMQ2DG=$JOB1Q<-=q$N%j%9%H$r@_Dj$7$F$*$/JQ?t!#IaDL$K%$%s%9%H!<(B $B%k$7$?>l9g$O!"F1;~$K%$%s%9%H!<%k$7$?OB1Q<-=q$,@_Dj$5$l$F$$$^$9!#(B @end defvar @defvar sdic-default-coding-system $B%*%W%7%g%s$K$h$C$F4A;z%3!<%I$rL@<(E*$K;XDj$7$J$+$C$?>l9g$K!"<-=q$N4A;z%3!<(B $B%I$H$7$F;H$o$l$kCM!#%G%U%)%k%H$NCM$OF|K\8l(B EUC $B$G$9!#(B @end defvar @node Setting Dictionary List, Library for SDIC, Variables, Customizations @comment node-name, next, previous, up @section $B8!:w$9$k<-=q$r@_Dj$9$k(B SDIC $B$r;H$C$F<-=q$r8!:w$9$k$?$a$K$O!"<-=q%U%!%$%k$H8!:wJ}K!$N;XDj$r(B2$B$D$N(B $BJQ?t(B @code{sdic-eiwa-dictionary-list}, @code{sdic-waei-dictionary-list} $B$K@_Dj$9$kI,MW$,$"$j$^$9!#(B 2$B$D$N%j%9%H$O!"$=$l$>$l$N<-=q$rDj5A$9$k(B3$B$D$NMWAG$+$i$J$k<-=qDj5A>pJs$N%j(B $B%9%H$K$J$C$F$$$^$9!#(B @enumerate @item $B8!:w%i%$%V%i%j$N%7%s%\%k(B @item $B%i%$%V%i%j$NI,?\0z?t(B @item $B%i%$%V%i%j$N>JN,2DG=$J0z?t(B @end enumerate $BNc$($P!"(BSDIC$B7A<0$N1QOB<-=q(B @file{/usr/dict/gene.sdic} $B$r(B @file{sdicf-client.el} $B$r;H$C$F8!:w=PMh$k$h$&$K$9$k$K$O!"L>$,8!:w(B $B%-!<$H$7$F4^$^$l$F$$$^$9!#L>$,F1;~$KI=<($5$l$k$h(B $B$&$K$J$j$^$9!#$3$l$O!"%i%$%V%i%j$N>JN,2DG=$J0z?t$r@_Dj$9$kNc$H$J$C$F$$$^(B $B$9!#(B @lisp (setq sdic-waei-dictionary-list '((sdicf-client "/usr/dict/edict.sdic" (add-keys-to-headword t)))) @end lisp $BJN,2DG=$J%*%W%7%g%s$r@_Dj$9$k$3$H$,=PMh$^$9!#(B @lisp (setq sdic-waei-dictionary-list '((sdic-gene "/usr/dict/jgene.dic.bz2" (extract "bzip2") (extract-option "-cd")))) @end lisp $B$I$N$h$&$J%*%W%7%g%s$,;H$($k$+$K$D$$$F$O!"$=$l$>$l$N8!:w%i%$%V%i%j$K$D$$(B $B$F$N@bL@$r;2>H$7$F$/$@$5$$!#(B @node Library for SDIC, Libraries for COMPAT, Setting Dictionary List, Customizations @comment node-name, next, previous, up @section SDIC$B7A<0$N<-=q$r8!:w$9$k(B @file{sdicf-client.el} $B$O(BSDIC$B7A<0$N<-=q$r8!:w$9$k$?$a$N%i%$%V%i%j$G$9!#(B SDIC$B7A<0$N<-=q$N>\:Y$K$D$$$F$O!"(B@xref{SDIC Format}. @file{sdicf-client.el} $B$KBP$7$F;XDj$G$-$k%*%W%7%g%s$OJN,$7$?>l9g$O!"(B @i{sdic-default-coding-system} $B$NCM$r;H$$$^$9!#(B @item title $B<-=q$N%?%$%H%k$r;XDj$7$^$9!#>JN,$7$?>l9g$O!"<-=q$N%U%!%$%kL>$NHs%G%#%l%/(B $B%H%jItJ,$r%?%$%H%k$H$7$^$9!#(B @item add-keys-to-headword $BA4$F$N8!:w%-!<$r4^$a$F8+=P$78l$r9=@.$9$k>l9g$K(B nil $B0J30$K@_Dj$7$F2<$5$$!#(B $BOB1Q<-=q$r8!:w$9$k>l9g$K!"?6$j2>L>$b4^$a$F=PNO$9$k>l9g$KMxMQ$7$^$9!#(B @item strategy @file{sdicf-client.el} $B$O!"<-=q$r8!:w$9$kJ}K!$r;HMQ4D6-$K1~$8$F;H$$J,$1(B $B$k$3$H$,=PMh$^$9!#>JN,$7$?>l9g$O!"(B@file{sdicf.el} $B$N<+F0H=Dj$K$h$C$FA*$P(B $B$l$?J}K!$r;HMQ$7$^$9!#(B @end table @i{strategy} $B%*%W%7%g%s$KBP$7$F;XDj$G$-$k8!:wJ}K!$O0J2<$NDL$j$G$9!#(B @itemize @bullet @item direct $B<-=q%G!<%?$rA4$F%a%b%j$KFI$_9~$s$G$+$i8!:w$r9T$$$^$9!#30It%3%^%s%I$rI,MW(B $B$H$7$^$;$s$,!"BgNL$N%a%b%j$,I,MW$K$J$j$^$9!#(B @item grep fgrep $B$rMxMQ$7$F8!:w$r9T$$$^$9!#(B @item array array $B$rMxMQ$7$F8!:w$r9T$$$^$9!#<-=q$N:w0z%U%!%$%k$r;vA0$K@8@.$7$F$*$$$F(B $B$+$i8!:w$r9T$$$^$9$N$G!"9bB.$K8!:w$,2DG=$G$9!#$7$+$7!":w0z%U%!%$%k$O<-=q(B $B$N(B3$BG\DxEY$NBg$-$5$K$J$j$^$9!#:w0z%U%!%$%k$N=`Hw$J$I$N>\:Y$K$D$$$F$O!"(B @xref{SUFARY}. @end itemize $BHf3SE*>.5,LO$N<-=q$r8!:w$9$k>l9g$O(B grep $B$,:GE,$G$7$g$&!#$7$+$7!"(B5MByte $B$h$jBg$-$$<-=q$N>l9g$O(B array $B$NMxMQ$r9MN8$9$Y$-$@$H;W$$$^$9!#(B @node SUFARY, , , Library for SDIC @comment node-name, next, previous, up @subsection SUFARY SDIC$B7A<0$N<-=q$r(B array $B$rMxMQ$7$F8!:w$9$k$?$a$K$O!"0J2<$NH$7$F2<$5(B $B$$!#8!:wBP>]$N%F%-%9%H$N:w0z$r;vA0$K:n@.$7$F$*$/%?%$%W$N8!:w%W%m%0%i%`$J(B $B$N$G!"(Bgrep $B$J$I$h$j$b9bB.$J8!:w$,2DG=$G$9!#(B @item SUFARY $B$NImB0J8=q$K=>$C$F!"(Barray $B$H(B mkary $B$r%$%s%9%H!<%k$7$F$*$$$F2<$5$$!#(B @item $B<-=q$r(BSDIC$B7A<0$KJQ49$7!"(Bmkary $B$r;H$C$F<-=q$N:w0z$r@8@.$7$F$*$-$^$9!#(B @end enumerate @node Libraries for COMPAT, Samples, Library for SDIC, Customizations @comment node-name, next, previous, up @section COMPAT$B7A<0$N<-=q$r8!:w$9$k(B @file{sdic-compat.el} $B$H(B @file{sdic-gene.el} $B$O(BCOMPAT$B7A<0$N<-=q$r8!:w$9(B $B$k$?$a$N%i%$%V%i%j$G$9!#(B@file{sdic-compat.el} $B$O30It%3%^%s%I$r8F$S=P$7$F(B $B$$$k$N$KBP$7$F!"(B@file{sdic-gene.el} $B$O(B Emacs $B$N5!G=$N$_$rMxMQ$7$F$$$^$9!#(B $B$?$@$7!"<-=q$r%P%C%U%!$KFI$_9~$s$G$+$i8!:w$r9T$J$&$N$G!"BgNL$N%a%b%j$,I,(B $BMW$K$J$j$^$9!#(B@xref{COMPAT Format}. Default $B$N@_Dj$G$O!"I,MW$J30It%3%^%s%I$,8+$D$+$C$?>l9g$O(B @file{sdic-compat.el} $B$r!"8+$D$+$i$J$+$C$?>l9g$K$O(B @file{sdic-gene.el} $B$r;H$&$h$&$K$J$C$F$$$^$9!#(B @menu * sdic-gene.el:: Emacs $B$N%P%C%U%!Fb$G8!:w$9$k(B * sdic-compat.el:: look / grep $B$r;H$C$F8!:w$9$k(B @end menu @node sdic-gene.el, sdic-compat.el, Libraries for COMPAT, Libraries for COMPAT @comment node-name, next, previous, up @subsection sdic-gene.el COMPAT$B7A<0$N<-=q$r30It%W%m%0%i%`$KMj$i$:$K8!:w$9$k%i%$%V%i%j$G$9!#(B COMPAT$B7A<0$N>\:Y$K$D$$$F$O(B@xref{COMPAT Format}. @file{sdic-gene.el} $B$KBP$7$F;XDj$G$-$k%*%W%7%g%s$OJN,$7$?>l9g$O!"(B @i{sdic-default-coding-system} $B$NCM$r;H$$$^$9!#(B @item title $B<-=q$N%?%$%H%k$r;XDj$7$^$9!#>JN,$7$?>l9g$O!"<-=q$N%U%!%$%kL>$NHs%G%#%l%/(B $B%H%jItJ,$r%?%$%H%k$H$7$^$9!#(B @item extract $B05=L<-=q$rE83+$9$k$?$a$N30It%3%^%s%I$r;XDj$7$^$9!#>JN,$7$?>l9g$O!"<-=q$,(B $B05=L$5$l$F$$$J$$$H8+$J$7$^$9!#(B @item extract-option @i{extract} $B%*%W%7%g%s$K$h$C$F;XDj$5$l$?30It%3%^%s%I$KBP$7$F!"<-=q$rE83+(B $B$7$FI8=`=PNO$K=PNO$5$;$k$?$a$N%3%^%s%I%i%$%s0z?t$r;XDj$7$^$9!#>JN,$7$?>l(B $B9g$O(B @i{sdic-gene-extract-option} $B$NCM$r;H$$$^$9!#(B @end table @node sdic-compat.el, , sdic-gene.el, Libraries for COMPAT @comment node-name, next, previous, up @subsection sdic-compat.el COMPAT $B7A<0$N<-=q$r30It%W%m%0%i%`(B( look / grep )$B$rMxMQ$7$F8!:w$9$k%i%$%V(B $B%i%j$G$9!#(BCOMPAT $B7A<0$N>\:Y$K$D$$$F$O(B@xref{COMPAT Format}. @file{sdic-compat.el} $B$KBP$7$F;XDj$G$-$k%*%W%7%g%s$OJN,$7$?>l9g$O!"(B @i{sdic-default-coding-system} $B$NCM$r;H$$$^$9!#(B @item title $B<-=q$N%?%$%H%k$r;XDj$7$^$9!#>JN,$7$?>l9g$O!"<-=q$N%U%!%$%kL>$NHs%G%#%l%/(B $B%H%jItJ,$r%?%$%H%k$H$7$^$9!#(B @item look $BA0J}0lCW8!:w(B / $B40A40lCW8!:w$N;~$KMxMQ$9$k30It%3%^%s%I$NL>A0$r;XDj$7$^$9!#(B $B>JN,$7$?>l9g$O(B @i{sdic-compat-look-command} $B$NCM$r;H$$$^$9!#(B @item look-case-option @i{look} $B%*%W%7%g%s$K$h$C$F;XDj$5$l$?30It%3%^%s%I$KBP$7$F!"1QBgJ8;z(B / $B>.(B $BJ8;z$r6hJL$7$J$$$G8!:w(B( case-ignore search )$B$9$k$h$&$K;X<($9$k$?$a$N%3%^(B $B%s%I%i%$%s0z?t$r;XDj$7$^$9!#>JN,$7$?>l9g$O(B @i{sdic-compat-look-case-option} $B$NCM$r;H$$$^$9!#(B @item grep $B8eJ}0lCW8!:w(B / $BA4J88!:w$N;~$KMxMQ$9$k30It%3%^%s%I$NL>A0$r;XDj$7$^$9!#>J(B $BN,$7$?>l9g$O(B @i{sdic-compat-grep-command} $B$NCM$r;H$$$^$9!#(B @item grep-case-option @i{grep} $B%*%W%7%g%s$K$h$C$F;XDj$5$l$?30It%3%^%s%I$KBP$7$F!"1QBgJ8;z(B / $B>.(B $BJ8;z$r6hJL$7$J$$$G8!:w(B( case-ignore search )$B$9$k$h$&$K;X<($9$k$?$a$N%3%^(B $B%s%I%i%$%s0z?t$r;XDj$7$^$9!#>JN,$7$?>l9g$O(B @i{sdic-compat-grep-case-option} $B$NCM$r;H$$$^$9!#(B @item egrep $B@55,I=8=8!:w$N;~$KMxMQ$9$k30It%3%^%s%I$NL>A0$r;XDj$7$^$9!#>JN,$7$?>l9g$O(B @i{sdic-compat-egrep-command} $B$NCM$r;H$$$^$9!#(B @item egrep-case-option @i{egrep} $B%*%W%7%g%s$K$h$C$F;XDj$5$l$?30It%3%^%s%I$KBP$7$F!"1QBgJ8;z(B / $B>.J8;z$r6hJL$7$J$$$G8!:w(B( case-ignore search )$B$9$k$h$&$K;X<($9$k$?$a$N%3(B $B%^%s%I%i%$%s0z?t$r;XDj$7$^$9!#>JN,$7$?>l9g$O(B @i{sdic-compat-egrep-case-option} $B$NCM$r;H$$$^$9!#(B @end table @node Samples, Trouble Shooting, Libraries for COMPAT, Customizations @comment node-name, next, previous, up @section $B@_DjNc(B $B%$%s%9%H!<%k;~$KF1;~$K@_Dj$5$l$?<-=q$r8!:w$9$k>l9g$O!"l9g$O!"(BSDIC Users $B%a!<%j%s%0%j%9%H$GAjCL$7$F$_$F2<$5$$!#(B @xref{Overview}. @menu * Broken look:: look $B$NIT6q9g$K$D$$$F(B * Broken grep:: grep $B$NIT6q9g$K$D$$$F(B * Using array in Windows:: @end menu @node Broken look, Broken grep, Trouble Shooting, Trouble Shooting @comment node-name, next, previous, up @subsection look $B$NIT6q9g$K$D$$$F(B @file{sdic-compat.el} $B$O!"<-=q$r8!:w$9$k$?$a$K30It%3%^%s%I$N(B look $B$rMxMQ(B $B$7$F$$$^$9!#$7$+$7!"0lIt$N(B look $B$O!"%P%C%U%!$N%5%$%:$N>e8B$J$I$K$h$j!"%G!<(B $B%?$,7g$1$k$3$H$,$"$k$3$H$,CN$i$l$F$$$^$9!#$*;H$$$N(B look $B$K$3$NIT6q9g$,4^(B $B$^$l$F$$$k$+$I$&$+!"D4$Y$k$?$a$KfIW$G$7$g(B $B$&!#(Blook $B$N]$N%U%!%$%k$N:G8e$N9T$r@5>o$K8!:w$G$-$J$$$H$$$&%P%0$,$"$k$3(B $B$H$,CN$i$l$F$$$^$9!#$*;H$$$N(B grep $B$K!"$3$N%P%0$,4^$^$l$F$$$k$+$I$&$+!"D4(B $B$Y$k$?$a$Ko$G$7$g$&!#(B $B%P%0$,4^$^$l$F$$$k(B grep $B$r;H$C$F$$$k>l9g$O!"(B @file{ftp://ftp.media.kyoto-u.ac.jp/pub/GNU/grep/} $B$J$I$+$i%=!<%9$rF~e$N4D6-$G(B make $B0lH/$GF0$-$^$9!#(Barray.exe $B$H(B mkary.exe $B$r(B @code{path} $B$NDL$C$?$H$3$m$K$*$-$^$7$g$&!#(B @item Mule for Win32 $B$G$O(B@emph{$B$*$=$i$/(B}$B$=$N$^$^$GF0$-$^$9!#(BMeadow + Win-NT $B$G(B $B$b!"$-$C$HBg>fIW$G$7$g$&!#(B @item Meadow + Win-95/98 $B$G$O!"(Barray $B$H0lIt$N>oCs%=%U%H$NAj@-$,0-$$$h$&$G$9!#(B $B%&%$%k%9%A%'%C%+$J$I$,FC$KAj@-$,0-$$$N$G!">oCs%=%U%H$r$O$:$7$FF0:n$5$;$F(B $B$_$F2<$5$$!#F0:n$,$*$+$7$$$H$-$O!"<-=q$N8!:w;~$OF0$/$N$G$9$,!"(BMeadow $B$r(B $B=*N;$9$k;~$K(B@emph{$B$@$a(B}$B$K$J$k$h$&$G$9!#(B @item $B$=$l$G$b$@$a$J$H$-$O!"0J2<$N>r7o$r(B $B$l$N7A<0$N>\:Y$K$D$$$F$O(B @xref{Dictionary Format},$B$r;2>H$7$F$/$@$5$$!#8=(B $B:_!"(BSDIC $B$G;HMQ\$7$/$O$=$l$i$KImB0$N%I%-%e%a%s%H$r;2>H$7$F2<$5$$!#C1=c$J%F%-%9%H7A<0$G(B $BG[I[$5$l$F$$$k1QOB<-=q$H$7$F$O!"$*$=$i$/:GBg$N$b$N$@$H;W$o$l$^$9$,!";DG0(B $B$J$,$i%$%s%?!<%M%C%H>e$G$OG[I[$5$l$F$$$^$;$s!#(B $B%Q%C%1!<%8$KF1:-$5$l$F$$$k(B @file{eijirou.perl} $B$r;HMQ$7$F!"(BCOMPAT$B7A<0$^(B $B$?$O(BSDIC$B7A<0$KJQ49$7$F$/$@$5$$!#$=$NJ}K!$K$D$$$F$O!"IUB0$N(B @file{INSTALL} $B$b;2>H$7$F$/$@$5$$!#1Q<-O/$O6K$a$F5pBg$J$N$G!"8!:w$K;~4V$,$+$+$j$^$9!#(B UNIX $B4D6-$G;HMQ$5$l$k>l9g$O!"(BSDIC$B7A<0$KJQ49$7$F!"(BSUFARY $B$rMxMQ$7$F8!:w$9(B $B$kJ}$,NI$$$G$7$g$&!#(B@xref{Library for SDIC}. @item EDICT$B<-=q(B @file{ftp://ftp.u-aizu.ac.jp/pub/SciEng/nihongo/ftp.cc.monash.edu.au/00INDEX.html} $B%*!<%9%H%i%j%"!&(BMonash$BBg3X$N(BJim Breen$B65.$5$/M^$($i$l$k!#(B @subsection BNF @example file := line* line := headword '\t' content '\n' headword := string content := string string := char+ char := [^\t\n] @end example @node SDIC Format, History, COMPAT Format, Dictionary Format @comment node-name, next, previous, up @section SDIC $B7A<0(B SDIC$B7A<0$O!"(Bgrep $B$J$I$N9T;X8~$N8!:w%W%m%0%i%`$r;H$C$FA0J}0lCW8!:w5Z$S8e(B $BJ}0lCW8!:w!"40A40lCW8!:w!"A4J88!:w$,MF0W$K9T$J$($k9=B$$K$J$C$F$$$k!#(B @subsection BNF @example file := line* line := comment | entry comment := '#' [^\n]* '\n' entry := headword keyword* content '\n' headword := '' word '' | keyword keyword := '' word '' word := char+ char := [^<>&\n] | '<' | '>' | '&' content := string string := char_lf+ char_lf := char | '&lf;' @end example @subsection $BCmo!"8!:w7k2L$rI=<($9(B $B$k$H$-$NI=Bj$H$7$FMQ$$$i$l$k!#(B @item @i{content} $B$O@bL@J8$rJ];}$9$k9=J8MWAG$G$"$k!#(B @item @i{keyword} $B$O8!:wMQ$NJ8;zNs$rJ];}$9$k9=J8MWAG$G$"$k!#=>$C$F!"8+=P$78l(B @i{headword} $B$K0J2<$N@55,2=$r;\$7$?J8;zNs$rBeF~$9$k!#(B @itemize @bullet @item $B%"%k%U%!%Y%C%H$NBgJ8;z$rA4$F>.J8;z$KJQ49$9$k(B @item $BJR2>L>$rJ?2>L>$K$9$k(B @item $BJ#?t$N6uGrJ8;z$r(B1$B$D$N%9%Z!<%9$KCV49$9$k(B @end itemize $B8+=P$78l$K4A;z$,4^$^$l$F$$$k>l9g$O!"$=$NFI$_2>L>$r(B @i{keyword} $B$H$7$FDI(B $B2C$9$k$3$H$,K>$^$7$$!#(B @item @i{headword} $B$rI=8=$9$k$?$a$N%?%0$H$7$F(B @samp{} $B$rMQ$$$kI,MW$,@8$8$k(B $B$N$O!"B?$/$N>l9g!"8+=P$78l$KM>J,$JMWAG$,4^$^$l$F$$$k>l9g$K8B$i$l$k!#Nc$((B $B$P!"go {$BF0(B-1}go$B9T$/(B @end example $B$3$NNc$G$O!"8+=P$78l$K$=$N8l$NIJ;l>pJs$,4^$^$l$F$$$k!#$3$N$h$&$JIJ;l>pJs(B $B$O!"<-=q$N8!:w%-!<$H$7$FE,Ev$G$O$J$$$N$G!"8!:w;~$K$OBP>]$H$7$J$$$h$&$K$7(B $B$F$*$/$N$,E,Ev$@$m$&!#(B $B$^$?!"(B@samp{} $B$H(B @samp{} $B$rE,Ev$KA*Br$9$k$3$H$K$h$C$F!"<-=q$N8!:w(B $BB.EY$rDc2<$5$;$J$$$h$&$K$9$k$3$H$,$G$-$k!#(B @example United Nationsunited nations$B9q:]O"9g(B @end example $B$H$$$&%(%s%H%j$,$"$C$?$H$9$k!#$3$N;~!"A0J}0lCW8!:w$r9T$J$&$?$a$K(B @samp{united} $B$r%-!<$H$7$F8!:w$9$k$3$H$r9M$($k!#9TF,$NJ8;zNs(B @samp{United $B!A(B} $B$H8!:w%-!<$O(B3$BJ8;zL\$^$GHf3S$5$l$k$@$m$&!#$b$7$b$"$J(B $B$?$,!"$3$N<-=q$r8!:w$9$k>l9g!"$D$M$K%"%k%U%!%Y%C%H$NBgJ8;z$H>.J8;z$N0c$$(B $B$rL5;k$7$F8!:w$7$?$$$H9M$($F$$$k$J$i$P!"$3$NHf3S$OL5BL$JHf3S$G$"$k!#(B @samp{} $B$rMQ$$$F$$$l$P!"$3$N$h$&$JL5BL$JHf3S$rHr$1$k$3$H$,$G$-$k!#$7(B $B$+$7!"$3$NA*Br$O!"$=$N<-=q$r8!:w$9$k%"%W%j%1!<%7%g%s$H8!:w$r9T$J$&%W%m%0(B $B%i%`$N@-.J8;z$r6hJL$9$k!#%"%k%U%!%Y%C%H$NBgJ8;z$H>.J8;z$r6hJL$7$J$$(B $B8!:w(B( case-ignore search )$B$,& $B$O$=$l$>$l(B @samp{<} @samp{>} @samp{&} $B$KCV49$9$k!#=>$C$F!"(B@i{string} $B$K$O(B <> $B$O8=$l$J(B $B$$!#<-=q$N@bL@J8$K4^$^$l$F$$$k2~9T%3!<%I$O(B @samp{&lf;} $B$KCV49$9$k!#(B @item @i{comment} $B$O<-=q$K$D$$$F$N@bL@$J$I$N3F$C$F!"9TF,$N(B1$BJ8;z$N$_$K$h$C$F(B @i{line} $B$K(B $BBeF~$5$lF@$kJ#?t$N9=J8MWAG$r<1JL$G$-$k$h$&$K3HD%$5$l$k!#(B @item SDIC$B7A<0$N<-=q%U%!%$%k$NI8=`3HD%;R$r(B @file{.sdic} $B$H$9$k!#(B @end enumerate @subsection $B8!:wNc(B @example $BA0J}0lCW8!:w(B grep study dictionary $B8eJ}0lCW8!:w(B grep study dictionary $B40A40lCW8!:w(B grep study dictionary @end example @node History, Acknowledgment, Dictionary Format, Top @comment node-name, next, previous, up @chapter $B2~JQMzNr(B SDIC $B$O!"(B1998$BG/(B2$B7n$K:G=i$N%P!<%8%g%s$r(B xdic $B$H$$$&L>A0$G8x3+$7$^$7$?!#$=(B $B$N2~JQMzNr$Ol9g!":G8e$N8+=P$78l$N$_(B $B$7$+I=<($5$l$F$$$J$+$C$?IT6q9g$r=$@5!#(B @end itemize @item $B%P!<%8%g%s(B 1.6 (1998$BG/(B9$B7n(B22$BF|(B) @itemize @bullet @item Mule for Win32 $B$GJ8;z2=$1$,5/$3$C$F$$$?LdBj$r=$@5!#(B @item $B8+=P$78l$N=$>~(B($B%G%U%)%k%H$O(B bold)$B$rJQ99$G$-$k$h$&$K$7$?!#(B @item $B$=$NB>!":Y$+$$=$@5(B @end itemize @end itemize $B$=$N8e!"(B@samp{fj.sources} $B$K$*$$$F!"(BX $B>e$GEE;R%V%C%/$r8!:w$9$k$?$a$N(B xdic $B$H$$$&F1$8L>A0$N%W%m%0%i%`$,8x3+$5$l$?$?$a!":.F1$rHr$1$k$?$a$K%P!<(B $B%8%g%s(B 2.0 $B$r8x3+$9$k$HF1;~$KL>>N$rJQ99$7$^$7$?!#$3$l$^$G$N(B xdic-1.x $B$N(B $B7ONs$+$i$OFbIt9=B$$K$D$$$F$b@_Dj$K$D$$$F$bBgI}$JJQ99$,9T$J$o$l$F$$$^$9!#(B @itemize @bullet @item $B%P!<%8%g%s(B 2.0 (1999$BG/(B2$B7n(B3$BF|(B) @itemize @bullet @item $BOB1Q<-=q$KBP1~$7$^$7$?!#(B @item $BJ#?t$N<-=q$rF1;~$K8!:w$9$k$3$H$,=PMh$k$h$&$K$J$j$^$7$?!#(B @item $B1QOB<-=q$r%-!<%o!<%I8!:w$9$k>l9g!"A0CV;l$r0U<1$7$F8!:w$r9T$J$&$h$&$K$7$^(B $B$7$?!#(B @item $B%-!<%o!<%I8!:w0J30$KA0J}0lCW8!:w!"8eJ}0lCW8!:w!"40A40lCW8!:w!"A4J88!:w$,(B $B$G$-$k$h$&$K3HD%$7$^$7$?!#(B @item SDIC$B7A<0$N<-=q$KBP$9$kBP1~$rDI2C$7$^$7$?!#(B @item $B30It%3%^%s%I$rMj$i$:$K8!:w$9$k$?$a$N8!:w%i%$%V%i%j$rDI2C$7$^$7$?!#(B @item XEmacs $B$KBP1~$7$^$7$?!#(B @end itemize @end itemize @node Acknowledgment, , History, Top @comment node-name, next, previous, up @chapter $B.4X$5$s$O!":G=i4|$+$i(B @file{xdic.el} $B$r;H$$!"Ne$^$7$F$/$l$^$7$?!#(B @item $B@nB<$5$s$O!"(BDebian $BMQ%Q%C%1!<%8$r%a%s%F%J%s%9$7$F2<$5$C$F$$$^$9!#(B @item $B9bNS$5$s$O!"(B@file{jgene.perl} $B$r:n@.$7!"MM!9$JDI2C5!G=$rDs0F$7$F2<$5$$$^(B $B$7$?!#eED$5$s$O!"(BXEmacs $BMQ$N%Q%C%A$r:n@=$7$F2<$5$$$^$7$?!#(B @end itemize $B$=$7$F$b$A$m$s!"F0:n%F%9%H$K6(NO$7$F$/$@$5$C$?(B SDIC Users $B%a!<%j%s%0%j%9(B $B%H$N%a%s%P!<$N$_$J$5$s$H!"%[!<%`%Z!<%8$J$I%3%s%T%e!<%?;q8;$rDs6!$7$F$/$@(B $B$5$C$?8@8l%a%G%#%"8&5f<<$N$_$J$5$s$K46 SDIC Users メーリングリスト ◎ 一次配布元 http://namazu.org/~tsuchiya/sdic/ sdic-2.1.3/AUTHORS0000444000175000017500000000020707510300542007161 TSUCHIYA Masatoshi SHIRAI Hideyuki TAKABAYASHI Satoru sdic-2.1.3/COPYING0000644000175000017500000004307006716744441007174 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. sdic-2.1.3/ChangeLog0000444000175000017500000001554407512045764007713 Sun Jul 7 23:10:47 2002 TSUCHIYA Masatoshi * Release SDIC-2.1.3. Wed Jul 3 14:34:56 2002 TSUCHIYA Masatoshi * contrib/edict.perl (normal, reverse): Remove markers denote words of foreign origin. Tue Jul 2 20:04:57 2002 TSUCHIYA Masatoshi * contrib/edict.perl, contrib/gene.perl: Update my address. Unify end of lines. * autogen.sh, .cvsignore, lisp/cvsignore: New files. * lisp/sdic-compat.el, lisp/sdic-gene.el, lisp/sdic.el.in, lisp/sdicf.el, lisp/sdicf-client.el, lisp/stem.el, contrib/eijirou.perl, AUTHORS, ChangeLog: Update my address. Fri Feb 9 10:58:00 2001 Hideyuki SHIRAI * lisp/sdicf.el (sdicf-default-directory): New variable. (sdicf-call-process): Set 'default-directory' to 'sdicf-default-directory'. See sdic-ML 00420. (sdicf-start-process): Ditto. Wed Jan 05 19:07:41 2000 Hideyuki SHIRAI * lisp/sdic.el.in (sdic-word-at-point): Use sdic-split-string, when found a prepositional word. Tue Sep 7 12:42:34 1999 TSUCHIYA Masatoshi * Release SDIC-2.1.2. Fri Sep 3 14:20:35 1999 TSUCHIYA Masatoshi * sdicf.el(sdicf-buffer-live-p): Define the alternative function of `buffer-live-p'. * sdic.el.in, sdic-compat.el, sdic-gene.el: Replace function from `sdic-buffer-live-p' to `sdicf-buffer-live-p'. Mon Aug 16 18:37:16 1999 TSUCHIYA Masatoshi * Release SDIC-2.1.1. Mon Aug 16 14:15:36 1999 TSUCHIYA Masatoshi * install.el.in: Bug fix of install.el.in (Cf. [sdic:00342]). Thu Jul 29 09:15:08 1999 TSUCHIYA Masatoshi * Release SDIC-2.1. Tue Jul 27 14:44:24 1999 TSUCHIYA Masatoshi * INSTALL: Modify documents of install procedure at UNIX environment. * configure.in: Change range of legal values of `--with-dicttype'. * install.el.in: Add help message for `--with-multidict'. Mon Jul 26 18:01:04 1999 TSUCHIYA Masatoshi * Release SDIC-2.1-pre2. * configure.in: Update script to generate `WAEI_DICT_LIST' and `EIWA_DICT_LIST'. Mon Jul 26 16:52:34 1999 Hideyuki SHIRAI * sdicf.el (sdic-call-process): Add local binding of `file-name-coding-system' for XEmacs. * sdic.el.in,sdic.texi: Add exposition of key-bind. * INSTALL,lisp/sdic.el.in: Modify document of setting for Emacs20 and XEmacs. Mon Jul 26 00:41:42 1999 Satoru Takabayashi * configure.in: Bug fix: substitution for EIJIROU_DIR and WAEIJIROU_DIR Sun Jul 25 13:00:15 1999 TSUCHIYA Masatoshi * Release SDIC-2.1-pre1. Fri Jul 23 19:06:54 1999 TSUCHIYA Masatoshi * install.el.in: Following the change of dictionary naming rule. * contrib/gene.perl (sdic_to_compat): Some fixes. 1999-07-23 Satoru Takabayashi * lisp/Makefile.am, configure.in: eedict.dic support by using `contrib/gene.perl --sdic-to-compat' * lisp/sdic.el: Apply Tsuchiya's patch [sdic:00295] and Modify it little a bit. * configure.in: Support multiple dictionaries. * Makefile.am: Add entries for edict's family. 4jwords, compdic,enamdict * lisp/elisp-comp: Modify one line. (load "sdic.el.in") -> (load "sdic.el") Fri Jul 23 17:04:18 1999 Hideyuki Shirai * contrib/{edict.perl,eijirou.perl,gene.perl,jgene.perl}: Add code for Windows. * install.el.in: Some bug fixes and update code to decide `make-sdic-lisp-directory' for Mule-for-Windows. 1999-07-22 Satoru Takabayashi * configure.in: Change default DICTDIR. * lisp/sdic.el: Replace %{EIWA,WAEI}_DICTIONARY_PATH% with %{EIWA,WAEI}_DICT_PATH% ; notation changed. 1999-07-21 Satoru Takabayashi * configure.in, Makefile.am: Add a feature to detect `WAEIJIROU' directory at configure time and process it make time. * INSTALL: Update documents of install procedure for `WAEIJIROU'. Wed Jul 21 21:23:31 1999 TSUCHIYA Masatoshi * lisp/sdic.el.in: Update code for queries in upper case. * contrib/eijirou.perl: Update code for `WAEIJIROU'. 1999-07-21 Satoru Takabayashi * configure.in, Makefile.am: Add a feature to detect `EIJIROU' directory at configure time and process it make time. * INSTALL: Update documents of install procedure for `EIJIROU'. * Makefile.am, configure.in: Support jedict.dic Wed Jul 21 12:49:19 1999 Masaru Tawa * contrib/eijirou.perl: Fix for `WAEIJIROU'. Wed Jul 21 12:49:19 1999 TSUCHIYA Masatoshi * install.el.in: Update code to make `lisp/sdic.el'. * configure.in, Makefile.am: Add `install.el' to package. Wed Jul 21 12:49:19 1999 Hideyuki Shirai * lisp/sdic.el.in: Fix the too short stem problem and contribute codes for queries in upper case. Tue Jul 20 22:23:57 1999 Tsuchiya Masatoshi * install.el: Add code to make `lisp/sample.emacs'. * INSTALL: Update documents of install procedure for Windows. Mon Jul 19 18:04:31 1999 TSUCHIYA Masatoshi * INSTALL: Add documents of install procuedure using `install.el', and update documents of `EIJIROU'. * NEWS: Add NEWS for SDIC-2.1. * install.el: New file. * lisp/sdic.el.in: Add function `sdic-version' and edit comments. * lisp/sdicf-client.el lisp/sdic-compat.el lisp/sdic-gene.el: Edited comments. * texi/sdic.texi: Update documents for SDIC-2.1. 1999-07-18 Satoru Takabayashi * Makefile.am: Fix `config' entry bug. Fri Jul 16 19:00:39 1999 TSUCHIYA Masatoshi * lisp/sdicf.el: Bug fix of sdicf-entry-keywords. * lisp/lp.el: Update install procedure for Windows. * INSTALL: Update document about the install procedure using lp.el. 1999-07-16 Satoru Takabayashi * configure.in: Substitute lisp/sample.emacs at configure time. * lisp/sample.emacs.in: Be substituted at configure time. * INSTALL: Rewrited to correspond to configured sdic. * Makefile.am: Restore `config' entry. Wed Jun 2 17:55:44 1999 TSUCHIYA Masatoshi * lisp/Makefile.am,lp.el: Change compile method. * lisp/sdic.el.in: (sdic-word-at-point) Bug fix (Tnx. Takashi Nishimoto) * lisp/sdic-grep.el: (sdic-grep-open-dictionary) Disable undo in temporary buffer. * lisp/sdic-gene.el: (sdic-gene-open-dictionary) Disable undo in temporary buffer. 1999-05-16 Satoru Takabayashi * Be configurized: Makefile.{am,in}, configure.in, configure, lisp/Makefile.{am,in} : New files acinclude.m4, aclocal.m4, elisp-comp : Import from Lookup * TODO, NEWS, AUTHORS, ChangeLog, THANKS: New file. sdic-2.1.3/INSTALL0000644000175000017500000001466006747244510007171 ■ SDIC インストールガイド この文書では、SDIC を手軽にインストールする手順について説明しています。 最も入手しやすい辞書データとして、「窓の杜」などで配布されている「GENE 辞書」があり、この辞書を使う場合のインストール方法について主に説明しま す。 * GENE95辞書 http://www.forest.impress.co.jp/dict.html#gene95 * EDICT辞書 ftp://ftp.u-aizu.ac.jp/pub/SciEng/nihongo/ftp.cc.monash.edu.au/ ◎ インストール手順 ( UNIX 環境の場合 ) (1) このファイルと同じディレクトリに「GENE辞書」のデータ gene95.lzh ま たは gene95.tar.gz と、「EDICT辞書」のデータ edict.gz を置いて下さ い。( make dict する時に自動的に展開されますので、手動で展開す る必要はありません。) (2) ./configure を実行して、インストール先のディレクトリと、デフォルトで 利用する辞書を自動設定します。 「GENE辞書」は英和辞書なのですが、これを和英辞書に変換するためのス クリプト jgene.perl が同梱されています。これを利用して「GENE辞書」 を和英辞書としても利用する場合は、「EDICT辞書」のデータは要りませ ん。この変換には数分かかります。 逆に、「EDICT辞書」は和英辞書なのですが、これを英和辞書に変換して 利用することもできます。この場合は「GENE辞書」のデータが不要となり ます。この変換には数分かかります。 主なオプション --with-emacs=EMACS compile with EMACS [EMACS=emacs, xemacs...] + 使用する Emacs の種類を指定する --with-lispdir=DIR emacs lisp files go to DIR [guessed] + Lispプログラムをインストールするディレクトリを指定する --with-dictdir=DIR dictionary files go to DIR [/usr/local/share/dict] + 辞書ファイルをインストールするディレクトリを指定する --with-dicttype=TYPE use TYPE of dictionaries [sdic] + 辞書の種類を指定する sdic または compat (3) make を実行して Lisp プログラムを作成します。 (4) make install を実行して Lisp プログラムをインストールします。 インストール先のディレクトリによっては root 特権が必要です。 (5) make install-info を実行して Info をインストールします。ただし、Emacs のバージョンによっては正常に処理できない場合があります。その場合は、 直接 sdic.texi を Emacs で読み込んでから、M-x texinfo-format-buffer を行って、手作業でインストールしてください。 ****************************************************************** インストール済の辞書ファイルを利用する場合には、(6),(7) の処理は必 要ありません。ただし、デフォルトのディレクトリ (/usr/local/share/dict) 以外に辞書ファイルを格納している場合は、configure 時に --with-dictdir=DIR オプションで、そのディレクトリを指定してください。 ****************************************************************** (6) make dict を実行して辞書ファイルを作成します。 (7) make install-dict を実行して辞書ファイルをインストールします。 インストール先のディレクトリによっては root 特権が必要です。 (8) ~/.emacs を編集して個人設定を行います。sample.emacs に設定例が入っ ていますので、参考にしてください。この設定をそのまま使う場合は、 make config とすれば設定が完了します。Mule/Emacs 上で C-c w とタイプすると、 sdic-mode が起動するはずです。 Emacs20 または XEmacs で使用する場合は、更に、 (set-language-environment "Japanese") と設定されているか確認してください。 ◎ インストール手順 ( Windows 環境の場合 ) Windows 環境では、必要なコマンドが不足しているために、上記の UNIX 用の インストール手順を実行することは困難です。そのため、Mule for windows または Meadow 以外のコマンドを必要としないような簡易インストールスクリ プトを用意しました。以下にその手順を説明します。 (1) GENE辞書のデータ gene95.lzh または gene95.tar.gz を展開して、 gene.txt をこのファイルと同じディレクトリに置いて下さい。 (2) EDICT辞書のデータ edict.gz を展開して、edict をこのファイルと同じ ディレクトリに置いて下さい。 (3) 次のコマンドを実行して、インストールを行ないます。 % mule -batch -q -l install.el -f make-sdic このスクリプトは、実行された Meadow の環境から適切なインストール先 を推定して、インストールを実行します。実際に何処にインストールされ るか確認したい場合は、次のようにしてください。 % mule -batch -q -l install.el -f make-sdic -n インストール先のディレクトリを変更したい場合は、以下のオプションで 指定してください。 --with-lispdir=DIR emacs lisp files go to DIR [guessed] + Lispプログラムをインストールするディレクトリを指定する --with-dictdir=DIR dictionary files go to DIR [guessed] + 辞書ファイルをインストールするディレクトリを指定する --infodir=DIR Info files go to DIR [guessed] + Info をインストールするディレクトリを指定する なお、これらのオプションは、`-f make-sdic' よりも後に指定するよう にしてください。e.g. % mule -batch -q -l install.el -f make-sdic --with-lispdir=C://home/elisp 既に辞書ファイルがインストールされている場合は、(1),(2) の処理は必 要ありません。ただし、デフォルト以外のディレクトリに辞書をインストー ルした場合は、そのディレクトリをオプションで指定する必要があります。 (4) ~/.emacs を編集して個人設定を行います。sample.emacs に設定例が入っ ていますので、参考にしてください。 ◎ 「英辞郎」を使う場合のインストール手順 「英辞郎」とは、Nifty-Serve 英会話フォーラムまたは書籍から入手可能 な辞書です。詳しくはそれらに附属のドキュメントを参照して下さい。単 純なテキスト形式で配布されている英和辞書としては、おそらく最大のも のだと思われますが、残念ながらインターネット上では配布されていませ ん。 「英辞郎」を利用する場合は、英辞郎を構成するファイル群を一つディレ クトリに置き、configure 時にそのディレクトリを --with-eijirou=DIR オプションで指定します (標準では configure は ./eijirou を調べます)。 e.g. % ./configure --with-eijirou=/somewhere/eijirou # configure と同じディレクトリに gene95.lzh, gene95.tar.gz, edict.gz # が置かれているとそちらを優先してしまいます。ご注意ください。 ただし、「英辞郎」は極めて巨大なので、SDIC形式では grep による検索 に非常に時間がかかります。可能ならば SUFARY を利用されることをお勧 めします。詳細については Info を参照して下さい。 一方、COMPAT形式であれば、検索方法は前方一致と完全一致に限られます が、look コマンドを利用して充分に実用的な速度で検索できます。COMPAT 形式を使うには configure 時に --with-dicttype=compat とオプション を指定します。 また、「和英辞郎」という和英辞書も配布されています。これを利用され る場合も「英辞郎」と基本的に同じです。--with-waeijirou=DIR オプショ ンでディレクトリを指定します (標準では configure は ./waeijirou を 調べます)。 e.g. % ./configure --with-waeijirou=/somewhere/waeijirou sdic-2.1.3/Makefile.am0000644000175000017500000001030206746037704010165 # -*- Makefile -*- # # $Id: Makefile.am,v 1.11 1999/07/23 10:11:16 satoru Exp $ # EXTRA_DIST = install.el texi/sdic.texi contrib/edict.perl contrib/eijirou.perl contrib/gene.perl contrib/jgene.perl DISTCLEANFILES = install.el texi/sdic.info SUBDIRS = lisp dict: @EIWA_DICT@ @WAEI_DICT@ # info_TEXINFOS = sdic.texi # this requires makeinfo install-dict: $(mkinstalldirs) @DICTDIR@ $(INSTALL_DATA) @EIWA_DICT@ @DICTDIR@ $(INSTALL_DATA) @WAEI_DICT@ @DICTDIR@ install-info: texi/sdic.info $(INSTALL_DATA) texi/sdic.info @infodir@ info: texi/sdic.info texi/sdic.info: texi/sdic.texi $(EMACS) -batch -q -l install.el -f batch-texinfo-format $? config: lisp/sample.emacs @echo -n "本当に $$HOME/.emacs を書き換えますか[yes/no] " ;\ read YN ;\ test "$$YN" = yes @if [ -f "$$HOME/.emacs" ] ;\ then \ echo "元の $$HOME/.emacs を $$HOME/.emacs.orig として保存します";\ cp -p $$HOME/.emacs $$HOME/.emacs.orig ;\ fi ( echo ; cat lisp/sample.emacs )>>$$HOME/.emacs ## 辞書を生成するためのルール gene.dic: contrib/gene.perl gene.txt @NKF@ -S -e gene.txt | @PERL@ contrib/gene.perl --compat > $@ gene.sdic: contrib/gene.perl gene.txt @NKF@ -S -e gene.txt | @PERL@ contrib/gene.perl > $@ jgene.dic: contrib/jgene.perl gene.dic @PERL@ contrib/jgene.perl --compat < gene.dic > $@ jgene.sdic: gene.dic @PERL@ contrib/jgene.perl < gene.dic > $@ gene.txt: test -f gene95.lzh -o -f gene95.tar.gz -o -f gene95.tar.bz2 if [ -f gene95.lzh ]; then \ lha x gene95.lzh gene.txt; \ elif [ -f gene95.tar.gz ]; then \ @GZIP@ -dc gene95.tar.gz | tar xf - gene.txt; \ else \ @BZIP2@ -dc gene95.tar.bz2 | tar xf - gene.txt; \ fi test -s gene.txt eijirou.dic: contrib/eijirou.perl @NKF@ -S -e @EIJIROU_DIR@/*.txt | @PERL@ contrib/eijirou.perl --compat > $@ eijirou.sdic: contrib/eijirou.perl @NKF@ -S -e @EIJIROU_DIR@/*.txt | @PERL@ contrib/eijirou.perl > $@ waeijirou.dic: contrib/eijirou.perl @NKF@ -S -e @WAEIJIROU_DIR@/*.txt | @PERL@ contrib/eijirou.perl --waei --compat > $@ waeijirou.sdic: contrib/eijirou.perl @NKF@ -S -e @WAEIJIROU_DIR@/*.txt | @PERL@ contrib/eijirou.perl --waei > $@ jedict.sdic: edict contrib/edict.perl @PERL@ contrib/edict.perl edict > $@ j4jwords.sdic: 4jwords contrib/edict.perl @PERL@ contrib/edict.perl 4jwords > $@ jcompdic.sdic: compdic contrib/edict.perl @PERL@ contrib/edict.perl compdic > $@ jenamdict.sdic: enamdict contrib/edict.perl @PERL@ contrib/edict.perl enamdict > $@ eedict.sdic: edict contrib/edict.perl @PERL@ contrib/edict.perl --reverse edict > $@ e4jwords.sdic: 4jwords contrib/edict.perl @PERL@ contrib/edict.perl --reverse 4jwords > $@ ecompdic.sdic: compdic contrib/edict.perl @PERL@ contrib/edict.perl --reverse compdic > $@ eenamdict.sdic: enamdict contrib/edict.perl @PERL@ contrib/edict.perl --reverse enamdict > $@ jedict.dic: edict @NKF@ -deZ2 edict | \ @PERL@ -pe 's!\s+/!\t!;s!/!, !g;s!, $$!!' | @SORT@ -f > $@ j4jwords.dic: 4jwords @NKF@ -deZ2 4jwords | \ @PERL@ -pe 's!\s+/!\t!;s!/!, !g;s!, $$!!' | @SORT@ -f > $@ jcompdic.dic: compdic @NKF@ -deZ2 compdic | \ @PERL@ -pe 's!\s+/!\t!;s!/!, !g;s!, $$!!' | @SORT@ -f > $@ jenamdict.dic: enamdict @NKF@ -deZ2 enamdict | \ @PERL@ -pe 's!\s+/!\t!;s!/!, !g;s!, $$!!' | @SORT@ -f > $@ eedict.dic: edict @PERL@ contrib/edict.perl --reverse edict | \ @PERL@ contrib/gene.perl --sdic-to-compat > $@ e4jwords.dic: 4jwords @PERL@ contrib/edict.perl --reverse 4jwords | \ @PERL@ contrib/gene.perl --sdic-to-compat > $@ ecompdic.dic: compdic @PERL@ contrib/edict.perl --reverse compdic | \ @PERL@ contrib/gene.perl --sdic-to-compat > $@ eenamdict.dic: enamdict @PERL@ contrib/edict.perl --reverse enamdict | \ @PERL@ contrib/gene.perl --sdic-to-compat > $@ edict: test -f $@.gz -o -f $@.bz2 if [ -f $@.gz ]; then \ @GZIP@ -dc $@.gz >$@ ;\ else \ @BZIP2@ -dc $@.bz2 >$@ ;\ fi test -s $@ 4jwords: test -f $@.gz -o -f $@.bz2 if [ -f $@.gz ]; then \ @GZIP@ -dc $@.gz >$@ ;\ else \ @BZIP2@ -dc $@.bz2 >$@ ;\ fi test -s $@ compdic: test -f $@.gz -o -f $@.bz2 if [ -f $@.gz ]; then \ @GZIP@ -dc $@.gz >$@ ;\ else \ @BZIP2@ -dc $@.bz2 >$@ ;\ fi test -s $@ enamdict: test -f $@.gz -o -f $@.bz2 if [ -f $@.gz ]; then \ @GZIP@ -dc $@.gz >$@ ;\ else \ @BZIP2@ -dc $@.bz2 >$@ ;\ fi test -s $@ sdic-2.1.3/NEWS0000644000175000017500000000031406744566144006635 `sdic-sgml.el', `sdic-grep.el', and `sdic-array.el' have been replaced by `sdicf.el' and `sdicf-client.el'. Install procedure has been re-constructed. Please use `./configure & make' instead of `make'. sdic-2.1.3/THANKS0000644000175000017500000000013606745356137007053 I am pleased to acknowledge the considerable asistance of members of SDIC Users Mailing List. sdic-2.1.3/TODO0000644000175000017500000000032306746006672006623 This is the -*- text -*- to give development outline. ・エラーメッセージの拡充 現状のように、ただ黙って Can't find word というだけでは、バグなの か、インストールまたは設定のミスなのかの判断がつけ難い。 sdic-2.1.3/acinclude.m40000444000175000017500000000600507510303623010307 dnl Copyright (C) 1999 NISHIDA Keisuke dnl dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by dnl the Free Software Foundation; either version 2, or (at your option) dnl any later version. dnl dnl This program is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the dnl GNU General Public License for more details. dnl dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA dnl 02111-1307, USA. AC_DEFUN(AM_PATH_LISPDIR, [dnl # dnl # Check Emacs dnl # AC_ARG_WITH(emacs, [ --with-emacs=EMACS compile with EMACS [EMACS=emacs, xemacs...]], [case "${withval}" in yes) EMACS= ;; no) AC_MSG_ERROR([emacs is not available]) ;; *) EMACS=${withval} ;; esac], EMACS=) if test "x$EMACS" = "xt" -o "x$EMACS" = x; then AC_PATH_PROGS(EMACS, emacs xemacs mule, no) if test $EMACS = no; then AC_MSG_ERROR(you should install Emacs first) fi fi dnl # dnl # Check Emacs directories dnl # AC_MSG_CHECKING([where emacs files are in]) EMACS_BASENAME="`echo x$EMACS | sed -e 's/x//' -e 's/^.*\///'`" if test "x$emacsdir" = x; then if test "x$prefix" = "xNONE"; then prefix=$ac_default_prefix fi emacsdir="\$(datadir)/emacs" case "$EMACS_BASENAME" in emacs|emacs-*) if test -d $prefix/lib/emacs; then emacsdir="$prefix/lib/emacs" fi if test -d $prefix/share/emacs; then emacsdir="$prefix/share/emacs" fi ;; xemacs|xemacs-*) if test -d $prefix/lib/xemacs; then emacsdir="$prefix/lib/xemacs" fi if test -d $prefix/share/xemacs; then emacsdir="$prefix/share/xemacs" fi ;; mule|mule-*) if test -d $prefix/lib/emacs; then emacsdir="$prefix/lib/emacs" fi if test -d $prefix/share/emacs; then emacsdir="$prefix/share/emacs" fi if test -d $prefix/lib/mule; then emacsdir="$prefix/lib/mule" fi if test -d $prefix/share/mule; then emacsdir="$prefix/share/mule" fi ;; esac fi AC_MSG_RESULT($emacsdir) AC_SUBST(emacsdir) dnl # dnl # Check Emacs site-lisp directories dnl # AC_ARG_WITH(lispdir, [ --with-lispdir=DIR emacs lisp files go to DIR [guessed]], [case "${withval}" in yes) lispdir= ;; no) AC_MSG_ERROR(lispdir is not available) ;; *) lispdir=${withval} ;; esac], lispdir=) AC_MSG_CHECKING([where .elc files should go]) if test "x$lispdir" = x; then lispdir="$emacsdir/site-lisp" if test -d $emacsdir/lisp; then lispdir="$emacsdir/lisp" fi case "$EMACS_BASENAME" in xemacs|xemacs-*) lispdir="$lispdir/lookup" ;; esac fi AC_MSG_RESULT($lispdir) AC_SUBST(lispdir)]) sdic-2.1.3/aclocal.m40000644000175000017500000001473407512046262007775 dnl aclocal.m4 generated automatically by aclocal 1.4-p4 dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This program is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A dnl PARTICULAR PURPOSE. dnl Copyright (C) 1999 NISHIDA Keisuke dnl dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by dnl the Free Software Foundation; either version 2, or (at your option) dnl any later version. dnl dnl This program is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the dnl GNU General Public License for more details. dnl dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA dnl 02111-1307, USA. AC_DEFUN(AM_PATH_LISPDIR, [dnl # dnl # Check Emacs dnl # AC_ARG_WITH(emacs, [ --with-emacs=EMACS compile with EMACS [EMACS=emacs, xemacs...]], [case "${withval}" in yes) EMACS= ;; no) AC_MSG_ERROR([emacs is not available]) ;; *) EMACS=${withval} ;; esac], EMACS=) if test "x$EMACS" = "xt" -o "x$EMACS" = x; then AC_PATH_PROGS(EMACS, emacs xemacs mule, no) if test $EMACS = no; then AC_MSG_ERROR(you should install Emacs first) fi fi dnl # dnl # Check Emacs directories dnl # AC_MSG_CHECKING([where emacs files are in]) EMACS_BASENAME="`echo x$EMACS | sed -e 's/x//' -e 's/^.*\///'`" if test "x$emacsdir" = x; then if test "x$prefix" = "xNONE"; then prefix=$ac_default_prefix fi emacsdir="\$(datadir)/emacs" case "$EMACS_BASENAME" in emacs|emacs-*) if test -d $prefix/lib/emacs; then emacsdir="$prefix/lib/emacs" fi if test -d $prefix/share/emacs; then emacsdir="$prefix/share/emacs" fi ;; xemacs|xemacs-*) if test -d $prefix/lib/xemacs; then emacsdir="$prefix/lib/xemacs" fi if test -d $prefix/share/xemacs; then emacsdir="$prefix/share/xemacs" fi ;; mule|mule-*) if test -d $prefix/lib/emacs; then emacsdir="$prefix/lib/emacs" fi if test -d $prefix/share/emacs; then emacsdir="$prefix/share/emacs" fi if test -d $prefix/lib/mule; then emacsdir="$prefix/lib/mule" fi if test -d $prefix/share/mule; then emacsdir="$prefix/share/mule" fi ;; esac fi AC_MSG_RESULT($emacsdir) AC_SUBST(emacsdir) dnl # dnl # Check Emacs site-lisp directories dnl # AC_ARG_WITH(lispdir, [ --with-lispdir=DIR emacs lisp files go to DIR [guessed]], [case "${withval}" in yes) lispdir= ;; no) AC_MSG_ERROR(lispdir is not available) ;; *) lispdir=${withval} ;; esac], lispdir=) AC_MSG_CHECKING([where .elc files should go]) if test "x$lispdir" = x; then lispdir="$emacsdir/site-lisp" if test -d $emacsdir/lisp; then lispdir="$emacsdir/lisp" fi case "$EMACS_BASENAME" in xemacs|xemacs-*) lispdir="$lispdir/lookup" ;; esac fi AC_MSG_RESULT($lispdir) AC_SUBST(lispdir)]) # Do all the work for Automake. This macro actually does too much -- # some checks are only needed if your package does certain things. # But this isn't really a big deal. # serial 1 dnl Usage: dnl AM_INIT_AUTOMAKE(package,version, [no-define]) AC_DEFUN(AM_INIT_AUTOMAKE, [AC_REQUIRE([AC_PROG_INSTALL]) PACKAGE=[$1] AC_SUBST(PACKAGE) VERSION=[$2] AC_SUBST(VERSION) dnl test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi ifelse([$3],, AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) AC_REQUIRE([AM_SANITY_CHECK]) AC_REQUIRE([AC_ARG_PROGRAM]) dnl FIXME This is truly gross. missing_dir=`cd $ac_aux_dir && pwd` AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) AC_REQUIRE([AC_PROG_MAKE_SET])]) # # Check to make sure that the build environment is sane. # AC_DEFUN(AM_SANITY_CHECK, [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftestfile # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` if test "[$]*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftestfile` fi if test "[$]*" != "X $srcdir/configure conftestfile" \ && test "[$]*" != "X conftestfile $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "[$]2" = conftestfile ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi rm -f conftest* AC_MSG_RESULT(yes)]) dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) dnl The program must properly implement --version. AC_DEFUN(AM_MISSING_PROG, [AC_MSG_CHECKING(for working $2) # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if ($2 --version) < /dev/null > /dev/null 2>&1; then $1=$2 AC_MSG_RESULT(found) else $1="$3/missing $2" AC_MSG_RESULT(missing) fi AC_SUBST($1)]) sdic-2.1.3/configure0000755000175000017500000014330307512046262010037 #! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated automatically using autoconf version 2.13 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. # Defaults: ac_help= ac_default_prefix=/usr/local # Any additions from configure.in: ac_help="$ac_help --with-emacs=EMACS compile with EMACS [EMACS=emacs, xemacs...]" ac_help="$ac_help --with-lispdir=DIR emacs lisp files go to DIR [guessed]" ac_help="$ac_help --with-dictdir=DIR dictionary files go to DIR [/usr/local/share/dict]" ac_help="$ac_help --with-dicttype=TYPE use TYPE of dictionaries (sdic|compat) [sdic]" ac_help="$ac_help --with-eijirou=DIR eijirou files are in DIR [./eijirou]" ac_help="$ac_help --with-waeijirou=DIR waeijirou files are in DIR [./waeijirou]" ac_help="$ac_help --with-multidict(=ARG) use multiple dictionaries (yes|no) [no]" # Initialize some variables set by options. # The variables have the same names as the options, with # dashes changed to underlines. build=NONE cache_file=./config.cache exec_prefix=NONE host=NONE no_create= nonopt=NONE no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= target=NONE verbose= x_includes=NONE x_libraries=NONE bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' # Initialize some other variables. subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. ac_max_here_lines=12 ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi case "$ac_option" in -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; *) ac_optarg= ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case "$ac_option" in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir="$ac_optarg" ;; -build | --build | --buil | --bui | --bu) ac_prev=build ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build="$ac_optarg" ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file="$ac_optarg" ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir="$ac_optarg" ;; -disable-* | --disable-*) ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } fi ac_feature=`echo $ac_feature| sed 's/-/_/g'` eval "enable_${ac_feature}=no" ;; -enable-* | --enable-*) ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } fi ac_feature=`echo $ac_feature| sed 's/-/_/g'` case "$ac_option" in *=*) ;; *) ac_optarg=yes ;; esac eval "enable_${ac_feature}='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix="$ac_optarg" ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he) # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat << EOF Usage: configure [options] [host] Options: [defaults in brackets after descriptions] Configuration: --cache-file=FILE cache test results in FILE --help print this message --no-create do not create output files --quiet, --silent do not print \`checking...' messages --version print the version of autoconf that created configure Directory and file names: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [same as prefix] --bindir=DIR user executables in DIR [EPREFIX/bin] --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] --libexecdir=DIR program executables in DIR [EPREFIX/libexec] --datadir=DIR read-only architecture-independent data in DIR [PREFIX/share] --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data in DIR [PREFIX/com] --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] --libdir=DIR object code libraries in DIR [EPREFIX/lib] --includedir=DIR C header files in DIR [PREFIX/include] --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] --infodir=DIR info documentation in DIR [PREFIX/info] --mandir=DIR man documentation in DIR [PREFIX/man] --srcdir=DIR find the sources in DIR [configure dir or ..] --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names EOF cat << EOF Host type: --build=BUILD configure for building on BUILD [BUILD=HOST] --host=HOST configure for HOST [guessed] --target=TARGET configure for TARGET [TARGET=HOST] Features and packages: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --x-includes=DIR X include files are in DIR --x-libraries=DIR X library files are in DIR EOF if test -n "$ac_help"; then echo "--enable and --with options recognized:$ac_help" fi exit 0 ;; -host | --host | --hos | --ho) ac_prev=host ;; -host=* | --host=* | --hos=* | --ho=*) host="$ac_optarg" ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir="$ac_optarg" ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir="$ac_optarg" ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir="$ac_optarg" ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir="$ac_optarg" ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir="$ac_optarg" ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir="$ac_optarg" ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir="$ac_optarg" ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix="$ac_optarg" ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix="$ac_optarg" ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix="$ac_optarg" ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name="$ac_optarg" ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir="$ac_optarg" ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir="$ac_optarg" ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site="$ac_optarg" ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir="$ac_optarg" ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir="$ac_optarg" ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target="$ac_optarg" ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers) echo "configure generated by autoconf version 2.13" exit 0 ;; -with-* | --with-*) ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } fi ac_package=`echo $ac_package| sed 's/-/_/g'` case "$ac_option" in *=*) ;; *) ac_optarg=yes ;; esac eval "with_${ac_package}='$ac_optarg'" ;; -without-* | --without-*) ac_package=`echo $ac_option|sed -e 's/-*without-//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } fi ac_package=`echo $ac_package| sed 's/-/_/g'` eval "with_${ac_package}=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes="$ac_optarg" ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries="$ac_optarg" ;; -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } ;; *) if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then echo "configure: warning: $ac_option: invalid host type" 1>&2 fi if test "x$nonopt" != xNONE; then { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } fi nonopt="$ac_option" ;; esac done if test -n "$ac_prev"; then { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } fi trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 # File descriptor usage: # 0 standard input # 1 file creation # 2 errors and warnings # 3 some systems may open it to /dev/tty # 4 used on the Kubota Titan # 6 checking for... messages and results # 5 compiler messages saved in config.log if test "$silent" = yes; then exec 6>/dev/null else exec 6>&1 fi exec 5>./config.log echo "\ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. " 1>&5 # Strip out --no-create and --no-recursion so they do not pile up. # Also quote any args containing shell metacharacters. ac_configure_args= for ac_arg do case "$ac_arg" in -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c) ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) ac_configure_args="$ac_configure_args '$ac_arg'" ;; *) ac_configure_args="$ac_configure_args $ac_arg" ;; esac done # NLS nuisances. # Only set these to C if already set. These must not be set unconditionally # because not all systems understand e.g. LANG=C (notably SCO). # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! # Non-C LC_CTYPE values break the ctype check. if test "${LANG+set}" = set; then LANG=C; export LANG; fi if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo > confdefs.h # A filename unique to this package, relative to the directory that # configure is in, which we can look for to find out if srcdir is correct. ac_unique_file=lisp/stem.el # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_prog=$0 ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } else { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } fi fi srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then echo "loading site script $ac_site_file" . "$ac_site_file" fi done if test -r "$cache_file"; then echo "loading cache $cache_file" . $cache_file else echo "creating cache $cache_file" > $cache_file fi ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross ac_exeext= ac_objext=o if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then ac_n= ac_c=' ' ac_t=' ' else ac_n=-n ac_c= ac_t= fi else ac_n= ac_c='\c' ac_t= fi ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break fi done if test -z "$ac_aux_dir"; then { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } fi ac_config_guess=$ac_aux_dir/config.guess ac_config_sub=$ac_aux_dir/config.sub ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 echo "configure:570: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" for ac_dir in $PATH; do # Account for people who put trailing slashes in PATH elements. case "$ac_dir/" in /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do if test -f $ac_dir/$ac_prog; then if test $ac_prog = install && grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : else ac_cv_path_install="$ac_dir/$ac_prog -c" break 2 fi fi done ;; esac done IFS="$ac_save_IFS" fi if test "${ac_cv_path_install+set}" = set; then INSTALL="$ac_cv_path_install" else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL="$ac_install_sh" fi fi echo "$ac_t""$INSTALL" 1>&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 echo "configure:623: checking whether build environment is sane" >&5 # Just in case sleep 1 echo timestamp > conftestfile # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftestfile` fi if test "$*" != "X $srcdir/configure conftestfile" \ && test "$*" != "X conftestfile $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". { echo "configure: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" 1>&2; exit 1; } fi test "$2" = conftestfile ) then # Ok. : else { echo "configure: error: newly created file is older than distributed files! Check your system clock" 1>&2; exit 1; } fi rm -f conftest* echo "$ac_t""yes" 1>&6 if test "$program_transform_name" = s,x,x,; then program_transform_name= else # Double any \ or $. echo might interpret backslashes. cat <<\EOF_SED > conftestsed s,\\,\\\\,g; s,\$,$$,g EOF_SED program_transform_name="`echo $program_transform_name|sed -f conftestsed`" rm -f conftestsed fi test "$program_prefix" != NONE && program_transform_name="s,^,${program_prefix},; $program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" # sed with no file args requires a program. test "$program_transform_name" = "" && program_transform_name="s,x,x," echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 echo "configure:680: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftestmake <<\EOF all: @echo 'ac_maketemp="${MAKE}"' EOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi rm -f conftestmake fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then echo "$ac_t""yes" 1>&6 SET_MAKE= else echo "$ac_t""no" 1>&6 SET_MAKE="MAKE=${MAKE-make}" fi PACKAGE=sdic VERSION=2.1.3 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } fi cat >> confdefs.h <> confdefs.h <&6 echo "configure:726: checking for working aclocal" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if (aclocal --version) < /dev/null > /dev/null 2>&1; then ACLOCAL=aclocal echo "$ac_t""found" 1>&6 else ACLOCAL="$missing_dir/missing aclocal" echo "$ac_t""missing" 1>&6 fi echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 echo "configure:739: checking for working autoconf" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if (autoconf --version) < /dev/null > /dev/null 2>&1; then AUTOCONF=autoconf echo "$ac_t""found" 1>&6 else AUTOCONF="$missing_dir/missing autoconf" echo "$ac_t""missing" 1>&6 fi echo $ac_n "checking for working automake""... $ac_c" 1>&6 echo "configure:752: checking for working automake" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if (automake --version) < /dev/null > /dev/null 2>&1; then AUTOMAKE=automake echo "$ac_t""found" 1>&6 else AUTOMAKE="$missing_dir/missing automake" echo "$ac_t""missing" 1>&6 fi echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 echo "configure:765: checking for working autoheader" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if (autoheader --version) < /dev/null > /dev/null 2>&1; then AUTOHEADER=autoheader echo "$ac_t""found" 1>&6 else AUTOHEADER="$missing_dir/missing autoheader" echo "$ac_t""missing" 1>&6 fi echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 echo "configure:778: checking for working makeinfo" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if (makeinfo --version) < /dev/null > /dev/null 2>&1; then MAKEINFO=makeinfo echo "$ac_t""found" 1>&6 else MAKEINFO="$missing_dir/missing makeinfo" echo "$ac_t""missing" 1>&6 fi # Check whether --with-emacs or --without-emacs was given. if test "${with_emacs+set}" = set; then withval="$with_emacs" case "${withval}" in yes) EMACS= ;; no) { echo "configure: error: emacs is not available" 1>&2; exit 1; } ;; *) EMACS=${withval} ;; esac else EMACS= fi if test "x$EMACS" = "xt" -o "x$EMACS" = x; then for ac_prog in emacs xemacs mule do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:810: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_EMACS'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$EMACS" in /*) ac_cv_path_EMACS="$EMACS" # Let the user override the test with a path. ;; ?:/*) ac_cv_path_EMACS="$EMACS" # Let the user override the test with a dos path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_EMACS="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" ;; esac fi EMACS="$ac_cv_path_EMACS" if test -n "$EMACS"; then echo "$ac_t""$EMACS" 1>&6 else echo "$ac_t""no" 1>&6 fi test -n "$EMACS" && break done test -n "$EMACS" || EMACS="no" if test $EMACS = no; then { echo "configure: error: you should install Emacs first" 1>&2; exit 1; } fi fi echo $ac_n "checking where emacs files are in""... $ac_c" 1>&6 echo "configure:851: checking where emacs files are in" >&5 EMACS_BASENAME="`echo x$EMACS | sed -e 's/x//' -e 's/^.*\///'`" if test "x$emacsdir" = x; then if test "x$prefix" = "xNONE"; then prefix=$ac_default_prefix fi emacsdir="\$(datadir)/emacs" case "$EMACS_BASENAME" in emacs|emacs-*) if test -d $prefix/lib/emacs; then emacsdir="$prefix/lib/emacs" fi if test -d $prefix/share/emacs; then emacsdir="$prefix/share/emacs" fi ;; xemacs|xemacs-*) if test -d $prefix/lib/xemacs; then emacsdir="$prefix/lib/xemacs" fi if test -d $prefix/share/xemacs; then emacsdir="$prefix/share/xemacs" fi ;; mule|mule-*) if test -d $prefix/lib/emacs; then emacsdir="$prefix/lib/emacs" fi if test -d $prefix/share/emacs; then emacsdir="$prefix/share/emacs" fi if test -d $prefix/lib/mule; then emacsdir="$prefix/lib/mule" fi if test -d $prefix/share/mule; then emacsdir="$prefix/share/mule" fi ;; esac fi echo "$ac_t""$emacsdir" 1>&6 # Check whether --with-lispdir or --without-lispdir was given. if test "${with_lispdir+set}" = set; then withval="$with_lispdir" case "${withval}" in yes) lispdir= ;; no) { echo "configure: error: lispdir is not available" 1>&2; exit 1; } ;; *) lispdir=${withval} ;; esac else lispdir= fi echo $ac_n "checking where .elc files should go""... $ac_c" 1>&6 echo "configure:906: checking where .elc files should go" >&5 if test "x$lispdir" = x; then lispdir="$emacsdir/site-lisp" if test -d $emacsdir/lisp; then lispdir="$emacsdir/lisp" fi case "$EMACS_BASENAME" in xemacs|xemacs-*) lispdir="$lispdir/lookup" ;; esac fi echo "$ac_t""$lispdir" 1>&6 # Extract the first word of "nkf", so it can be a program name with args. set dummy nkf; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:924: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_NKF'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$NKF" in /*) ac_cv_path_NKF="$NKF" # Let the user override the test with a path. ;; ?:/*) ac_cv_path_NKF="$NKF" # Let the user override the test with a dos path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_NKF="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" test -z "$ac_cv_path_NKF" && ac_cv_path_NKF="no" ;; esac fi NKF="$ac_cv_path_NKF" if test -n "$NKF"; then echo "$ac_t""$NKF" 1>&6 else echo "$ac_t""no" 1>&6 fi if test "$NKF" = "no"; then echo "configure: warning: nkf not found" 1>&2 fi # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:964: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$PERL" in /*) ac_cv_path_PERL="$PERL" # Let the user override the test with a path. ;; ?:/*) ac_cv_path_PERL="$PERL" # Let the user override the test with a dos path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_PERL="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" test -z "$ac_cv_path_PERL" && ac_cv_path_PERL="no" ;; esac fi PERL="$ac_cv_path_PERL" if test -n "$PERL"; then echo "$ac_t""$PERL" 1>&6 else echo "$ac_t""no" 1>&6 fi if test "$PERL" = "no"; then echo "configure: warning: perl not found" 1>&2 fi # Extract the first word of "gzip", so it can be a program name with args. set dummy gzip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:1004: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GZIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$GZIP" in /*) ac_cv_path_GZIP="$GZIP" # Let the user override the test with a path. ;; ?:/*) ac_cv_path_GZIP="$GZIP" # Let the user override the test with a dos path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_GZIP="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" test -z "$ac_cv_path_GZIP" && ac_cv_path_GZIP="no" ;; esac fi GZIP="$ac_cv_path_GZIP" if test -n "$GZIP"; then echo "$ac_t""$GZIP" 1>&6 else echo "$ac_t""no" 1>&6 fi if test "$GZIP" = "no"; then echo "configure: warning: gzip not found" 1>&2 fi # Extract the first word of "bzip2", so it can be a program name with args. set dummy bzip2; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:1044: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_BZIP2'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$BZIP2" in /*) ac_cv_path_BZIP2="$BZIP2" # Let the user override the test with a path. ;; ?:/*) ac_cv_path_BZIP2="$BZIP2" # Let the user override the test with a dos path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_BZIP2="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" test -z "$ac_cv_path_BZIP2" && ac_cv_path_BZIP2="no" ;; esac fi BZIP2="$ac_cv_path_BZIP2" if test -n "$BZIP2"; then echo "$ac_t""$BZIP2" 1>&6 else echo "$ac_t""no" 1>&6 fi if test "$BZIP2" = "no"; then echo "configure: warning: bzip2 not found" 1>&2 fi # Extract the first word of "cp", so it can be a program name with args. set dummy cp; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:1084: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_CP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$CP" in /*) ac_cv_path_CP="$CP" # Let the user override the test with a path. ;; ?:/*) ac_cv_path_CP="$CP" # Let the user override the test with a dos path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_CP="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" test -z "$ac_cv_path_CP" && ac_cv_path_CP="no" ;; esac fi CP="$ac_cv_path_CP" if test -n "$CP"; then echo "$ac_t""$CP" 1>&6 else echo "$ac_t""no" 1>&6 fi if test "$CP" = "no"; then echo "configure: warning: cp not found" 1>&2 fi # Extract the first word of "sort", so it can be a program name with args. set dummy sort; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:1124: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_SORT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$SORT" in /*) ac_cv_path_SORT="$SORT" # Let the user override the test with a path. ;; ?:/*) ac_cv_path_SORT="$SORT" # Let the user override the test with a dos path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_SORT="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" test -z "$ac_cv_path_SORT" && ac_cv_path_SORT="no" ;; esac fi SORT="$ac_cv_path_SORT" if test -n "$SORT"; then echo "$ac_t""$SORT" 1>&6 else echo "$ac_t""no" 1>&6 fi if test "$SORT" = "no"; then echo "configure: warning: sort not found" 1>&2 fi DICTDIR=/usr/local/share/dict # Check whether --with-dictdir or --without-dictdir was given. if test "${with_dictdir+set}" = set; then withval="$with_dictdir" DICTDIR=$with_dictdir fi DICTTYPE=sdic # Check whether --with-dicttype or --without-dicttype was given. if test "${with_dicttype+set}" = set; then withval="$with_dicttype" case "${withval}" in dic|sdic) DICTTYPE=${withval} ;; compat) DICTTYPE=dic ;; *) { echo "configure: error: Unknown dictionary type is specified." 1>&2; exit 1; } ;; esac fi EIJIROU_DIR="./eijirou" # Check whether --with-eijirou or --without-eijirou was given. if test "${with_eijirou+set}" = set; then withval="$with_eijirou" EIJIROU_DIR=$with_eijirou fi WAEIJIROU_DIR="./waeijirou" # Check whether --with-waeijirou or --without-waeijirou was given. if test "${with_waeijirou+set}" = set; then withval="$with_waeijirou" WAEIJIROU_DIR=$with_waeijirou fi MULTI_DICT="no" # Check whether --with-multidict or --without-multidict was given. if test "${with_multidict+set}" = set; then withval="$with_multidict" case "${withval}" in yes|no) MULTI_DICT=$withval ;; *) { echo "configure: error: Illegal value is specified." 1>&2; exit 1; } ;; esac fi EIWA_DICT="" echo $ac_n "checking for EIWA Dictionary""... $ac_c" 1>&6 echo "configure:1216: checking for EIWA Dictionary" >&5 for dict in gene.sdic eedict.sdic eijirou.sdic \ gene.dic eedict.dic eijirou.dic \ e4jwords.sdic ecompdic.sdic eenamdict.sdic \ e4jwords.dic ecompdic.dic eenamdict.dic ; do if test -f "$DICTDIR/$dict"; then EIWA_DICT="$EIWA_DICT $dict" EIWA_DICT_LIST="$EIWA_DICT_LIST $DICTDIR/$dict" test "$MULTI_DICT" = "no" && break fi done if test -n "$EIWA_DICT"; then echo "$ac_t""$EIWA_DICT_LIST (already installed)" 1>&6 else if test -f gene95.lzh -o -f gene95.tar.gz -o -f gene95.tar.bz2; then if test -z "$EIWA_DICT" -o "$MULTI_DICT" = "yes"; then NAME="gene.$DICTTYPE" EIWA_DICT="$EIWA_DICT $NAME" EIWA_DICT_LIST="$EIWA_DICT_LIST $DICTDIR/$NAME" fi fi if test -d "$EIJIROU_DIR"; then if test -z "$EIWA_DICT" -o "$MULTI_DICT" = "yes"; then NAME="eijirou.$DICTTYPE" EIWA_DICT="$EIWA_DICT $NAME" EIWA_DICT_LIST="$EIWA_DICT_LIST $DICTDIR/$NAME" fi fi for dict in edict 4jwords compdic enamdict; do if test -f $dict.gz -o -f $dict.bz2; then if test -z "$EIWA_DICT" -o "$MULTI_DICT" = "yes"; then if test -z "$EIWA_DICT" -o "$MULTI_DICT" = "yes"; then NAME="e$dict.$DICTTYPE" EIWA_DICT="$EIWA_DICT $NAME" EIWA_DICT_LIST="$EIWA_DICT_LIST $DICTDIR/$NAME" fi fi fi done echo "$ac_t""$EIWA_DICT" 1>&6 fi EIWA_DICT_LIST='"'`echo "$EIWA_DICT_LIST" | sed 's/^ //;s/ /" "/g'`'"' echo $ac_n "checking for WAEI Dictionary""... $ac_c" 1>&6 echo "configure:1268: checking for WAEI Dictionary" >&5 WAEI_DICT="" for dict in jedict.sdic jgene.sdic waeijirou.sdic \ jedict.dic jgene.dic waeijirou.dic \ j4jwords.sdic jcompdic.sdic jenamdict.sdic \ j4jwords.dic jcompdic.dic jenamdict.dic ; do if test -f "$DICTDIR/$dict"; then WAEI_DICT="$WAEI_DICT $dict" WAEI_DICT_LIST="$WAEI_DICT_LIST $DICTDIR/$dict" test "$MULTI_DICT" = "no" && break fi done if test -n "$WAEI_DICT"; then echo "$ac_t""$WAEI_DICT_LIST (already installed)" 1>&6 else for dict in edict 4jwords compdic enamdict; do if test -f $dict.gz -o -f $dict.bz2; then if test -z "$WAEI_DICT" -o "$MULTI_DICT" = "yes"; then if test -z "$WAEI_DICT" -o "$MULTI_DICT" = "yes"; then NAME="j$dict.$DICTTYPE" WAEI_DICT="$WAEI_DICT $NAME" WAEI_DICT_LIST="$WAEI_DICT_LIST $DICTDIR/$NAME" fi fi fi done if test -f gene95.lzh -o -f gene95.tar.gz -o -f gene95.tar.bz2; then if test -z "$WAEI_DICT" -o "$MULTI_DICT" = "yes"; then NAME="jgene.$DICTTYPE" WAEI_DICT="$WAEI_DICT $NAME" WAEI_DICT_LIST="$WAEI_DICT_LIST $DICTDIR/$NAME" fi fi if test -d "$WAEIJIROU_DIR"; then if test -z "$WAEI_DICT" -o "$MULTI_DICT" = "yes"; then NAME="waeijirou.$DICTTYPE" WAEI_DICT="$WAEI_DICT $NAME" WAEI_DICT_LIST="$WAEI_DICT_LIST $DICTDIR/$NAME" fi fi echo "$ac_t""$WAEI_DICT" 1>&6 fi WAEI_DICT_LIST='"'`echo "$WAEI_DICT_LIST" | sed 's/^ //;s/ /" "/g'`'"' trap '' 1 2 15 cat > confcache <<\EOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs. It is not useful on other systems. # If it contains results you don't want to keep, you may remove or edit it. # # By default, configure uses ./config.cache as the cache file, # creating it if it does not exist already. You can give configure # the --cache-file=FILE option to use a different cache file; that is # what configure does when it calls configure scripts in # subdirectories, so they share the cache. # Giving --cache-file=/dev/null disables caching, for debugging configure. # config.status only pays attention to the cache file if you give it the # --recheck option to rerun configure. # EOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote substitution # turns \\\\ into \\, and sed turns \\ into \). sed -n \ -e "s/'/'\\\\''/g" \ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' ;; esac >> confcache if cmp -s $cache_file confcache; then : else if test -w $cache_file; then echo "updating cache $cache_file" cat confcache > $cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # Any assignment to VPATH causes Sun make to only execute # the first set of double-colon rules, so remove it if not needed. # If there is a colon in the path, we need to keep it. if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' fi trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. cat > conftest.defs <<\EOF s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g s%\[%\\&%g s%\]%\\&%g s%\$%$$%g EOF DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` rm -f conftest.defs # Without the "./", some shells look in PATH for config.status. : ${CONFIG_STATUS=./config.status} echo creating $CONFIG_STATUS rm -f $CONFIG_STATUS cat > $CONFIG_STATUS </dev/null | sed 1q`: # # $0 $ac_configure_args # # Compiler output produced by configure, useful for debugging # configure, is in ./config.log if it exists. ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" for ac_option do case "\$ac_option" in -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; -version | --version | --versio | --versi | --vers | --ver | --ve | --v) echo "$CONFIG_STATUS generated by autoconf version 2.13" exit 0 ;; -help | --help | --hel | --he | --h) echo "\$ac_cs_usage"; exit 0 ;; *) echo "\$ac_cs_usage"; exit 1 ;; esac done ac_given_srcdir=$srcdir ac_given_INSTALL="$INSTALL" trap 'rm -fr `echo "Makefile lisp/Makefile lisp/sdic.el lisp/sample.emacs install.el" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF $ac_vpsub $extrasub s%@SHELL@%$SHELL%g s%@CFLAGS@%$CFLAGS%g s%@CPPFLAGS@%$CPPFLAGS%g s%@CXXFLAGS@%$CXXFLAGS%g s%@FFLAGS@%$FFLAGS%g s%@DEFS@%$DEFS%g s%@LDFLAGS@%$LDFLAGS%g s%@LIBS@%$LIBS%g s%@exec_prefix@%$exec_prefix%g s%@prefix@%$prefix%g s%@program_transform_name@%$program_transform_name%g s%@bindir@%$bindir%g s%@sbindir@%$sbindir%g s%@libexecdir@%$libexecdir%g s%@datadir@%$datadir%g s%@sysconfdir@%$sysconfdir%g s%@sharedstatedir@%$sharedstatedir%g s%@localstatedir@%$localstatedir%g s%@libdir@%$libdir%g s%@includedir@%$includedir%g s%@oldincludedir@%$oldincludedir%g s%@infodir@%$infodir%g s%@mandir@%$mandir%g s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g s%@INSTALL_DATA@%$INSTALL_DATA%g s%@PACKAGE@%$PACKAGE%g s%@VERSION@%$VERSION%g s%@ACLOCAL@%$ACLOCAL%g s%@AUTOCONF@%$AUTOCONF%g s%@AUTOMAKE@%$AUTOMAKE%g s%@AUTOHEADER@%$AUTOHEADER%g s%@MAKEINFO@%$MAKEINFO%g s%@SET_MAKE@%$SET_MAKE%g s%@EMACS@%$EMACS%g s%@emacsdir@%$emacsdir%g s%@lispdir@%$lispdir%g s%@NKF@%$NKF%g s%@PERL@%$PERL%g s%@GZIP@%$GZIP%g s%@BZIP2@%$BZIP2%g s%@CP@%$CP%g s%@SORT@%$SORT%g s%@DICTDIR@%$DICTDIR%g s%@EIJIROU_DIR@%$EIJIROU_DIR%g s%@WAEIJIROU_DIR@%$WAEIJIROU_DIR%g s%@MULTI_DICT@%$MULTI_DICT%g s%@EIWA_DICT@%$EIWA_DICT%g s%@EIWA_DICT_LIST@%$EIWA_DICT_LIST%g s%@WAEI_DICT@%$WAEI_DICT%g s%@WAEI_DICT_LIST@%$WAEI_DICT_LIST%g CEOF EOF cat >> $CONFIG_STATUS <<\EOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. ac_file=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_cmds # Line after last line for current file. ac_more_lines=: ac_sed_cmds="" while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file else sed "${ac_end}q" conftest.subs > conftest.s$ac_file fi if test ! -s conftest.s$ac_file; then ac_more_lines=false rm -f conftest.s$ac_file else if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f conftest.s$ac_file" else ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" fi ac_file=`expr $ac_file + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_cmds` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case "$ac_file" in *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; *) ac_file_in="${ac_file}.in" ;; esac # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. # Remove last slash and all that follows it. Not all systems have dirname. ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then # The file is in a subdirectory. test ! -d "$ac_dir" && mkdir "$ac_dir" ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" # A "../" for each directory in $ac_dir_suffix. ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` else ac_dir_suffix= ac_dots= fi case "$ac_given_srcdir" in .) srcdir=. if test -z "$ac_dots"; then top_srcdir=. else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; *) # Relative path. srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" top_srcdir="$ac_dots$ac_given_srcdir" ;; esac case "$ac_given_INSTALL" in [/$]*) INSTALL="$ac_given_INSTALL" ;; *) INSTALL="$ac_dots$ac_given_INSTALL" ;; esac echo creating "$ac_file" rm -f "$ac_file" configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." case "$ac_file" in *Makefile*) ac_comsub="1i\\ # $configure_input" ;; *) ac_comsub= ;; esac ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` sed -e "$ac_comsub s%@configure_input@%$configure_input%g s%@srcdir@%$srcdir%g s%@top_srcdir@%$top_srcdir%g s%@INSTALL@%$INSTALL%g " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file fi; done rm -f conftest.s* EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF exit 0 EOF chmod +x $CONFIG_STATUS rm -fr confdefs* $ac_clean_files test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 sdic-2.1.3/configure.in0000444000175000017500000001132307512046061010430 # # $Id: configure.in,v 1.20 2002/07/07 14:12:01 tsuchiya Exp $ # AC_INIT(lisp/stem.el) AM_INIT_AUTOMAKE(sdic, 2.1.3) AM_PATH_LISPDIR AC_PATH_PROG(NKF, nkf, no) if test "$NKF" = "no"; then AC_MSG_WARN(nkf not found) fi AC_PATH_PROG(PERL, perl, no) if test "$PERL" = "no"; then AC_MSG_WARN(perl not found) fi AC_PATH_PROG(GZIP, gzip, no) if test "$GZIP" = "no"; then AC_MSG_WARN(gzip not found) fi AC_PATH_PROG(BZIP2, bzip2, no) if test "$BZIP2" = "no"; then AC_MSG_WARN(bzip2 not found) fi AC_PATH_PROG(CP, cp, no) if test "$CP" = "no"; then AC_MSG_WARN(cp not found) fi AC_PATH_PROG(SORT, sort, no) if test "$SORT" = "no"; then AC_MSG_WARN(sort not found) fi DICTDIR=/usr/local/share/dict AC_ARG_WITH( dictdir, [ --with-dictdir=DIR dictionary files go to DIR [/usr/local/share/dict]], DICTDIR=$with_dictdir, ) AC_SUBST(DICTDIR) DICTTYPE=sdic AC_ARG_WITH( dicttype, [ --with-dicttype=TYPE use TYPE of dictionaries (sdic|compat) [sdic]], [case "${withval}" in dic|sdic) DICTTYPE=${withval} ;; compat) DICTTYPE=dic ;; *) AC_MSG_ERROR([Unknown dictionary type is specified.]) ;; esac], ) EIJIROU_DIR="./eijirou" AC_ARG_WITH( eijirou, [ --with-eijirou=DIR eijirou files are in DIR [./eijirou]], EIJIROU_DIR=$with_eijirou, ) AC_SUBST(EIJIROU_DIR) WAEIJIROU_DIR="./waeijirou" AC_ARG_WITH( waeijirou, [ --with-waeijirou=DIR waeijirou files are in DIR [./waeijirou]], WAEIJIROU_DIR=$with_waeijirou, ) AC_SUBST(WAEIJIROU_DIR) MULTI_DICT="no" AC_ARG_WITH( multidict, [ --with-multidict(=ARG) use multiple dictionaries (yes|no) [no]], [case "${withval}" in yes|no) MULTI_DICT=$withval ;; *) AC_MSG_ERROR([Illegal value is specified.]) ;; esac], ) AC_SUBST(MULTI_DICT) EIWA_DICT="" AC_MSG_CHECKING(for EIWA Dictionary) for dict in gene.sdic eedict.sdic eijirou.sdic \ gene.dic eedict.dic eijirou.dic \ e4jwords.sdic ecompdic.sdic eenamdict.sdic \ e4jwords.dic ecompdic.dic eenamdict.dic ; do if test -f "$DICTDIR/$dict"; then EIWA_DICT="$EIWA_DICT $dict" EIWA_DICT_LIST="$EIWA_DICT_LIST $DICTDIR/$dict" test "$MULTI_DICT" = "no" && break fi done if test -n "$EIWA_DICT"; then AC_MSG_RESULT($EIWA_DICT_LIST (already installed)) else if test -f gene95.lzh -o -f gene95.tar.gz -o -f gene95.tar.bz2; then if test -z "$EIWA_DICT" -o "$MULTI_DICT" = "yes"; then NAME="gene.$DICTTYPE" EIWA_DICT="$EIWA_DICT $NAME" EIWA_DICT_LIST="$EIWA_DICT_LIST $DICTDIR/$NAME" fi fi if test -d "$EIJIROU_DIR"; then if test -z "$EIWA_DICT" -o "$MULTI_DICT" = "yes"; then NAME="eijirou.$DICTTYPE" EIWA_DICT="$EIWA_DICT $NAME" EIWA_DICT_LIST="$EIWA_DICT_LIST $DICTDIR/$NAME" fi fi for dict in edict 4jwords compdic enamdict; do if test -f $dict.gz -o -f $dict.bz2; then if test -z "$EIWA_DICT" -o "$MULTI_DICT" = "yes"; then if test -z "$EIWA_DICT" -o "$MULTI_DICT" = "yes"; then NAME="e$dict.$DICTTYPE" EIWA_DICT="$EIWA_DICT $NAME" EIWA_DICT_LIST="$EIWA_DICT_LIST $DICTDIR/$NAME" fi fi fi done AC_MSG_RESULT($EIWA_DICT) fi EIWA_DICT_LIST='"'`echo "$EIWA_DICT_LIST" | sed 's/^ //;s/ /" "/g'`'"' AC_SUBST(EIWA_DICT) AC_SUBST(EIWA_DICT_LIST) AC_MSG_CHECKING(for WAEI Dictionary) WAEI_DICT="" for dict in jedict.sdic jgene.sdic waeijirou.sdic \ jedict.dic jgene.dic waeijirou.dic \ j4jwords.sdic jcompdic.sdic jenamdict.sdic \ j4jwords.dic jcompdic.dic jenamdict.dic ; do if test -f "$DICTDIR/$dict"; then WAEI_DICT="$WAEI_DICT $dict" WAEI_DICT_LIST="$WAEI_DICT_LIST $DICTDIR/$dict" test "$MULTI_DICT" = "no" && break fi done if test -n "$WAEI_DICT"; then AC_MSG_RESULT($WAEI_DICT_LIST (already installed)) else for dict in edict 4jwords compdic enamdict; do if test -f $dict.gz -o -f $dict.bz2; then if test -z "$WAEI_DICT" -o "$MULTI_DICT" = "yes"; then if test -z "$WAEI_DICT" -o "$MULTI_DICT" = "yes"; then NAME="j$dict.$DICTTYPE" WAEI_DICT="$WAEI_DICT $NAME" WAEI_DICT_LIST="$WAEI_DICT_LIST $DICTDIR/$NAME" fi fi fi done if test -f gene95.lzh -o -f gene95.tar.gz -o -f gene95.tar.bz2; then if test -z "$WAEI_DICT" -o "$MULTI_DICT" = "yes"; then NAME="jgene.$DICTTYPE" WAEI_DICT="$WAEI_DICT $NAME" WAEI_DICT_LIST="$WAEI_DICT_LIST $DICTDIR/$NAME" fi fi if test -d "$WAEIJIROU_DIR"; then if test -z "$WAEI_DICT" -o "$MULTI_DICT" = "yes"; then NAME="waeijirou.$DICTTYPE" WAEI_DICT="$WAEI_DICT $NAME" WAEI_DICT_LIST="$WAEI_DICT_LIST $DICTDIR/$NAME" fi fi AC_MSG_RESULT($WAEI_DICT) fi WAEI_DICT_LIST='"'`echo "$WAEI_DICT_LIST" | sed 's/^ //;s/ /" "/g'`'"' AC_SUBST(WAEI_DICT) AC_SUBST(WAEI_DICT_LIST) AC_OUTPUT(Makefile lisp/Makefile lisp/sdic.el lisp/sample.emacs install.el) sdic-2.1.3/install-sh0000755000175000017500000001124506717461747010152 #! /bin/sh # # install - install a program, script, or datafile # This comes from X11R5. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. # # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 else true fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d $dst ]; then instcmd=: else instcmd=mkdir fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f $src -o -d $src ] then true else echo "install: $src does not exist" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 else true fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` else true fi fi ## this sed command emulates the dirname command dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then defaultIFS=' ' IFS="${IFS-${defaultIFS}}" oIFS="${IFS}" # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` IFS="${oIFS}" pathcomp='' while [ $# -ne 0 ] ; do pathcomp="${pathcomp}${1}" shift if [ ! -d "${pathcomp}" ] ; then $mkdirprog "${pathcomp}" else true fi pathcomp="${pathcomp}/" done fi if [ x"$dir_arg" != x ] then $doit $instcmd $dst && if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi else # If we're going to rename the final executable, determine the name now. if [ x"$transformarg" = x ] then dstfile=`basename $dst` else dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename if [ x"$dstfile" = x ] then dstfile=`basename $dst` else true fi # Make a temp file name in the proper directory. dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp && trap "rm -f ${dsttmp}" 0 && # and set any options; do chmod last to preserve setuid bits # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && $doit $mvcmd $dsttmp $dstdir/$dstfile fi && exit 0 sdic-2.1.3/install.el.in0000444000175000017500000004435607510305732010531 ;; -*- Emacs-Lisp -*- ;; $Id: install.el.in,v 1.8 2002/07/02 11:17:46 tsuchiya Exp $ ;; Author: TSUCHIYA Masatoshi ;; Keywords: dictionary ;; This file is part of SDIC. ;; SDIC is free software; you can redistribute it and/or modify it ;; under the terms of the GNU General Public License as published by ;; the Free Software Foundation; either version 2 of the License, or ;; (at your option) any later version. ;; SDIC is distributed in the hope that it will be useful, but ;; WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with SDIC; if not, write to the Free Software Foundation, ;; Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ;;; Commentary: ;; このファイルは、GENE辞書を英和辞書として使い、EDICT辞書を和英辞書と ;; して使うための設定を行なう Emacs-Lisp プログラムです。主に Windows ;; 環境で利用することを想定しています。UNIX 環境でインストールを行なう ;; 場合は、普通に configure と make を使って下さい。 ;; ;; (1) GENE辞書のデータ gene95.lzh または gene95.tar.gz を展開して、 ;; gene.txt をこのファイルと同じディレクトリに置いて下さい。 ;; ;; (2) EDICT辞書のデータ edict.gz を展開して、edict をこのファイルと同 ;; じディレクトリに置いて下さい。 ;; ;; (3) 以下のコマンドを実行して下さい。 ;; ;; meadow -batch -q -no-site-file -l install.el -f make-sdic ;; ;; すると、実行された meadow の環境から適切なインストール先を推定 ;; して、インストールを実行します。インストール先を変更したい場合 ;; は、オプションで指定してください。 ;; ;; --infodir=DIR Info をインストールするディレクトリを指定 ;; --with-lispdir=DIR Lisp プログラムをインストールするディレクトリを指定 ;; --with-dictdir=DIR 辞書をインストールするディレクトリを指定 ;; --with-multidict=(yes|no) 複数辞書の検出を行う場合は yes (デフォルトは no) ;; ;; (4) 以下の設定を .emacs に付け加えて下さい。 ;; ;; (setq load-path (cons (expand-file-name "../../site-lisp/sdic" data-directory) load-path)) ;; (autoload 'sdic "sdic" "英単語の意味を調べる" t nil) ;; (global-set-key "\C-cw" 'sdic) ;; ;; キーバインドは適当に変更して下さい。Meadow-1.03 以降などでは、 ;; load-path についての設定は要らないかも知れません。 ;;; Code: ;; Emacs-20 以上の場合に必要な日本語環境の設定 (and (boundp 'emacs-major-version) (>= emacs-major-version 20) (fboundp 'set-language-environment) (set-language-environment "Japanese")) ;; インストール先を推定 (defvar make-sdic-lisp-directory ;; Mule-for-Windows と Meadow ではディレクトリ構成が異なる (if (fboundp 'mule-for-win32-version) (expand-file-name "../site-lisp/sdic" data-directory) (expand-file-name "../../site-lisp/sdic" data-directory)) "Lisp program をインストールするディレクトリ") (defvar make-sdic-info-directory (and (require 'info) (car Info-directory-list)) "Info をインストールするディレクトリ") (defvar make-sdic-dict-directory make-sdic-lisp-directory "辞書をインストールするディレクトリ") (defvar make-sdic-gene-coding-system (if (>= emacs-major-version 20) 'sjis-dos *autoconv*) "配布されているGENE辞書の漢字コード") (defvar make-sdic-edict-coding-system (if (>= emacs-major-version 20) 'euc-japan-unix *autoconv*) "配布されているEDICT辞書の漢字コード") ;; パッケージのディレクトリ構造を変数に設定 (defvar make-sdic-version "@VERSION@") (defvar make-sdic-root-directory (expand-file-name default-directory) "パッケージのトップディレクトリ") (defvar make-sdic-src-directory (expand-file-name "lisp" make-sdic-root-directory) "Lisp program が格納されているディレクトリ") (defvar make-sdic-texi-directory (expand-file-name "texi" make-sdic-root-directory) "Info のソースが格納されているディレクトリ") (defvar make-sdic-eiwa-candidates '("gene.sdic" "ejdict.sdic" "eedict.sdic" "eijirou.sdic" "gene.dic" "ejdict.dic" "eedict.dic" "eijirou.dic" "e4jwords.sdic" "ecompdic.sdic" "eenamdict.sdic" "e4jwords.dic" "ecompdic.dic" "eenamdict.dic") "インストール済の英和辞書を検索する場合に対象となるファイル名のリスト") (defvar make-sdic-waei-candidates '("edict.sdic" "jedict.sdic" "jgene.sdic" "waeijirou.sdic" "jedict.dic" "jgene.dic" "waeijirou.dic" "j4jwords.sdic" "jcompdic.sdic" "jenamdict.sdic" "j4jwords.dic" "jcompdic.dic" "jenamdict.dic") "インストール済の和英辞書を検索する場合に対象となるファイル名のリスト") (defvar make-sdic-detect-multi-dictionary nil "複数辞書を検出する場合は t にする") (defvar make-sdic-debug nil) ;; load-path を設定 (mapcar (lambda (dir) (or (member dir load-path) (setq load-path (cons dir load-path)))) (list make-sdic-root-directory make-sdic-src-directory)) (setq sdic-eiwa-dictionary-list nil sdic-waei-dictionary-list nil) (load "sdic.el.in") (require 'sdicf) (require 'texinfmt) ;;; ここから本体 (defun make-sdic () (defvar command-line-args-left) ;Avoid 'free variable' warning (if (not noninteractive) (error "`make-sdic' is to be used only with -batch")) (while command-line-args-left (cond ((string= "-n" (car command-line-args-left)) (setq make-sdic-debug t)) ((string= "-?" (car command-line-args-left)) (make-sdic-help)) ((string-match "^--with-lispdir=" (car command-line-args-left)) (setq make-sdic-lisp-directory (substring (car command-line-args-left) (match-end 0)))) ((string-match "^--infodir=" (car command-line-args-left)) (setq make-sdic-info-directory (substring (car command-line-args-left) (match-end 0)))) ((string-match "^--with-dictdir=" (car command-line-args-left)) (setq make-sdic-dict-directory (substring (car command-line-args-left) (match-end 0)))) ((string-match "^--with-multidict=\\(yes\\|no\\)" (car command-line-args-left)) (setq make-sdic-detect-multi-dictionary (string= "yes" (substring (car command-line-args-left) -3)))) (t (make-sdic-help "Illegal option"))) (setq command-line-args-left (cdr command-line-args-left))) ;; インストール先のディレクトリを作る (or make-sdic-debug (mapcar (lambda (dir) (or (file-directory-p dir) (progn (message "Make directory: %s" dir) (make-directory dir)))) (list make-sdic-lisp-directory make-sdic-info-directory make-sdic-dict-directory))) ;; インストール済の辞書があるか調べる (let ((eiwa (or (delq nil (mapcar (lambda (basename) (and (file-exists-p (expand-file-name basename make-sdic-dict-directory)) basename)) make-sdic-eiwa-candidates)) (file-exists-p "gene.txt"))) (waei (or (delq nil (mapcar (lambda (basename) (and (file-exists-p (expand-file-name basename make-sdic-dict-directory)) basename)) make-sdic-waei-candidates)) (file-exists-p "edict")))) ;; インストール済の辞書から重複しているものを取り除く (or (eq eiwa t) (eq eiwa nil) (setq eiwa (delq t (mapcar (lambda (basename) (if (string-match "\\.dic" basename) (if (member (concat (substring basename 0 -3) "sdic") eiwa) t basename) basename)) eiwa)))) (or (eq waei t) (eq waei nil) (setq waei (delq t (mapcar (lambda (basename) (if (string-match "\\.dic" basename) (if (member (concat (substring basename 0 -3) "sdic") waei) t basename) basename)) waei)))) ;; --with-multidict=no の場合は、最初に見つかった辞書のみを利用する (or make-sdic-detect-multi-dictionary (progn (or (eq eiwa t) (eq eiwa nil) (setq eiwa (list (car eiwa)))) (or (eq waei t) (eq waei nil) (setq waei (list (car waei)))))) (make-sdic-sdic_el (if (eq eiwa t) (list "gene.sdic") eiwa) (if (eq waei t) (list "jedict.sdic") waei)) (make-sdic-install-lisp) (make-sdic-install-info) (if (eq eiwa t) (make-sdic-install-gene)) (if (eq waei t) (make-sdic-install-jedict)) (make-sdic-sample_emacs) )) (defun make-sdic-help (&optional msg) "ヘルプメッセージを出力してそのまま終了する関数" (error "%s\ Usage: emacs -batch -q -no-site-file -l install.el -f make-sdic [options] Options: Action: -? Print this message. -n Print files thath would be created and installed, but do not install them. Direcotry: --infodir=DIR info documentation in DIR [guessed] --with-lispdir=DIR emacs lisp files go to DIR [guessed] --with-dictdir=DIR dictionary files go to DIR [guessed] --with-multidict=(ARG) use multiple dictionaries (yes|no) [no] " (if msg (concat msg "\n") ""))) (defun make-sdic-sample_emacs () "sample.emacs.in から sample.emacs を生成する関数" (let ((in-file (expand-file-name "sample.emacs.in" make-sdic-src-directory)) (out-file (expand-file-name "sample.emacs" make-sdic-src-directory))) (if make-sdic-debug (message "%s" out-file) (message "%s -> %s" in-file out-file) (or (file-readable-p in-file) (error "Can't find file : %s" in-file)) (let ((buf (generate-new-buffer "*sample.emacs*"))) (unwind-protect (progn (set-buffer buf) (sdicf-insert-file-contents in-file sdic-default-coding-system) (goto-char (point-min)) (search-forward (concat "@" "lispdir" "@")) (delete-region (goto-char (match-beginning 0)) (match-end 0)) (insert make-sdic-lisp-directory) (make-sdic-write-file out-file)) (kill-buffer buf)))))) (defun make-sdic-sdic_el (eiwa waei) "sdic.el.in から sdic.el を生成する関数" (let ((in-file (expand-file-name "sdic.el.in" make-sdic-src-directory)) (out-file (expand-file-name "sdic.el" make-sdic-src-directory))) (if make-sdic-debug (message "%s" (expand-file-name "sdic.el" make-sdic-lisp-directory)) (message "%s -> %s" in-file out-file) (or (file-readable-p in-file) (error "Can't find file : %s" in-file)) (let ((buf (generate-new-buffer "*sdic.el*"))) (unwind-protect (progn (set-buffer buf) (sdicf-insert-file-contents in-file sdic-default-coding-system) (goto-char (point-min)) (search-forward (concat "@" "VERSION" "@")) (delete-region (goto-char (match-beginning 0)) (match-end 0)) (insert make-sdic-version) (if (listp eiwa) (progn (goto-char (point-min)) (search-forward (concat "@" "EIWA_DICT_LIST" "@")) (delete-region (goto-char (match-beginning 0)) (match-end 0)) (insert (mapconcat (lambda (s) s) (mapcar (lambda (basename) (format "\"%s\"" (expand-file-name basename make-sdic-dict-directory))) eiwa) " ")))) (if (listp waei) (progn (goto-char (point-min)) (search-forward (concat "@" "WAEI_DICT_LIST" "@")) (delete-region (goto-char (match-beginning 0)) (match-end 0)) (insert (mapconcat (lambda (s) s) (mapcar (lambda (basename) (format "\"%s\"" (expand-file-name basename make-sdic-dict-directory))) waei) " ")))) (make-sdic-write-file out-file)) (kill-buffer buf)))))) (defun make-sdic-install-lisp () "全てのファイルをバイトコンパイルしてインストールする関数" (mapcar (lambda (basename) (let ((in-file (expand-file-name basename make-sdic-src-directory)) (out-file (expand-file-name basename make-sdic-lisp-directory))) (if make-sdic-debug (message "%s" out-file) (message "%s -> %s" in-file out-file) (byte-compile-file in-file) (copy-file in-file out-file t t) (copy-file (concat in-file "c") (concat out-file "c") t t)))) (directory-files make-sdic-src-directory nil "^\\(sdic.*\\|stem\\)\\.el$"))) (defun make-sdic-install-info () "Info を処理してインストールする関数" (let ((in-file (expand-file-name "sdic.texi" make-sdic-texi-directory)) (out-file (expand-file-name "sdic.info" make-sdic-texi-directory)) (copy-file (expand-file-name "sdic.info" make-sdic-info-directory))) (if make-sdic-debug (message "%s" copy-file) (message "%s -> %s -> %s" in-file out-file copy-file) (or (file-readable-p in-file) (error "Can't find file : %s" in-file)) (let ((buf (generate-new-buffer "*sdic.texi*"))) (unwind-protect (progn (set-buffer buf) (insert-file-contents in-file) (texinfo-format-buffer) (write-file out-file)) (kill-buffer buf))) (copy-file out-file copy-file t t)))) (defun make-sdic-install-gene () "GENE辞書をSDIC形式に変換してインストールする関数" (let* ((in-file (expand-file-name "gene.txt" make-sdic-root-directory)) (out-file (expand-file-name "gene.sdic" make-sdic-root-directory)) (copy-file (expand-file-name "gene.sdic" make-sdic-dict-directory))) (if make-sdic-debug (message "%s" copy-file) (message "%s -> %s -> %s" in-file out-file copy-file) (or (file-readable-p in-file) (error "Can't find file : %s" in-file)) (make-sdic-gene in-file out-file) (copy-file out-file copy-file t t)))) (defun make-sdic-install-jedict () "EDICT辞書をSDIC形式に変換してインストールする関数" (let* ((in-file (expand-file-name "edict" make-sdic-root-directory)) (out-file (expand-file-name "jedict.sdic" make-sdic-root-directory)) (copy-file (expand-file-name "jedict.sdic" make-sdic-dict-directory))) (if make-sdic-debug (message "%s" copy-file) (message "%s -> %s -> %s" in-file out-file copy-file) (or (file-readable-p in-file) (error "Can't find file : %s" in-file)) (make-sdic-jedict in-file out-file) (copy-file out-file copy-file t t)))) (defun make-sdic-write-file (output-file) (let ((buffer-file-coding-system sdic-default-coding-system) (file-coding-system sdic-default-coding-system)) (message "Writing %s..." output-file) (write-region (point-min) (point-max) output-file))) (defun make-sdic-gene (input-file &optional output-file) "GENE辞書をSDIC形式に変換する" (interactive "fInput dictionary file name: ") (or output-file (setq output-file (concat (if (string-match "\\.[^\\.]+$" input-file) (substring input-file 0 (match-beginning 0)) input-file) ".sdic"))) (let ((buf (generate-new-buffer "*gene*"))) (unwind-protect (save-excursion (set-buffer buf) (message "Reading %s..." input-file) (sdicf-insert-file-contents input-file make-sdic-gene-coding-system) (message "Converting %s..." input-file) ;; 最初の2行はコメントだから、行頭に # を挿入する (goto-char (point-min)) (insert "# ") (forward-line) (beginning-of-line) (insert "# ") (forward-line) (beginning-of-line) (save-restriction (narrow-to-region (point) (point-max)) (make-sdic-escape-region (point-min) (point-max)) (let (head list key top) (while (progn (setq top (point)) (end-of-line) (delete-region (point) (progn (skip-chars-backward "[ \t\f\r]") (point))) (setq head (buffer-substring top (point)) key (make-sdic-replace-string (downcase head) "\\s-+" " ")) (if (string-match " +\\+[0-9]+$" key) (setq key (substring key 0 (match-beginning 0)))) (beginning-of-line) (if (string= head key) (progn (insert "") (end-of-line) (insert "")) (insert "") (end-of-line) (insert "" key "")) (delete-char 1) (end-of-line) (forward-char) (not (eobp))))) (message "Sorting %s..." input-file) (sort-lines nil (point-min) (point-max))) (make-sdic-write-file output-file)) (kill-buffer buf)))) (defun make-sdic-jedict (input-file &optional output-file) "EDICT辞書をSDIC形式に変換する" (interactive "fInput dictionary file name: ") (or output-file (setq output-file (concat (if (string-match "\\.[^\\.]+$" input-file) (substring input-file 0 (match-beginning 0)) input-file) ".sdic"))) (let ((buf (generate-new-buffer "*jedict*"))) (unwind-protect (save-excursion (set-buffer buf) (message "Reading %s..." input-file) (sdicf-insert-file-contents input-file make-sdic-edict-coding-system) (message "Converting %s..." input-file) ;; 最初の1行はコメントだから、行頭に # を挿入する (delete-region (goto-char (point-min)) (progn (forward-char 4) (point))) (insert "# ") (forward-line) (beginning-of-line) (save-restriction (narrow-to-region (point) (point-max)) (make-sdic-escape-region (point-min) (point-max)) (while (progn (insert "") (looking-at "\\cj+") (goto-char (match-end 0)) (insert "") (delete-char 1) (if (looking-at "\\[\\(\\cj+\\)\\] +") (let ((key (buffer-substring (match-beginning 1) (match-end 1)))) (delete-region (match-beginning 0) (match-end 0)) (insert "" key ""))) (delete-char 1) (end-of-line) (backward-char) (delete-char 1) (forward-char) (not (eobp)))) (message "Sorting %s..." input-file) (sort-lines nil (point-min) (point-max))) (make-sdic-write-file output-file)) (kill-buffer buf)))) (defun make-sdic-replace-string (string from to) "\ 文字列 STRING に含まれている文字列 FROM を全て文字列 TO に置換した文字列を返す FROM には正規表現を含む文字列を指定できるが、TO は固定文字列しか指定で きないので、注意して使うこと。" (let ((start 0) list) (while (string-match from string start) (setq list (cons to (cons (substring string start (match-beginning 0)) list)) start (match-end 0))) (eval (cons 'concat (nreverse (cons (substring string start) list)))))) (defun make-sdic-escape-string (str &optional escape-lf) "STR に含まれている特殊文字をエスケープする" (save-match-data (setq str (make-sdic-replace-string str "&" "&")) (if escape-lf (setq str (make-sdic-replace-string str "\n" "&lf;"))) (setq str (make-sdic-replace-string str "<" "<")) (make-sdic-replace-string str ">" ">"))) (defun make-sdic-escape-region (start end &optional escape-lf) "リージョンに含まれている特殊文字をエスケープする" (save-excursion (save-match-data (save-restriction (narrow-to-region start end) (goto-char (point-min)) (while (search-forward "&" nil t) (replace-match "&" t t)) (goto-char (point-min)) (while (search-forward "<" nil t) (replace-match "<" t t)) (goto-char (point-min)) (while (search-forward ">" nil t) (replace-match ">" t t)) (if escape-lf (progn (goto-char (point-min)) (while (search-forward "\n" nil t) (replace-match "&lf;" t t)))) )))) sdic-2.1.3/missing0000755000175000017500000001105206717461747007541 #! /bin/sh # Common stub for a few missing GNU programs while installing. # Copyright (C) 1996, 1997 Free Software Foundation, Inc. # Franc,ois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi case "$1" in -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' automake touch all \`Makefile.in' files bison touch file \`y.tab.c' makeinfo touch the output file yacc touch file \`y.tab.c'" ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing - GNU libit 0.0" ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; aclocal) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`acinclude.m4' or \`configure.in'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`configure.in'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`acconfig.h' or \`configure.in'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch config.h.in ;; automake) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print \ | sed 's/^\(.*\).am$/touch \1.in/' \ | sh ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." touch y.tab.c ;; makeinfo) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` fi touch $file ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and you do not seem to have it handy on your system. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequirements for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 sdic-2.1.3/mkinstalldirs0000755000175000017500000000113606717461747010752 #! /bin/sh # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman # Created: 1993-05-16 # Public domain errstatus=0 for file do set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift pathcomp= for d in ${1+"$@"} ; do pathcomp="$pathcomp$d" case "$pathcomp" in -* ) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" 1>&2 mkdir "$pathcomp" || errstatus=$? fi pathcomp="$pathcomp/" done done exit $errstatus # mkinstalldirs ends here sdic-2.1.3/install.el0000644000175000017500000004435207512046265010127 ;; -*- Emacs-Lisp -*- ;; $Id: install.el.in,v 1.8 2002/07/02 11:17:46 tsuchiya Exp $ ;; Author: TSUCHIYA Masatoshi ;; Keywords: dictionary ;; This file is part of SDIC. ;; SDIC is free software; you can redistribute it and/or modify it ;; under the terms of the GNU General Public License as published by ;; the Free Software Foundation; either version 2 of the License, or ;; (at your option) any later version. ;; SDIC is distributed in the hope that it will be useful, but ;; WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with SDIC; if not, write to the Free Software Foundation, ;; Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ;;; Commentary: ;; このファイルは、GENE辞書を英和辞書として使い、EDICT辞書を和英辞書と ;; して使うための設定を行なう Emacs-Lisp プログラムです。主に Windows ;; 環境で利用することを想定しています。UNIX 環境でインストールを行なう ;; 場合は、普通に configure と make を使って下さい。 ;; ;; (1) GENE辞書のデータ gene95.lzh または gene95.tar.gz を展開して、 ;; gene.txt をこのファイルと同じディレクトリに置いて下さい。 ;; ;; (2) EDICT辞書のデータ edict.gz を展開して、edict をこのファイルと同 ;; じディレクトリに置いて下さい。 ;; ;; (3) 以下のコマンドを実行して下さい。 ;; ;; meadow -batch -q -no-site-file -l install.el -f make-sdic ;; ;; すると、実行された meadow の環境から適切なインストール先を推定 ;; して、インストールを実行します。インストール先を変更したい場合 ;; は、オプションで指定してください。 ;; ;; --infodir=DIR Info をインストールするディレクトリを指定 ;; --with-lispdir=DIR Lisp プログラムをインストールするディレクトリを指定 ;; --with-dictdir=DIR 辞書をインストールするディレクトリを指定 ;; --with-multidict=(yes|no) 複数辞書の検出を行う場合は yes (デフォルトは no) ;; ;; (4) 以下の設定を .emacs に付け加えて下さい。 ;; ;; (setq load-path (cons (expand-file-name "../../site-lisp/sdic" data-directory) load-path)) ;; (autoload 'sdic "sdic" "英単語の意味を調べる" t nil) ;; (global-set-key "\C-cw" 'sdic) ;; ;; キーバインドは適当に変更して下さい。Meadow-1.03 以降などでは、 ;; load-path についての設定は要らないかも知れません。 ;;; Code: ;; Emacs-20 以上の場合に必要な日本語環境の設定 (and (boundp 'emacs-major-version) (>= emacs-major-version 20) (fboundp 'set-language-environment) (set-language-environment "Japanese")) ;; インストール先を推定 (defvar make-sdic-lisp-directory ;; Mule-for-Windows と Meadow ではディレクトリ構成が異なる (if (fboundp 'mule-for-win32-version) (expand-file-name "../site-lisp/sdic" data-directory) (expand-file-name "../../site-lisp/sdic" data-directory)) "Lisp program をインストールするディレクトリ") (defvar make-sdic-info-directory (and (require 'info) (car Info-directory-list)) "Info をインストールするディレクトリ") (defvar make-sdic-dict-directory make-sdic-lisp-directory "辞書をインストールするディレクトリ") (defvar make-sdic-gene-coding-system (if (>= emacs-major-version 20) 'sjis-dos *autoconv*) "配布されているGENE辞書の漢字コード") (defvar make-sdic-edict-coding-system (if (>= emacs-major-version 20) 'euc-japan-unix *autoconv*) "配布されているEDICT辞書の漢字コード") ;; パッケージのディレクトリ構造を変数に設定 (defvar make-sdic-version "2.1.3") (defvar make-sdic-root-directory (expand-file-name default-directory) "パッケージのトップディレクトリ") (defvar make-sdic-src-directory (expand-file-name "lisp" make-sdic-root-directory) "Lisp program が格納されているディレクトリ") (defvar make-sdic-texi-directory (expand-file-name "texi" make-sdic-root-directory) "Info のソースが格納されているディレクトリ") (defvar make-sdic-eiwa-candidates '("gene.sdic" "ejdict.sdic" "eedict.sdic" "eijirou.sdic" "gene.dic" "ejdict.dic" "eedict.dic" "eijirou.dic" "e4jwords.sdic" "ecompdic.sdic" "eenamdict.sdic" "e4jwords.dic" "ecompdic.dic" "eenamdict.dic") "インストール済の英和辞書を検索する場合に対象となるファイル名のリスト") (defvar make-sdic-waei-candidates '("edict.sdic" "jedict.sdic" "jgene.sdic" "waeijirou.sdic" "jedict.dic" "jgene.dic" "waeijirou.dic" "j4jwords.sdic" "jcompdic.sdic" "jenamdict.sdic" "j4jwords.dic" "jcompdic.dic" "jenamdict.dic") "インストール済の和英辞書を検索する場合に対象となるファイル名のリスト") (defvar make-sdic-detect-multi-dictionary nil "複数辞書を検出する場合は t にする") (defvar make-sdic-debug nil) ;; load-path を設定 (mapcar (lambda (dir) (or (member dir load-path) (setq load-path (cons dir load-path)))) (list make-sdic-root-directory make-sdic-src-directory)) (setq sdic-eiwa-dictionary-list nil sdic-waei-dictionary-list nil) (load "sdic.el.in") (require 'sdicf) (require 'texinfmt) ;;; ここから本体 (defun make-sdic () (defvar command-line-args-left) ;Avoid 'free variable' warning (if (not noninteractive) (error "`make-sdic' is to be used only with -batch")) (while command-line-args-left (cond ((string= "-n" (car command-line-args-left)) (setq make-sdic-debug t)) ((string= "-?" (car command-line-args-left)) (make-sdic-help)) ((string-match "^--with-lispdir=" (car command-line-args-left)) (setq make-sdic-lisp-directory (substring (car command-line-args-left) (match-end 0)))) ((string-match "^--infodir=" (car command-line-args-left)) (setq make-sdic-info-directory (substring (car command-line-args-left) (match-end 0)))) ((string-match "^--with-dictdir=" (car command-line-args-left)) (setq make-sdic-dict-directory (substring (car command-line-args-left) (match-end 0)))) ((string-match "^--with-multidict=\\(yes\\|no\\)" (car command-line-args-left)) (setq make-sdic-detect-multi-dictionary (string= "yes" (substring (car command-line-args-left) -3)))) (t (make-sdic-help "Illegal option"))) (setq command-line-args-left (cdr command-line-args-left))) ;; インストール先のディレクトリを作る (or make-sdic-debug (mapcar (lambda (dir) (or (file-directory-p dir) (progn (message "Make directory: %s" dir) (make-directory dir)))) (list make-sdic-lisp-directory make-sdic-info-directory make-sdic-dict-directory))) ;; インストール済の辞書があるか調べる (let ((eiwa (or (delq nil (mapcar (lambda (basename) (and (file-exists-p (expand-file-name basename make-sdic-dict-directory)) basename)) make-sdic-eiwa-candidates)) (file-exists-p "gene.txt"))) (waei (or (delq nil (mapcar (lambda (basename) (and (file-exists-p (expand-file-name basename make-sdic-dict-directory)) basename)) make-sdic-waei-candidates)) (file-exists-p "edict")))) ;; インストール済の辞書から重複しているものを取り除く (or (eq eiwa t) (eq eiwa nil) (setq eiwa (delq t (mapcar (lambda (basename) (if (string-match "\\.dic" basename) (if (member (concat (substring basename 0 -3) "sdic") eiwa) t basename) basename)) eiwa)))) (or (eq waei t) (eq waei nil) (setq waei (delq t (mapcar (lambda (basename) (if (string-match "\\.dic" basename) (if (member (concat (substring basename 0 -3) "sdic") waei) t basename) basename)) waei)))) ;; --with-multidict=no の場合は、最初に見つかった辞書のみを利用する (or make-sdic-detect-multi-dictionary (progn (or (eq eiwa t) (eq eiwa nil) (setq eiwa (list (car eiwa)))) (or (eq waei t) (eq waei nil) (setq waei (list (car waei)))))) (make-sdic-sdic_el (if (eq eiwa t) (list "gene.sdic") eiwa) (if (eq waei t) (list "jedict.sdic") waei)) (make-sdic-install-lisp) (make-sdic-install-info) (if (eq eiwa t) (make-sdic-install-gene)) (if (eq waei t) (make-sdic-install-jedict)) (make-sdic-sample_emacs) )) (defun make-sdic-help (&optional msg) "ヘルプメッセージを出力してそのまま終了する関数" (error "%s\ Usage: emacs -batch -q -no-site-file -l install.el -f make-sdic [options] Options: Action: -? Print this message. -n Print files thath would be created and installed, but do not install them. Direcotry: --infodir=DIR info documentation in DIR [guessed] --with-lispdir=DIR emacs lisp files go to DIR [guessed] --with-dictdir=DIR dictionary files go to DIR [guessed] --with-multidict=(ARG) use multiple dictionaries (yes|no) [no] " (if msg (concat msg "\n") ""))) (defun make-sdic-sample_emacs () "sample.emacs.in から sample.emacs を生成する関数" (let ((in-file (expand-file-name "sample.emacs.in" make-sdic-src-directory)) (out-file (expand-file-name "sample.emacs" make-sdic-src-directory))) (if make-sdic-debug (message "%s" out-file) (message "%s -> %s" in-file out-file) (or (file-readable-p in-file) (error "Can't find file : %s" in-file)) (let ((buf (generate-new-buffer "*sample.emacs*"))) (unwind-protect (progn (set-buffer buf) (sdicf-insert-file-contents in-file sdic-default-coding-system) (goto-char (point-min)) (search-forward (concat "@" "lispdir" "@")) (delete-region (goto-char (match-beginning 0)) (match-end 0)) (insert make-sdic-lisp-directory) (make-sdic-write-file out-file)) (kill-buffer buf)))))) (defun make-sdic-sdic_el (eiwa waei) "sdic.el.in から sdic.el を生成する関数" (let ((in-file (expand-file-name "sdic.el.in" make-sdic-src-directory)) (out-file (expand-file-name "sdic.el" make-sdic-src-directory))) (if make-sdic-debug (message "%s" (expand-file-name "sdic.el" make-sdic-lisp-directory)) (message "%s -> %s" in-file out-file) (or (file-readable-p in-file) (error "Can't find file : %s" in-file)) (let ((buf (generate-new-buffer "*sdic.el*"))) (unwind-protect (progn (set-buffer buf) (sdicf-insert-file-contents in-file sdic-default-coding-system) (goto-char (point-min)) (search-forward (concat "@" "VERSION" "@")) (delete-region (goto-char (match-beginning 0)) (match-end 0)) (insert make-sdic-version) (if (listp eiwa) (progn (goto-char (point-min)) (search-forward (concat "@" "EIWA_DICT_LIST" "@")) (delete-region (goto-char (match-beginning 0)) (match-end 0)) (insert (mapconcat (lambda (s) s) (mapcar (lambda (basename) (format "\"%s\"" (expand-file-name basename make-sdic-dict-directory))) eiwa) " ")))) (if (listp waei) (progn (goto-char (point-min)) (search-forward (concat "@" "WAEI_DICT_LIST" "@")) (delete-region (goto-char (match-beginning 0)) (match-end 0)) (insert (mapconcat (lambda (s) s) (mapcar (lambda (basename) (format "\"%s\"" (expand-file-name basename make-sdic-dict-directory))) waei) " ")))) (make-sdic-write-file out-file)) (kill-buffer buf)))))) (defun make-sdic-install-lisp () "全てのファイルをバイトコンパイルしてインストールする関数" (mapcar (lambda (basename) (let ((in-file (expand-file-name basename make-sdic-src-directory)) (out-file (expand-file-name basename make-sdic-lisp-directory))) (if make-sdic-debug (message "%s" out-file) (message "%s -> %s" in-file out-file) (byte-compile-file in-file) (copy-file in-file out-file t t) (copy-file (concat in-file "c") (concat out-file "c") t t)))) (directory-files make-sdic-src-directory nil "^\\(sdic.*\\|stem\\)\\.el$"))) (defun make-sdic-install-info () "Info を処理してインストールする関数" (let ((in-file (expand-file-name "sdic.texi" make-sdic-texi-directory)) (out-file (expand-file-name "sdic.info" make-sdic-texi-directory)) (copy-file (expand-file-name "sdic.info" make-sdic-info-directory))) (if make-sdic-debug (message "%s" copy-file) (message "%s -> %s -> %s" in-file out-file copy-file) (or (file-readable-p in-file) (error "Can't find file : %s" in-file)) (let ((buf (generate-new-buffer "*sdic.texi*"))) (unwind-protect (progn (set-buffer buf) (insert-file-contents in-file) (texinfo-format-buffer) (write-file out-file)) (kill-buffer buf))) (copy-file out-file copy-file t t)))) (defun make-sdic-install-gene () "GENE辞書をSDIC形式に変換してインストールする関数" (let* ((in-file (expand-file-name "gene.txt" make-sdic-root-directory)) (out-file (expand-file-name "gene.sdic" make-sdic-root-directory)) (copy-file (expand-file-name "gene.sdic" make-sdic-dict-directory))) (if make-sdic-debug (message "%s" copy-file) (message "%s -> %s -> %s" in-file out-file copy-file) (or (file-readable-p in-file) (error "Can't find file : %s" in-file)) (make-sdic-gene in-file out-file) (copy-file out-file copy-file t t)))) (defun make-sdic-install-jedict () "EDICT辞書をSDIC形式に変換してインストールする関数" (let* ((in-file (expand-file-name "edict" make-sdic-root-directory)) (out-file (expand-file-name "jedict.sdic" make-sdic-root-directory)) (copy-file (expand-file-name "jedict.sdic" make-sdic-dict-directory))) (if make-sdic-debug (message "%s" copy-file) (message "%s -> %s -> %s" in-file out-file copy-file) (or (file-readable-p in-file) (error "Can't find file : %s" in-file)) (make-sdic-jedict in-file out-file) (copy-file out-file copy-file t t)))) (defun make-sdic-write-file (output-file) (let ((buffer-file-coding-system sdic-default-coding-system) (file-coding-system sdic-default-coding-system)) (message "Writing %s..." output-file) (write-region (point-min) (point-max) output-file))) (defun make-sdic-gene (input-file &optional output-file) "GENE辞書をSDIC形式に変換する" (interactive "fInput dictionary file name: ") (or output-file (setq output-file (concat (if (string-match "\\.[^\\.]+$" input-file) (substring input-file 0 (match-beginning 0)) input-file) ".sdic"))) (let ((buf (generate-new-buffer "*gene*"))) (unwind-protect (save-excursion (set-buffer buf) (message "Reading %s..." input-file) (sdicf-insert-file-contents input-file make-sdic-gene-coding-system) (message "Converting %s..." input-file) ;; 最初の2行はコメントだから、行頭に # を挿入する (goto-char (point-min)) (insert "# ") (forward-line) (beginning-of-line) (insert "# ") (forward-line) (beginning-of-line) (save-restriction (narrow-to-region (point) (point-max)) (make-sdic-escape-region (point-min) (point-max)) (let (head list key top) (while (progn (setq top (point)) (end-of-line) (delete-region (point) (progn (skip-chars-backward "[ \t\f\r]") (point))) (setq head (buffer-substring top (point)) key (make-sdic-replace-string (downcase head) "\\s-+" " ")) (if (string-match " +\\+[0-9]+$" key) (setq key (substring key 0 (match-beginning 0)))) (beginning-of-line) (if (string= head key) (progn (insert "") (end-of-line) (insert "")) (insert "") (end-of-line) (insert "" key "")) (delete-char 1) (end-of-line) (forward-char) (not (eobp))))) (message "Sorting %s..." input-file) (sort-lines nil (point-min) (point-max))) (make-sdic-write-file output-file)) (kill-buffer buf)))) (defun make-sdic-jedict (input-file &optional output-file) "EDICT辞書をSDIC形式に変換する" (interactive "fInput dictionary file name: ") (or output-file (setq output-file (concat (if (string-match "\\.[^\\.]+$" input-file) (substring input-file 0 (match-beginning 0)) input-file) ".sdic"))) (let ((buf (generate-new-buffer "*jedict*"))) (unwind-protect (save-excursion (set-buffer buf) (message "Reading %s..." input-file) (sdicf-insert-file-contents input-file make-sdic-edict-coding-system) (message "Converting %s..." input-file) ;; 最初の1行はコメントだから、行頭に # を挿入する (delete-region (goto-char (point-min)) (progn (forward-char 4) (point))) (insert "# ") (forward-line) (beginning-of-line) (save-restriction (narrow-to-region (point) (point-max)) (make-sdic-escape-region (point-min) (point-max)) (while (progn (insert "") (looking-at "\\cj+") (goto-char (match-end 0)) (insert "") (delete-char 1) (if (looking-at "\\[\\(\\cj+\\)\\] +") (let ((key (buffer-substring (match-beginning 1) (match-end 1)))) (delete-region (match-beginning 0) (match-end 0)) (insert "" key ""))) (delete-char 1) (end-of-line) (backward-char) (delete-char 1) (forward-char) (not (eobp)))) (message "Sorting %s..." input-file) (sort-lines nil (point-min) (point-max))) (make-sdic-write-file output-file)) (kill-buffer buf)))) (defun make-sdic-replace-string (string from to) "\ 文字列 STRING に含まれている文字列 FROM を全て文字列 TO に置換した文字列を返す FROM には正規表現を含む文字列を指定できるが、TO は固定文字列しか指定で きないので、注意して使うこと。" (let ((start 0) list) (while (string-match from string start) (setq list (cons to (cons (substring string start (match-beginning 0)) list)) start (match-end 0))) (eval (cons 'concat (nreverse (cons (substring string start) list)))))) (defun make-sdic-escape-string (str &optional escape-lf) "STR に含まれている特殊文字をエスケープする" (save-match-data (setq str (make-sdic-replace-string str "&" "&")) (if escape-lf (setq str (make-sdic-replace-string str "\n" "&lf;"))) (setq str (make-sdic-replace-string str "<" "<")) (make-sdic-replace-string str ">" ">"))) (defun make-sdic-escape-region (start end &optional escape-lf) "リージョンに含まれている特殊文字をエスケープする" (save-excursion (save-match-data (save-restriction (narrow-to-region start end) (goto-char (point-min)) (while (search-forward "&" nil t) (replace-match "&" t t)) (goto-char (point-min)) (while (search-forward "<" nil t) (replace-match "<" t t)) (goto-char (point-min)) (while (search-forward ">" nil t) (replace-match ">" t t)) (if escape-lf (progn (goto-char (point-min)) (while (search-forward "\n" nil t) (replace-match "&lf;" t t)))) )))) sdic-2.1.3/lisp/0000777000175000017500000000000007512046270007156 5sdic-2.1.3/lisp/Makefile.in0000644000175000017500000001444307512046270011145 # Makefile.in generated automatically by automake 1.4-p4 from Makefile.am # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. # -*- Makefile -*- SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include DESTDIR = pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : BZIP2 = @BZIP2@ CP = @CP@ DICTDIR = @DICTDIR@ EIJIROU_DIR = @EIJIROU_DIR@ EIWA_DICT = @EIWA_DICT@ EIWA_DICT_LIST = @EIWA_DICT_LIST@ EMACS = @EMACS@ GZIP = @GZIP@ MAKEINFO = @MAKEINFO@ MULTI_DICT = @MULTI_DICT@ NKF = @NKF@ PACKAGE = @PACKAGE@ PERL = @PERL@ SORT = @SORT@ VERSION = @VERSION@ WAEIJIROU_DIR = @WAEIJIROU_DIR@ WAEI_DICT = @WAEI_DICT@ WAEI_DICT_LIST = @WAEI_DICT_LIST@ emacsdir = @emacsdir@ lispdir = @lispdir@ SOURCES = sdicf.el sdicf-client.el sdic-compat.el sdic-gene.el stem.el EXTRA_DIST = sdic.el.in DISTCLEANFILES = sdic.el lisp_LISP = $(SOURCES) sdic.el # sdic.el must be in this ELCFILES = $(lisp_LISP:.el=.elc) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_CLEAN_FILES = sdic.el sample.emacs LISP = $(lisp_LISP) DIST_COMMON = Makefile.am Makefile.in elisp-comp sample.emacs.in \ sdic.el.in DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) TAR = tar GZIP_ENV = --best all: all-redirect .SUFFIXES: .SUFFIXES: .el .elc $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps lisp/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status sdic.el: $(top_builddir)/config.status sdic.el.in cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status sample.emacs: $(top_builddir)/config.status sample.emacs.in cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status install-lispLISP: $(lisp_LISP) $(ELCFILES) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(lispdir) @list='$(lisp_LISP)'; for p in $$list; do \ if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \ echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(lispdir)/$$p"; \ $(INSTALL_DATA) $$d$$p $(DESTDIR)$(lispdir)/$$p; \ if test -f $${p}c; then \ echo " $(INSTALL_DATA) $${p}c $(DESTDIR)$(lispdir)/$${p}c"; \ $(INSTALL_DATA) $${p}c $(DESTDIR)$(lispdir)/$${p}c; \ else : ; fi; \ done uninstall-lispLISP: @$(NORMAL_UNINSTALL) list='$(lisp_LISP)'; for p in $$list; do \ rm -f $(lispdir)/$$p $(DESTDIR)$(lispdir)/$${p}c; \ done .el.elc: @echo 'WARNING: Warnings can be ignored. :-)' if test $(EMACS) != no; then \ EMACS=$(EMACS) $(SHELL) $(srcdir)/elisp-comp $<; \ fi mostlyclean-lisp: clean-lisp: -test -z "$(ELCFILES)" || rm -f $(ELCFILES) distclean-lisp: maintainer-clean-lisp: tags: TAGS TAGS: distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) subdir = lisp distdir: $(DISTFILES) @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ || cp -p $$d/$$file $(distdir)/$$file || :; \ fi; \ done info-am: info: info-am dvi-am: dvi: dvi-am check-am: all-am check: check-am installcheck-am: installcheck: installcheck-am install-exec-am: install-exec: install-exec-am install-data-am: install-lispLISP install-data: install-data-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-am uninstall-am: uninstall-lispLISP uninstall: uninstall-am all-am: Makefile $(LISP) $(ELCFILES) all-redirect: all-am install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: $(mkinstalldirs) $(DESTDIR)$(lispdir) mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) -rm -f config.cache config.log stamp-h stamp-h[0-9]* -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: mostlyclean-am: mostlyclean-lisp mostlyclean-generic mostlyclean: mostlyclean-am clean-am: clean-lisp clean-generic mostlyclean-am clean: clean-am distclean-am: distclean-lisp distclean-generic clean-am distclean: distclean-am maintainer-clean-am: maintainer-clean-lisp maintainer-clean-generic \ distclean-am @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." maintainer-clean: maintainer-clean-am .PHONY: uninstall-lispLISP install-lispLISP mostlyclean-lisp \ distclean-lisp clean-lisp maintainer-clean-lisp tags distdir info-am \ info dvi-am dvi check check-am installcheck-am installcheck \ install-exec-am install-exec install-data-am install-data install-am \ install uninstall-am uninstall all-redirect all-am all installdirs \ mostlyclean-generic distclean-generic clean-generic \ maintainer-clean-generic clean mostlyclean distclean maintainer-clean $(ELCFILES): $(lisp_LISP) $(EMACS) -batch -q -no-site-file -l elisp-comp -f batch-byte-compile $(lisp_LISP) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: sdic-2.1.3/lisp/Makefile.am0000644000175000017500000000053006744566147011144 # -*- Makefile -*- SOURCES = sdicf.el sdicf-client.el sdic-compat.el sdic-gene.el stem.el EXTRA_DIST = sdic.el.in DISTCLEANFILES = sdic.el lisp_LISP = $(SOURCES) sdic.el # sdic.el must be in this ELCFILES = $(lisp_LISP:.el=.elc) $(ELCFILES): $(lisp_LISP) $(EMACS) -batch -q -no-site-file -l elisp-comp -f batch-byte-compile $(lisp_LISP) sdic-2.1.3/lisp/elisp-comp0000755000175000017500000000041106746033040011063 ;;; -*- Emacs-Lisp -*- (and (boundp 'emacs-major-version) (>= emacs-major-version 20) (fboundp 'set-language-environment) (set-language-environment "Japanese")) (setq load-path (cons default-directory load-path)) (load "sdic.el") (require 'sdicf) sdic-2.1.3/lisp/sample.emacs.in0000644000175000017500000000050706743537561012011 ;;; sdic-mode 用の設定 (setq load-path (cons "@lispdir@" load-path)) (autoload 'sdic-describe-word "sdic" "英単語の意味を調べる" t nil) (global-set-key "\C-cw" 'sdic-describe-word) (autoload 'sdic-describe-word-at-point "sdic" "カーソルの位置の英単語の意味を調べる" t nil) (global-set-key "\C-cW" 'sdic-describe-word-at-point) sdic-2.1.3/lisp/sdic.el.in0000444000175000017500000010060207510305732010737 ;; sdic.el ---- -*- Emacs-Lisp -*- Program to view dictionary. ;; $Id: sdic.el.in,v 2.27 2002/07/02 11:17:46 tsuchiya Exp $ ;; Copyright (C) 1998,99 TSUCHIYA Masatoshi ;; Author: TSUCHIYA Masatoshi ;; Keywords: dictionary ;; SDIC is free software; you can redistribute it and/or modify it ;; under the terms of the GNU General Public License as published by ;; the Free Software Foundation; either version 2 of the License, or ;; (at your option) any later version. ;; SDIC is distributed in the hope that it will be useful, but ;; WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with SDIC; if not, write to the Free Software Foundation, ;; Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ;;; Commentary: ;; 英和/和英辞書を閲覧する目的で作成した major mode です。 ;; 利用及び再配布の際は、GNU 一般公用許諾書の適当なバージョンにしたがっ ;; て下さい。 ;; 一次配布元 ;; http://namazu.org/~tsuchiya/sdic/ ;;; Install: ;; (1) sdic.el, sdicf.el, sdicf-client.el, sdic-compat.el, sdic-gene.el ;; と stem.el を適当な場所に保存して、必要ならバイトコンパイルして ;; 下さい。 ;; ;; ;; (2) sdicf-client.el, sdic-compat.el, sdic-gene.el は辞書を検索する ;; ためのライブラリです。これらのライブラリのどれかを使って辞書を ;; 検索できるようにして下さい。詳細については、README とそれぞれの ;; ソースファイルを参照。 ;; ;; ;; (3) 使えるようにした辞書のリストを、sdic-eiwa-dictionary-list およ ;; び sdic-waei-dictionary-list に設定します。例えば、英和辞書 ;; /usr/dict/gene.sdic を sdicf-client.el を使って検索する場合は次 ;; のようになります。 ;; ;; (setq sdic-eiwa-dictionary-list '((sdicf-client "/usr/dict/gene.sdic"))) ;; ;; 複数の辞書を同時に検索することも出来ます。 ;; ;; (setq sdic-waei-dictionary-list '((sdicf-client "~/data/jedict.sdic") ;; (sdic-compat "/usr/dict/jgene.dic"))) ;; ;; 辞書を利用しない場合は nil を代入して下さい。また、これらの設定 ;; は ~/.emacs などの適切な場所に書き込んで下さい。 ;; ;; ;; (4) ~/.emacs に次のようなコードを挿入します。 ;; ;; (autoload 'sdic-describe-word "sdic" "英単語の意味を調べる" t nil) ;; (global-set-key "\C-cw" 'sdic-describe-word) ;; ;; 好みに合わせて適当にキーバインドは変更して下さい。 ;;; Note: ;; 検索結果の表示の仕方や動作を制御する変数があります。詳細については、 ;; 下の source を参照して下さい。 ;; ;; grep / array などの外部コマンドを利用して辞書検索する場合は、それら ;; の外部コマンドが対応している漢字コードを設定して、辞書もその漢字コー ;; ドに合わせる必要があります。その場合、日本語 EUC がおそらく一番安全 ;; でしょう。 ;; ;; Emacs20 または XEmacs で使用する場合は、 ;; ;; (set-language-environment "Japanese") ;; ;; と .emacs に設定されているか確認してください。 (provide 'sdic) (require 'sdicf) (require 'stem) ;;;---------------------------------------------------------------------- ;;; カスタマイズ用変数 ;;;---------------------------------------------------------------------- (defvar sdic-left-margin 2 "*Left margin of contents. 説明文の左側の余白幅") (defvar sdic-fill-column default-fill-column "*Right edge of contents. 説明文を整形する幅") (defvar sdic-window-height 10 "*Height of window to show entrys and contents. 検索結果表示ウインドウの高さ") (defvar sdic-warning-hidden-entry t "*If non-nil, warning of hidden entries is enable. nil 以外が設定されている場合、検索結果表示ウインドウに表示しきれなかった情報があれば警告する") (defvar sdic-disable-select-window nil "*Option to disable to select other window. 検索結果表示ウインドウにカーソルを移動しないようにする場合は nil 以外を設定する") (defvar sdic-face-style 'bold "*Style of entry. 見出し語を表示するために使う装飾形式") (defvar sdic-face-color nil "*Color of entry. 見出し語を表示するために使う色") (defvar sdic-disable-vi-key nil "*Option to disable some key. 辞書閲覧に vi ライクのキーを使わない場合は nil 以外を設定する") (defvar sdic-eiwa-dictionary-list (delq nil (mapcar (lambda (file) (and (file-readable-p (expand-file-name file)) (list (if (string-match "\\.sdic$" file) 'sdicf-client (if (and (require 'sdic-compat) (sdic-compat-available-p)) 'sdic-compat 'sdic-gene)) file))) '(@EIWA_DICT_LIST@))) "\ *Options of an English-Japanese dictionary. 英和辞典の検索メソッドのリストを指定する変数") (defvar sdic-waei-dictionary-list (delq nil (mapcar (lambda (file) (and (file-readable-p (expand-file-name file)) (list (if (string-match "\\.sdic$" file) 'sdicf-client (if (and (require 'sdic-compat) (sdic-compat-available-p)) 'sdic-compat 'sdic-gene)) file))) '(@WAEI_DICT_LIST@))) "\ *Options of an English-Japanese dictionary. 和英辞典の検索メソッドのリストを指定する変数") (defvar sdic-default-coding-system (if (>= emacs-major-version 20) (if (string-match "XEmacs" emacs-version) (cond ((member 'euc-japan-unix (coding-system-list)) 'euc-japan-unix) ((member 'euc-jp-unix (coding-system-list)) 'euc-jp-unix) (t 'euc-japan)) 'euc-japan-unix) *euc-japan*unix) "*Default coding-system for sdic and libraries.") ;;;---------------------------------------------------------------------- ;;; 内部変数 ;;;---------------------------------------------------------------------- (defvar sdic-english-prep-list '("at" "by" "for" "in" "on" "of" "with" "as" "before" "after") "\ List of English prepositions 英語の前置詞のリスト") (defvar sdic-english-prep-regexp (format "\\(%s\\)\\b" (mapconcat 'regexp-quote sdic-english-prep-list "\\|")) "\ Regexp of Englist prepositions 英語の前置詞とマッチする正規表現") (defvar sdic-eiwa-symbol-list nil "英和辞典のシンボル") (defvar sdic-waei-symbol-list nil "和英辞典のシンボル") (defvar sdic-buffer-start-point nil "検索結果表示バッファの表示開始ポイント") (defvar sdic-mode-map nil "Keymap of sdic-mode") (defvar sdic-kinsoku-bol-list (funcall (if (fboundp 'string-to-char-list) 'string-to-char-list 'string-to-list) "!)-_~}]:;',.?、。,.・:;?!゛゜´`¨^ ̄_ヽヾゝゞ〃仝々〆〇ー―‐/\〜‖|…‥’”)〕]}〉》」』】°′″℃ぁぃぅぇぉっゃゅょゎァィゥェォッャュョヮヵヶ") "行頭禁則文字のリスト") (defvar sdic-kinsoku-eol-list (funcall (if (fboundp 'string-to-char-list) 'string-to-char-list 'string-to-list) "({[`‘“(〔[{〈《「『【°′″§") "行末禁則文字のリスト") (defvar sdic-kinsoku-spc-list (funcall (if (fboundp 'string-to-char-list) 'string-to-char-list 'string-to-list) "\t  ") "空白文字のリスト") (defconst sdic-version "@VERSION@") (defconst sdic-buffer-name "*sdic*" "検索結果表示バッファの名前") (defconst sdic-mode-name "SDIC" "検索結果を表示するバッファの major mode") ;;;---------------------------------------------------------------------- ;;; 検索メソッドを呼び出す関数 ;;;---------------------------------------------------------------------- (defun sdic-init-dictionary (option-list) "\ Function to initialize dictionary. 指定された辞書と関連付けられている検索ライブラリを初期化する関数" (let (dic) (and option-list (listp option-list) (require (car option-list)) (setq dic (apply (get (car option-list) 'init-dictionary) (cdr option-list))) (sdic-dictionary-symbol-p dic) (put dic 'search-method (car option-list)) dic))) (defun sdic-open-dictionary (dic) "\ Function to open dictionary. 指定された辞書を検索できるようにする関数" (and (sdic-dictionary-symbol-p dic) (funcall (get (get dic 'search-method) 'open-dictionary) dic))) (defun sdic-close-dictionary (dic) "\ Function to close dictionary. 指定された辞書と関連付けられている検索ライブラリを終了する関数" (and (sdic-dictionary-symbol-p dic) (funcall (get (get dic 'search-method) 'close-dictionary) dic))) (defun sdic-search-entry (dic word &optional search-type) "\ Function to search word in dictionary. 指定された辞書を検索する関数 見出し語、辞書シンボル、見出し語のIDからなる配列を要素とする配列を返す。" (mapcar (lambda (c) (list (car c) dic (cdr c))) (funcall (get (get dic 'search-method) 'search-entry) dic word search-type))) (defsubst sdic-replace-string (string from to) "\ 文字列 STRING に含まれている文字列 FROM を全て文字列 TO に置換した文字列を返す FROM には正規表現を含む文字列を指定できるが、TO は固定文字列しか指定できない。" (let ((start 0) list) (while (string-match from string start) (setq list (cons to (cons (substring string start (match-beginning 0)) list)) start (match-end 0))) (eval (cons 'concat (nreverse (cons (substring string start) list)))))) (defun sdic-sort-dictionary-order (entry-list) "\ Function to sort entry list in dictionary order. 見出し語、辞書シンボル、見出し語のIDからなる配列を要素とする配列 ENTRY-LIST を、見出し語の辞書順に並べ替える関数。" (mapcar 'cdr (sort (mapcar (lambda (entry) (if (string-match "\\Ca" (car entry)) (cons (concat (car entry) "\^@") entry) (cons (concat (sdic-replace-string (downcase (car entry)) "[^A-z0-9]+" " ") "\^@" (car entry) "\^@") entry))) entry-list) (lambda (a b) (string< (car a) (car b)))))) (defun sdic-search-multi-dictionaries (dic-list word &optional search-type) "\ Function to search word in multi dictionaries. 指定されている複数の辞書を串刺検索する関数 見出し語、辞書シンボル、見出し語のIDからなる配列を要素とする配列を返す。" (sdic-sort-dictionary-order (apply 'append (mapcar (lambda (dic) (sdic-search-entry dic word search-type)) dic-list)))) (defun sdic-get-content (dic id) "\ Function to get content. 指定されている辞書から定義文を読み出す関数" (funcall (get (get dic 'search-method) 'get-content) dic id)) (defun sdic-make-dictionary-symbol () (make-symbol "sdic-dictionary")) (defun sdic-dictionary-symbol-p (symbol) (equal (symbol-name symbol) "sdic-dictionary")) ;;;---------------------------------------------------------------------- ;;; 内部関数 ;;;---------------------------------------------------------------------- (defun sdic-insert-content (word content) "見出し語と説明文を整形しながら挿入する" (sdic-overlay-put (sdic-make-overlay (point) (progn (insert word) (point))) 'face 'sdic-face) (let ((spc (make-string left-margin ?\ )) top buf (pos 0)) (insert "\n" spc) (setq top (point)) (while (string-match ",\\([^ ]\\)" content pos) (setq buf (cons ", " (cons (substring content pos (match-beginning 0)) buf)) pos (match-beginning 1))) (setq content (eval (cons 'concat (nreverse (if (< pos (length content)) (cons (substring content pos) buf) buf)))) buf nil pos 0) (while (string-match "[^ 0-9]\\(/\\)[^ 0-9]" content pos) (setq buf (cons " / " (cons (substring content pos (match-beginning 1)) buf)) pos (match-end 1))) (eval (cons 'insert (nreverse (if (< pos (length content)) (cons (substring content pos) buf) buf)))) (insert "\n") (forward-char -1) (while (if (>= (move-to-column fill-column) fill-column) (not (progn (if (memq (preceding-char) sdic-kinsoku-eol-list) (progn (forward-char -1) (while (memq (preceding-char) sdic-kinsoku-eol-list) (forward-char -1)) (insert "\n" spc)) (while (memq (setq buf (following-char)) sdic-kinsoku-bol-list) (forward-char)) (if (memq buf sdic-kinsoku-spc-list) (delete-region (point) (progn (forward-char) (while (memq (following-char) sdic-kinsoku-spc-list) (forward-char)) (point))) (or (> (char-width buf) 1) (re-search-backward "\\<" top t) (end-of-line))) (or (eolp) (insert "\n" spc)))))) (setq top (point))) (forward-char))) (defun sdic-insert-entry-list (entry-list) "見出し語と説明文を整形しながら挿入する" (mapcar (lambda (entry) (sdic-insert-content (car entry) (sdic-get-content (nth 1 entry) (nth 2 entry))) (car entry)) entry-list)) ;; 検索形式を判別するマクロ (put 'sdic-decide-query-type 'lisp-indent-function 2) (defmacro sdic-decide-query-type (dic-list query &rest sexp) "\ QUERY から検索形式を判定して複数の辞書 DIC-LIST を検索するマクロ QUERY に検索形式を指定する構造が含まれていない場合は、default の動作と して SEXP を評価する。通常の検索の場合は、検索された見出し語のリストを 返す。" (` (cond ;; 検索語が '' で囲まれている場合 -> 完全一致検索 ((and (equal ?' (string-to-char (, query))) (equal "'" (substring (, query) -1))) (sdic-insert-entry-list (sdic-search-multi-dictionaries (, dic-list) (substring (, query) 1 -1) 'lambda))) ;; 検索語の先頭に / がある場合 -> 全文検索 ((equal ?/ (string-to-char (, query))) (sdic-insert-entry-list (sdic-search-multi-dictionaries (, dic-list) (substring (, query) 1) 0))) ;; 検索語の先頭に * がある場合 -> 後方一致検索 ((equal ?* (string-to-char (, query))) (sdic-insert-entry-list (sdic-search-multi-dictionaries (, dic-list) (substring (, query) 1) t))) ;; 検索語の末尾に * がある場合 -> 前方一致検索 ((equal "*" (substring (, query) -1)) (sdic-insert-entry-list (sdic-search-multi-dictionaries (, dic-list) (substring (, query) 0 -1)))) ;; 特に指定がない場合 -> 指定された S 式を評価 (t (,@ sexp))))) ;; 英和辞典を検索する関数 (defun sdic-search-eiwa-dictionary (query) (sdic-decide-query-type sdic-eiwa-symbol-list query (let (word-list stem-list orig pat point str) (setq word-list (sdic-split-string (downcase query))) (prog1 (mapcar (lambda (entry) (and (not point) (string-match pat (car entry)) (setq point (point) str (car entry))) (sdic-insert-content (car entry) (sdic-get-content (nth 1 entry) (nth 2 entry))) (car entry)) (prog1 (or ;; (1) 不規則変化動詞を検索する (and (setq stem-list (copy-sequence (assoc (car word-list) stem:irregular-verb-alist)) pat nil) (setq stem-list (delq t (mapcar (lambda (w) (or (equal w pat) (setq pat w))) stem-list))) (sdic-sort-dictionary-order (apply 'append (mapcar (lambda (word) (setq pat (format "^\\(%s$\\|%s \\)" (regexp-quote word) (regexp-quote word))) (delq nil (mapcar (lambda (entry) (and (string-match pat (car entry)) (or orig (setq orig word)) entry)) (apply 'append (mapcar (lambda (dic) (sdic-search-entry dic word)) sdic-eiwa-symbol-list))))) stem-list)))) ;; (2) 不規則変化動詞を無視した stemming を行なって検索する (progn (setq stem-list (let ((stem:irregular-verb-alist nil)) (stem:stripping-suffix (car word-list)))) (if (> (length (car word-list)) 1) (setq stem-list (delq t (mapcar (lambda (w) (or (= (length w) 1) w)) stem-list)))) ;; 最長部分列を求める (setq pat (let* ((w1 (car stem-list)) (w2 (nth (1- (length stem-list)) stem-list)) (i (min (length w1) (length w2)))) (while (not (string= (substring w1 0 i) (substring w2 0 i))) (setq i (1- i))) (substring w1 0 i))) (delq nil (mapcar (lambda (entry) (if (string-match pat (car entry)) entry)) (prog1 (mapcar (lambda (entry) ;; 検索結果から原形と推定される見出し語を検索 (setq str (downcase (car entry))) (and (member str stem-list) (not (member str orig)) (setq orig (cons str orig))) entry) (or (and (= (length stem-list) 1) (string= pat (car word-list)) (< (length pat) 4) (append (sdic-search-multi-dictionaries sdic-eiwa-symbol-list pat 'lambda) (sdic-search-multi-dictionaries sdic-eiwa-symbol-list (concat pat " ")))) (sdic-search-multi-dictionaries sdic-eiwa-symbol-list pat))) (if orig (setq stem-list (copy-sequence orig) orig (if (member (car word-list) orig) (car word-list) (car (sort orig (lambda (a b) (> (length a) (length b)))))) pat (format "^\\(%s\\)" (mapconcat (lambda (w) (format "%s$\\|%s " (regexp-quote w) (regexp-quote w))) stem-list "\\|"))) (setq orig pat pat (concat "^" (regexp-quote pat))) (message "Can't find original form of \"%s\"" (car word-list)) )))))) (setq pat (if (nth 1 word-list) (concat "^\\(" (mapconcat (lambda (w) (format "%s +%s$\\|%s +%s " (regexp-quote w) (regexp-quote (nth 1 word-list)) (regexp-quote w) (regexp-quote (nth 1 word-list)))) stem-list "\\|") (if (string= orig (car word-list)) "\\)" (format "\\|%s\\)" (regexp-quote orig)))) (format "^%s$" (regexp-quote orig)))))) (setq sdic-buffer-start-point (if point (progn (setq word-list (sdic-split-string query) orig (car word-list)) (if (and (not (string= str orig)) (string= orig (downcase orig)) (let ((case-fold-search nil)) (goto-char point) (setq pat (regexp-quote (car (sdic-split-string query)))) (search-forward-regexp (format "^\\(%s \\|%s$\\)" pat pat) nil t))) (match-beginning 0) point)) (point-min))))))) ;; 和英辞典を検索する関数 (defun sdic-search-waei-dictionary (query) (sdic-decide-query-type sdic-waei-symbol-list query ;; 特に指定がない場合 -> 前方一致検索 (sdic-insert-entry-list (sdic-search-multi-dictionaries sdic-waei-symbol-list query)))) ;;;---------------------------------------------------------------------- ;;; 本体 ;;;---------------------------------------------------------------------- (defun sdic-version () "\ SDIC のバージョンを返す関数" (interactive) (message "SDIC %s" sdic-version)) (defun sdic-word-at-point () "\ カーソル位置の単語を返す関数" (save-excursion (if (not (looking-at "\\<")) (forward-word -1)) (if (looking-at sdic-english-prep-regexp) (let ((strs (sdic-split-string (sdic-buffer-substring-no-properties (progn (forward-word -1) (point)) (progn (forward-word 2) (point)))))) (if (string-match "\\cj" (car strs)) (car (cdr strs)) (concat (car strs) " " (car (cdr strs))))) (sdic-buffer-substring-no-properties (point) (progn (forward-word 1) (point)))))) (defvar sdic-read-minibuffer-history '() "\ sdic-read-from-minibuffer 関数のヒストリ") (defun sdic-read-from-minibuffer (&optional init pre-prompt) "ミニバッファから単語を読みとる" (let ((w (or init (sdic-word-at-point) ""))) (setq sdic-read-minibuffer-history (cons w sdic-read-minibuffer-history) w (read-from-minibuffer (if pre-prompt (format "%s Input word : " pre-prompt) "Input word : ") w nil nil '(sdic-read-minibuffer-history . 1))) (if (>= (length w) 2) w (read-from-minibuffer (format "\"%s\" is too short. Input word again : " w) w nil nil '(sdic-read-minibuffer-history . 1))))) (defun sdic-select-search-function () "検索関数を選ぶ" (message "辞書を選んで下さい: E)英和 J)和英") (let ((sw (selected-window)) (c (read-char))) (select-window sw) (cond ((or (= c ?e) (= c ?E)) 'sdic-search-eiwa-dictionary) ((or (= c ?j) (= c ?J)) 'sdic-search-waei-dictionary) (t (sdic-select-search-function))))) ;; 単語を辞書で調べる関数 (defun sdic-describe-word (word &optional search-function) "Display the meaning of word." (interactive (let ((f (if current-prefix-arg (sdic-select-search-function))) (w (sdic-read-from-minibuffer))) (list w f))) (set-buffer (get-buffer-create sdic-buffer-name)) (or (string= mode-name sdic-mode-name) (sdic-mode)) (setq buffer-read-only nil) (erase-buffer) (let ((case-fold-search t) (sdic-buffer-start-point (point-min))) (if (prog1 (funcall (or search-function (if (string-match "\\cj" word) 'sdic-search-waei-dictionary 'sdic-search-eiwa-dictionary)) word) (setq buffer-read-only t) (set-buffer-modified-p nil)) (sdic-display-buffer sdic-buffer-start-point) (message "Can't find word, \"%s\"." word) nil))) ;; 主関数の宣言 (defalias 'sdic 'sdic-describe-word) (defun sdic-describe-region (start end &optional search-function) "Display the meaning of pattern." (interactive (list (region-beginning) (region-end) (if current-prefix-arg (sdic-select-search-function)))) (sdic-describe-word (buffer-substring start end) search-function)) (defun sdic-describe-word-at-point (&optional search-function) "Display the meaning of word at point in Japanese." (interactive (list (if current-prefix-arg (sdic-select-search-function)))) (let ((orig-table (copy-syntax-table)) word) (unwind-protect (progn (modify-syntax-entry ?* "w") (modify-syntax-entry ?' "w") (modify-syntax-entry ?/ "w") (setq word (or (sdic-word-at-point) (sdic-read-from-minibuffer)))) (set-syntax-table orig-table)) (or (sdic-describe-word word search-function) (sdic-describe-word (sdic-read-from-minibuffer word (format "Can't find word \"%s\"." word)) search-function)))) ;;; 次の項目に移動する関数 (defun sdic-forward-item () "Move point to the next item." (interactive) (let ((o)) (goto-char (sdic-next-overlay-change (if (setq o (car (sdic-overlays-at (point)))) (sdic-overlay-end o) (point)))))) ;;; 前の項目に移動する関数 (defun sdic-backward-item () "Move point to the previous item." (interactive) (let ((o)) (goto-char (sdic-previous-overlay-change (sdic-previous-overlay-change (if (setq o (car (sdic-overlays-at (point)))) (sdic-overlay-start o) (sdic-previous-overlay-change (sdic-previous-overlay-change (point))))))))) (defun sdic-goto-point-min () "\ バッファの先頭に移動する関数" (interactive) (goto-char (point-min))) (defun sdic-goto-point-max () "\ バッファの末尾に移動する関数" (interactive) (goto-char (point-max))) (defun sdic-display-buffer (&optional start-point) "\ 検索結果表示バッファを表示する関数" (let ((old-buffer (current-buffer))) (unwind-protect (let* ((buf (set-buffer sdic-buffer-name)) (w1 (selected-window)) (w2 (get-buffer-window buf)) (p (or start-point (point))) (h sdic-window-height)) (if w2 (progn (select-window w2) (setq h (window-height w2))) (setq w2 (select-window (if (one-window-p) (split-window w1 (- (window-height) h)) (next-window)))) (set-window-buffer w2 buf)) (set-window-start w2 p) (and sdic-warning-hidden-entry (> p (point-min)) (message "この前にもエントリがあります。")) (goto-char p) (if sdic-disable-select-window (select-window w1)) (buffer-size)) (set-buffer old-buffer)))) (defun sdic-other-window () "\ 検索表示バッファから元のバッファに戻る関数" (interactive) (let ((w (selected-window))) (if (and (string= (buffer-name (window-buffer w)) sdic-buffer-name) (one-window-p)) (progn (split-window w (- (window-height) sdic-window-height)) (set-window-buffer w (other-buffer))) (other-window -1)))) (defun sdic-close-window () "\ 検索表示バッファを表示しているウインドウを消去する関数" (interactive) (let ((w (get-buffer-window sdic-buffer-name)) (b (get-buffer sdic-buffer-name))) (if w (progn (bury-buffer b) (if (= (window-height w) sdic-window-height) (delete-window w) (set-window-buffer w (other-buffer)) (select-window (next-window))) )))) (defun sdic-exit () "\ 検索結果表示バッファを削除する関数" (interactive) (if (sdicf-buffer-live-p (get-buffer sdic-buffer-name)) (progn (sdic-close-window) (kill-buffer sdic-buffer-name))) (mapcar 'sdic-close-dictionary sdic-eiwa-symbol-list) (mapcar 'sdic-close-dictionary sdic-waei-symbol-list) (setq sdic-eiwa-symbol-list nil sdic-waei-symbol-list nil)) ;;; 辞書を閲覧する major-mode (defun sdic-mode () "\ 辞書を閲覧するメジャーモード 次のような形式の文字列を入力することによって検索方式を指定できます。 'word' 完全一致検索 word* 前方一致検索 *word 後方一致検索 /word 全文検索 これら以外の場合は、通常のキーワード検索を行います。 key binding --- ------- w 単語を検索する ' 完全一致検索をする ^ 前方一致検索をする $ 後方一致検索をする / 全文検索をする W 辞書を指定して検索する SPC スクロールアップ b スクロールダウン ( BS / Delete キーも使えます ) n 次の項目 TAB 次の項目 p 前の項目 M-TAB 前の項目 o 辞書を閲覧しているウインドウから他のウインドウに移る q 辞書を閲覧しているウインドウを消す Q SDIC を終了する < バッファの先頭に移動 > バッファの終端に移動 ? ヘルプ表示 " (kill-all-local-variables) (make-local-variable 'fill-column) (setq major-mode 'sdic-mode mode-name sdic-mode-name fill-column sdic-fill-column left-margin sdic-left-margin sdic-mode-map (make-keymap)) ;; キーバインドの設定 (define-key sdic-mode-map " " 'scroll-up) (define-key sdic-mode-map "b" 'scroll-down) (define-key sdic-mode-map [backspace] 'scroll-down) (define-key sdic-mode-map [delete] 'scroll-down) (define-key sdic-mode-map "\C-?" 'scroll-down) (define-key sdic-mode-map "n" 'sdic-forward-item) (define-key sdic-mode-map "\t" 'sdic-forward-item) (define-key sdic-mode-map "p" 'sdic-backward-item) (define-key sdic-mode-map "\M-\t" 'sdic-backward-item) (define-key sdic-mode-map "o" 'sdic-other-window) (define-key sdic-mode-map "q" 'sdic-close-window) (define-key sdic-mode-map "Q" 'sdic-exit) (define-key sdic-mode-map "w" 'sdic-describe-word) (define-key sdic-mode-map "W" (lambda () (interactive) (let ((f (sdic-select-search-function))) (sdic-describe-word (sdic-read-from-minibuffer) f)))) (define-key sdic-mode-map "/" (lambda () (interactive) (sdic-describe-word (sdic-read-from-minibuffer (concat "/" (sdic-word-at-point)))))) (define-key sdic-mode-map "^" (lambda () (interactive) (sdic-describe-word (sdic-read-from-minibuffer (concat (sdic-word-at-point) "*"))))) (define-key sdic-mode-map "$" (lambda () (interactive) (sdic-describe-word (sdic-read-from-minibuffer (concat "*" (sdic-word-at-point)))))) (define-key sdic-mode-map "'" (lambda () (interactive) (sdic-describe-word (sdic-read-from-minibuffer (concat "'" (sdic-word-at-point) "'"))))) (define-key sdic-mode-map "<" 'sdic-goto-point-min) (define-key sdic-mode-map ">" 'sdic-goto-point-max) (define-key sdic-mode-map "?" 'describe-mode) (cond ((not sdic-disable-vi-key) (define-key sdic-mode-map "h" 'backward-char) (define-key sdic-mode-map "j" 'next-line) (define-key sdic-mode-map "k" 'previous-line) (define-key sdic-mode-map "l" 'forward-char))) (use-local-map sdic-mode-map) ;; 見出し語の face の設定 (make-face 'sdic-face) (and (or (not (fboundp 'facep)) (facep sdic-face-style)) (copy-face sdic-face-style 'sdic-face)) (and window-system sdic-face-color (set-face-foreground 'sdic-face sdic-face-color)) ;; それぞれの辞書を初期化する (or sdic-eiwa-symbol-list (setq sdic-eiwa-symbol-list (delq nil (mapcar 'sdic-init-dictionary sdic-eiwa-dictionary-list)))) (setq sdic-eiwa-symbol-list (delq nil (mapcar 'sdic-open-dictionary sdic-eiwa-symbol-list))) (or sdic-waei-symbol-list (setq sdic-waei-symbol-list (delq nil (mapcar 'sdic-init-dictionary sdic-waei-dictionary-list)))) (setq sdic-waei-symbol-list (delq nil (mapcar 'sdic-open-dictionary sdic-waei-symbol-list))) (run-hooks 'sdic-mode-hook)) ;;;---------------------------------------------------------------------- ;;; 各種 Emacsen の違いを吸収する関数 ;;;---------------------------------------------------------------------- (if (fboundp 'next-overlay-change) (defalias 'sdic-next-overlay-change 'next-overlay-change) ;; XEmacs の場合 (defun sdic-next-overlay-change (pos) "\ Return the next position after POS where an extent starts or ends. If there are no more extent boundaries after POS, return (point-max)." (catch 'found-next-extent (mapcar (lambda (ext) (cond ((> (extent-start-position ext) pos) (throw 'found-next-extent (extent-start-position ext))) ((> (extent-end-position ext) pos) (throw 'found-next-extent (extent-end-position ext))) )) (extent-list)) (point-max)))) (if (fboundp 'previous-overlay-change) (defalias 'sdic-previous-overlay-change 'previous-overlay-change) (if (fboundp 'extent-list) ;; XEmacs の場合 (defun sdic-previous-overlay-change (pos) "\ Return the previous position before POS where an extent starts or ends. If there are no more extent boundaries before POS, return (point-min)." (catch 'found-previous-extent (mapcar (lambda (ext) (cond ((< (extent-end-position ext) pos) (throw 'found-previous-extent (extent-end-position ext))) ((< (extent-start-position ext) pos) (throw 'found-previous-extent (extent-start-position ext))) )) (reverse (extent-list))) (point-min))) ;; Emacs 19.34 以前の場合 (defun sdic-previous-overlay-change (pos) "\ Return the previous position before POS where an overlay starts or ends. If there are no more overlay boundaries before POS, return (point-min)." (if (> pos (point-max)) (error "Specified position is larger than point-max")) (save-excursion (let (next (prev (point-min))) (while (> pos (setq next (sdic-next-overlay-change prev))) (setq prev next)) prev))))) (if (fboundp 'overlays-at) (defalias 'sdic-overlays-at 'overlays-at) (defun sdic-overlays-at (pos) "\ Return a list of the extents that contain position POS." (delq nil (mapcar (lambda (ext) (and (<= (extent-start-position ext) pos) (> (extent-end-position ext) pos) ext)) (extent-list))))) (if (fboundp 'overlay-put) (defalias 'sdic-overlay-put 'overlay-put) (defalias 'sdic-overlay-put 'set-extent-property)) (if (fboundp 'make-overlay) (defalias 'sdic-make-overlay 'make-overlay) (defalias 'sdic-make-overlay 'make-extent)) (if (fboundp 'overlay-start) (defalias 'sdic-overlay-start 'overlay-start) (defalias 'sdic-overlay-start 'extent-start-position)) (if (fboundp 'overlay-end) (defalias 'sdic-overlay-end 'overlay-end) (defalias 'sdic-overlay-end 'extent-end-position)) (if (fboundp 'match-string) (defalias 'sdic-match-string 'match-string) ;; Introduced in Emacs 19.29. (defun sdic-match-string (num &optional string) "\ Return string of text matched by last search. NUM specifies which parenthesized expression in the last regexp. Value is nil if NUMth pair didn't match, or there were less than NUM pairs. Zero means the entire text matched by the whole regexp or whole string. STRING should be given if the last search was by `string-match' on STRING." (if (match-beginning num) (if string (substring string (match-beginning num) (match-end num)) (buffer-substring (match-beginning num) (match-end num)))))) (defun sdic-split-string (string &optional separators) "\ Splits STRING into substrings where there are matches for SEPARATORS. Each match for SEPARATORS is a splitting point. The substrings between the splitting points are made into a list which is returned. If SEPARATORS is absent, it defaults to \"[ \\f\\t\\n\\r\\v]+\". If there is match for SEPARATORS at the beginning of STRING, we do not include a null substring for that. Likewise, if there is a match at the end of STRING, we don't include a null substring for that." (or separators (setq separators "[ \f\t\n\r\v]+")) (let (list (start 0)) (while (string-match separators string start) (or (= start (match-beginning 0)) (setq list (cons (substring string start (match-beginning 0)) list))) (setq start (match-end 0))) (nreverse (if (= start (length string)) list (cons (substring string start) list))))) (if (fboundp 'buffer-substring-no-properties) (defalias 'sdic-buffer-substring-no-properties 'buffer-substring-no-properties) (defun sdic-buffer-substring-no-properties (start end) "\ Return the characters of part of the buffer, without the text properties. The two arguments START and END are character positions; they can be in either order. [Emacs 19.29 emulating function]" (let ((string (buffer-substring start end))) (set-text-properties 0 (length string) nil string) string))) sdic-2.1.3/lisp/sdicf.el0000444000175000017500000005064107510305732010507 ;;; sdicf.el --- Search library for SDIC format dictionary ;;; $Id: sdicf.el,v 1.20 2002/07/02 11:17:46 tsuchiya Exp $ ;; Copyright (C) 1999 TSUCHIYA Masatoshi ;; Author: TSUCHIYA Masatoshi ;; NISHIDA Keisuke ;; Created: 1 Feb 1999 ;; Version: 0.9 ;; Keywords: dictionary ;; This program is free software; you can redistribute it and/or ;; modify it under the terms of the GNU General Public License ;; as published by the Free Software Foundation; either version 2 ;; of the License, or (at your option) any later version. ;; This program is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with this program; if not, write to the Free Software ;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ;;; Commentary: ;; $B$3$l$O!"(BSDIC$B7A<0<-=q$r8!:w$9$k$?$a$N%i%$%V%i%j$G$9!#$l$N4X?t$N>\:Y$O!"4X?t$N@bL@J8;zNs$K5-=R$5$l$F$$$^$9!#(B ;;; Note: ;; * GNU Emacs 19.30 $B0J9_$G$"$l$P!"(B`auto-compression-mode' $B$rM-8z$K$9$k(B ;; $B$3$H$G!"(B`direct' $BJ}<0$G05=L$7$?<-=q$rMQ$$$k$3$H$,=PMh$k!#E83+$O<+(B ;; $BF0$G9T$J$o$l$k$?$a!"FCJL$J@_Dj$OI,MW$"$j$^$;$s!#(B ;; ;; * $BB.EY=E;k$N$?$a(B `save-match-data' $B$K$h$k0lCW%G!<%?$NB`Hr$H2sI|$O0l(B ;; $B@Z$7$F$$$^$;$s!#(B ;;;------------------------------------------------------------ ;;; Customizable variables ;;;------------------------------------------------------------ (defun sdicf-find-program (&rest programs) (if programs (catch 'which (mapcar (lambda (file) (mapcar (lambda (path) (if (file-executable-p (expand-file-name file path)) (throw 'which (expand-file-name file path)))) exec-path)) programs)))) (defvar sdicf-default-directory (expand-file-name "~/") "*Default directory for executing command.") (defvar sdicf-egrep-command (sdicf-find-program "egrep" "egrep.exe" "grep" "grep.exe") "*Executable file name of egrep") (defvar sdicf-fgrep-command (sdicf-find-program "fgrep" "fgrep.exe" "grep" "grep.exe") "*Executable file name of fgrep") (defvar sdicf-array-command (sdicf-find-program "array" "array.exe") "*Executable file name of array") (defvar sdicf-default-coding-system (if (>= emacs-major-version 20) (if (featurep 'mule) (if (string-match "XEmacs" emacs-version) (cond ((memq 'euc-japan-unix (coding-system-list)) 'euc-japan-unix) ((memq 'euc-jp-unix (coding-system-list)) 'euc-jp-unix)) 'euc-japan-unix)) (and (boundp 'MULE) *euc-japan*unix)) "*Default coding system for sdicf.el") ;; Error Symbols (put 'sdicf-missing-file 'error-conditions '(error sdicf-errors sdicf-missing-file)) (put 'sdicf-missing-file 'error-message "Can't find file") (put 'sdicf-missing-executable 'error-conditions '(error sdicf-errors sdicf-missing-executable)) (put 'sdicf-missing-executable 'error-message "Can't find executable") (put 'sdicf-invalid-strategy 'error-conditions '(error sdicf-errors sdicf-invalid-strategy)) (put 'sdicf-invalid-strategy 'error-message "Invalid search strategy") (put 'sdicf-decide-strategy 'error-conditions '(error sdicf-errors sdicf-decide-strategy)) (put 'sdicf-decide-strategy 'error-message "Can't decide strategy automatically") (put 'sdicf-invalid-method 'error-conditions '(error sdicf-errors sdicf-invalid-method)) (put 'sdicf-invalid-method 'error-message "Invalid search method") ;;;------------------------------------------------------------ ;;; Internal variables ;;;------------------------------------------------------------ (defconst sdicf-version "0.9" "Version number of sdicf.el") (defconst sdicf-strategy-alist '((array sdicf-array-available sdicf-array-init sdicf-array-quit sdicf-array-search) (grep sdicf-grep-available sdicf-grep-init sdicf-grep-quit sdicf-grep-search) (direct sdicf-direct-available sdicf-direct-init sdicf-direct-quit sdicf-direct-search)) "$BMxMQ$G$-$k(B strategy $B$NO"A[G[Ns(B $BG[Ns$N3FMWAG$O!"(B strategy $B$N%7%s%\%k(B strategy $B$NMxMQ2DG=@-$r8!::$9$k4X?t(B strategy $B$r=i4|2=$9$k4X?t(B strategy $B$r=*N;$9$k4X?t(B strategy $B$r;H$C$F8!:w$9$k4X?t(B $B$N(B4$B$D$NMWAG$+$i$J$k%j%9%H$H$J$C$F$$$k!#(Bstrategy $B$N<+F0H=Dj$r9T$&$H$-$O!"(B $B$3$NO"A[G[Ns$K@h$KEPO?$5$l$F$$$k(B strategy $B$,;H$o$l$k!#(B") ;;;------------------------------------------------------------ ;;; Internal functions ;;;------------------------------------------------------------ (if (fboundp 'buffer-live-p) (defalias 'sdicf-buffer-live-p 'buffer-live-p) (defun sdicf-buffer-live-p (object) "\ Return non-nil if OBJECT is a buffer which has not been killed. Value is nil if OBJECT is not a buffer or if it has been killed." (and object (bufferp object) (buffer-name object)))) (defsubst sdicf-object-p (sdic) "$B<-=q%*%V%8%'%/%H$+$I$&$+8!::$9$k(B" (and (vectorp sdic) (eq 'SDIC (aref sdic 0)))) (defsubst sdicf-entry-p (entry) (and (stringp entry) (string-match "^<.>\\([^<]+\\)" entry))) (defsubst sdicf-get-filename (sdic) "$B<-=q%*%V%8%'%/%H$+$i%U%!%$%kL>$rF@$k(B" (aref sdic 1)) (defsubst sdicf-get-coding-system (sdic) "$B<-=q%*%V%8%'%/%H$+$i(B coding-system $B$rF@$k(B" (aref sdic 2)) (defsubst sdicf-get-strategy (sdic) "$B<-=q%*%V%8%'%/%H$+$i(B strategy $B$rF@$k(B" (aref sdic 3)) (defsubst sdicf-get-buffer (sdic) "$B<-=q%*%V%8%'%/%H$+$i8!:wMQ%P%C%U%!$rF@$k(B" (aref sdic 4)) (defun sdicf-common-init (sdic) "\ $B6&DL$N<-=q=i4|2=4X?t(B $B:n6HMQ%P%C%U%!$,B8:_$9$k$3$H$r3NG'$7!"$J$1$l$P?7$7$/@8@.$9$k!#:n6HMQ%P%C(B $B%U%!$rJV$9!#(B" (or (and (sdicf-buffer-live-p (sdicf-get-buffer sdic)) (sdicf-get-buffer sdic)) (let ((buf (generate-new-buffer (format " *sdic %s*" (sdicf-get-filename sdic))))) (buffer-disable-undo buf) (aset sdic 4 buf)))) (defun sdicf-common-quit (sdic) "\ $B6&DL$N<-=q=*N;4X?t(B" (if (sdicf-buffer-live-p (sdicf-get-buffer sdic)) (kill-buffer (sdicf-get-buffer sdic)))) (defsubst sdicf-search-internal () "\ $B8=:_9T$r%A%'%C%/$7!"%(%s%H%j$J$i$P8=:_9T$NFbMF$r(B entries $B$K2C$($k!#(B $B%]%$%s%H$r9T$N@hF,$K0\F0$7$F$*$+$J$1$l$P$J$i$J$$!#4X?t$N\n]" string start) (setq ch (aref string (match-beginning 0)) list (cons (if (eq ch ?&) "&" (if (eq ch ?<) "<" (if (eq ch ?>) ">" "&lf;"))) (cons (substring string start (match-beginning 0)) list)) start (match-end 0))) (eval (cons 'concat (nreverse (cons (substring string start) list)))))) (defun sdicf-decode-string (string) "\ STRING $B$r%G%3!<%I$9$k(B $B%G%3!<%I$7$?J8;zNs$rJV$9(B" (let ((start 0) list) (while (string-match "&\\(\\(lt\\)\\|\\(gt\\)\\|\\(lf\\)\\|\\(amp\\)\\);" string start) (setq list (cons (if (match-beginning 2) "<" (if (match-beginning 3) ">" (if (match-beginning 4) "\n" "&"))) (cons (substring string start (match-beginning 0)) list)) start (match-end 0))) (eval (cons 'concat (nreverse (cons (substring string start) list)))))) (defun sdicf-insert-file-contents (filename coding-system &optional visit beg end replace) "\ CODING-SYSTEM $B$rL@<(E*$K;XDj$7$F(B insert-file-contents $B$r8F$S=P$9(B CODING-SYSTEM $B0J30$N0z?t$N0UL#$O(B insert-file-contents $B$HF1$8(B" (let ((coding-system-for-read coding-system) (file-coding-system-for-read coding-system)) (insert-file-contents filename visit beg end replace))) (defun sdicf-call-process (program coding-system &optional infile buffer display &rest args) "\ CODING-SYSTEM $B$rL@<(E*$K;XDj$7$F(B call-process $B$r8F$S=P$9(B CODING-SYSTEM $B0J30$N0z?t$N0UL#$O(B call-process $B$HF1$8(B" (let ((default-directory sdicf-default-directory) (coding-system-for-read coding-system) (coding-system-for-write coding-system) (process-input-coding-system coding-system) (process-output-coding-system coding-system) (file-name-coding-system coding-system) (default-process-coding-system (cons coding-system coding-system))) (apply 'call-process program infile buffer display args))) (defun sdicf-start-process (name buffer program coding-system &rest args) "\ start-process $B$r]$N%U%!%$%k$r%P%C%U%!$KFI$_9~$s$G8!:w$r9T$&(B $B8+$D$+$C$?%(%s%H%j$N%j%9%H$rJV$9!#(BCASE $B$,(B nil $B$J$i$P!"BgJ8;z>.J8;z$N0c(B $B$$$r6hJL$7$F8!:w$9$k!#(BREGEXP $B$,(B Non-nil $B$J$i$P!"(BPATTERN $B$r@55,I=8=$H8+(B $B$J$7$F8!:w$9$k!#(B" (sdicf-direct-init sdic) (save-excursion (set-buffer (sdicf-get-buffer sdic)) (let ((case-fold-search case) entries) (goto-char (point-min)) (if regexp (while (re-search-forward pattern nil t) (forward-line 0) (sdicf-search-internal)) (while (search-forward pattern nil t) (forward-line 0) (sdicf-search-internal))) (nreverse entries)))) ;;; Strategy `grep' (defun sdicf-grep-available (sdic) (and (or (file-readable-p (sdicf-get-filename sdic)) (signal 'sdicf-missing-file (list (sdicf-get-filename sdic)))) (or (and (stringp sdicf-fgrep-command) (file-executable-p sdicf-fgrep-command)) (signal 'sdicf-missing-executable '(fgrep grep))) (or (and (stringp sdicf-egrep-command) (file-executable-p sdicf-egrep-command)) (signal 'sdicf-missing-executable '(egrep grep))))) (defalias 'sdicf-grep-init 'sdicf-common-init) (defalias 'sdicf-grep-quit 'sdicf-common-quit) (defun sdicf-grep-search (sdic pattern &optional case regexp) "\ fgrep / egrep $B$^$?$O(B grep $B$r;H$C$F8!:w$r9T$&(B $B8+$D$+$C$?%(%s%H%j$N%j%9%H$rJV$9!#(BCASE $B$,(B nil $B$J$i$P!"BgJ8;z>.J8;z$N0c(B $B$$$r6hJL$7$F8!:w$9$k!#(BREGEXP $B$,(B nil $B$J$i$P(B sdicf-fgrep-command $B$G;XDj(B $B$5$l$?%3%^%s%I$r;H$C$F8!:w$9$k!#(BREGEXP $B$,(B Non-nil $B$J$i$P(B sdicf-egrep-command $B$G;XDj$5$l$?%3%^%s%I$r;H$&!#(B" (sdicf-grep-init sdic) (save-excursion (set-buffer (sdicf-get-buffer sdic)) (delete-region (point-min) (point-max)) (apply 'sdicf-call-process (if regexp sdicf-egrep-command sdicf-fgrep-command) (sdicf-get-coding-system sdic) nil t nil (if regexp (if case (list "-i" "-e" pattern (sdicf-get-filename sdic)) (list "-e" pattern (sdicf-get-filename sdic))) (if case (list "-i" pattern (sdicf-get-filename sdic)) (list "-e" pattern (sdicf-get-filename sdic))))) (goto-char (point-min)) (let (entries) (while (not (eobp)) (sdicf-search-internal)) (nreverse entries)))) ;;; Strategy `array' (defun sdicf-array-available (sdic) (and (or (file-readable-p (sdicf-get-filename sdic)) (signal 'sdicf-missing-file (list (sdicf-get-filename sdic)))) (or (file-readable-p (concat (sdicf-get-filename sdic) ".ary")) (signal 'sdicf-missing-file (list (concat (sdicf-get-filename sdic) ".ary")))) (or (and (stringp sdicf-array-command) (file-executable-p sdicf-array-command)) (signal 'sdicf-missing-executable '(array))))) (defun sdicf-array-init (sdic) (sdicf-common-init sdic) (let ((proc (get-buffer-process (sdicf-get-buffer sdic)))) (or (and proc (eq (process-status proc) 'run)) (progn (setq proc (sdicf-start-process "array" (sdicf-get-buffer sdic) sdicf-array-command (sdicf-get-coding-system sdic) (sdicf-get-filename sdic))) (accept-process-output proc) (process-send-string proc "style line\n") (accept-process-output proc) (process-send-string proc "order index\n") (accept-process-output proc) (process-kill-without-query proc) (set-process-filter proc 'sdicf-array-wait-prompt) t)))) (defun sdicf-array-quit (sdic) (if (sdicf-buffer-live-p (sdicf-get-buffer sdic)) (let ((proc (get-buffer-process (sdicf-get-buffer sdic)))) (and proc (eq (process-status proc) 'run) (set-process-filter proc nil) (process-send-string proc "quit\n")) (kill-buffer (sdicf-get-buffer sdic))))) (defun sdicf-array-send-string (proc string) "\ $B;XDj$5$l$?J8;zNs(B STRING $B$r%3%^%s%I$H$7$F(B PROC $B$KEO$7$F%W%m%s%W%H$,8=$l$k$^$GBT$D4X?t(B" (save-excursion (let ((sdicf-array-wait-prompt-flag t)) (set-buffer (process-buffer proc)) (set-marker (process-mark proc) (point-max)) (process-send-string proc (concat string "\n")) (while sdicf-array-wait-prompt-flag (accept-process-output proc))))) (defun sdicf-array-wait-prompt (proc string) "\ $B%W%m%s%W%H(B ok $B$,8=$l$?$3$H$r8!CN$7$F!"(Bsdicf-array-wait-prompt-flag $B$r(B nil $B$K$9$k%U%#%k%?4X?t(B" (save-excursion (save-match-data ; Emacs-19.34 $B0J9_$O<+F0E*$K8!:w7k2L$NBTHr(B/$B2sI|$,9T$o$l$k$N$GITMW(B (set-buffer (process-buffer proc)) (goto-char (process-mark proc)) (insert string) (set-marker (process-mark proc) (point)) (skip-chars-backward " \t\n") (forward-line 0) (if (looking-at "ok\n") (setq sdicf-array-wait-prompt-flag nil)) ))) (defun sdicf-array-search (sdic pattern &optional case regexp) "\ array $B$r;H$C$F8!:w$r9T$&(B $B8+$D$+$C$?%(%s%H%j$N%j%9%H$rJV$9!#(Barray $B$O@55,I=8=8!:w$*$h$SBgJ8;z>.J8(B $B;z$N0c$$$r6hJL$7$J$$8!:w$O=PMh$J$$!#=>$C$F!"(BCASE $B$,(B Non-nil $B$N>l9g$O!"(B $BBgJ8;z>.J8;z$r6hJL$7$F8!:w$7$?>l9g$N7k2L$rJV$9!#(BREGEXP $B$,(B Non-nil $B$N>l(B $B9g$O6u$j%9%H$rJV$9!#(B" (sdicf-array-init sdic) (if regexp (signal 'sdicf-invalid-method '(regexp)) (save-excursion (let ((proc (get-buffer-process (set-buffer (sdicf-get-buffer sdic)))) (case-fold-search nil)) (sdicf-array-send-string proc "init") (delete-region (point-min) (point-max)) (sdicf-array-send-string proc (concat "search " pattern)) (if (looking-at "FOUND:") (progn (delete-region (point-min) (point-max)) (sdicf-array-send-string proc "show") (let (entries cons) (while (not (eobp)) (sdicf-search-internal)) (setq entries (sort entries 'string<) cons entries) (while (cdr cons) (if (equal (car cons) (car (cdr cons))) (setcdr cons (cdr (cdr cons))) (setq cons (cdr cons)))) entries))))))) ;;;------------------------------------------------------------ ;;; Interface functions ;;;------------------------------------------------------------ (defun sdicf-open (filename &optional coding-system strategy) "\ SDIC$B7A<0$N<-=q$r%*!<%W%s$9$k(B FILENAME $B$O<-=q$N%U%!%$%kL>!#(BSTRATEGY $B$O8!:w$r9T$J$&J}<0$r;XDj$9$k0z?t(B $B$G!"@\8!:w!#(B `grep' - grep $B%3%^%s%I$rMQ$$$F8!:w!#(B `array' - SUFARY $B$rMQ$$$?9bB.8!:w!#(B STRATEGY $B$,>JN,$5$l$?>l9g$O(B sdicf-strategy-alist $B$NCM$r;H$C$F<+F0E*$K(B $BH=Dj$9$k!#(BCODING-SYSTEM $B$,>JN,$5$l$?>l9g$O!"(Bsdicf-default-coding-system $B$NCM$r;H$&!#(B SDIC $B<-=q%*%V%8%'%/%H$O(B CAR $B$,(B `SDIC' $B$N%Y%/%?$G$"$k!#0J2<$N(B4$B$D$NMWAG(B $B$r;}$D!#(B $B!&%U%!%$%kL>(B $B!&<-=q$N(B coding-system $B!&(Bstrategy $B!&:n6HMQ%P%C%U%!(B " (let ((sdic (vector 'SDIC filename (or coding-system sdicf-default-coding-system) nil nil))) (aset sdic 3 (if strategy (if (assq strategy sdicf-strategy-alist) (if (funcall (nth 1 (assq strategy sdicf-strategy-alist)) sdic) strategy) (signal 'sdicf-invalid-strategy (list strategy))) (catch 'found-strategy (mapcar (lambda (e) (if (condition-case nil (funcall (nth 1 e) sdic) (sdicf-errors nil)) (throw 'found-strategy (car e)))) sdicf-strategy-alist) (signal 'sdicf-decide-strategy nil)))) sdic)) (defun sdicf-close (sdic) "SDIC$B7A<0$N<-=q$r%/%m!<%:$9$k(B" (or (sdicf-object-p sdic) (signal 'wrong-type-argument (list 'sdicf-object-p sdic))) (funcall (nth 3 (assq (sdicf-get-strategy sdic) sdicf-strategy-alist)) sdic)) (defun sdicf-search (sdic method word) "\ SDIC$B7A<0$N<-=q$+$i(B WORD $B$r%-!<$H$7$F8!:w$r9T$&(B $B8+IU$+$C$?%(%s%H%j$N%j%9%H$rJV$9!#(BMETHOD $B$O8!:wK!$G!"l9g$OBgJ8;z(B/$B>.J8;z$r6hJL$7(B $B$F8!:w$r9T$&!#A4J88!:w$*$h$S@55,I=8=8!:w$N>l9g$O!"(Bcase-fold-search $B$N(B $BCM$K$h$C$FJQ2=$9$k!#$?$@$7!"(Bstrategy $B$K$h$C$F$O!";XDj$5$l$?8!:wJ}<0$K(B $BBP1~$7$F$$$J$$>l9g$,$"$k$N$G!"Cm0U$9$k$3$H!#BP1~$7$F$$$J$$>l9g$NJV$jCM(B $B$O!"(Bstrategy $B$K$h$k!#(B" (or (sdicf-object-p sdic) (signal 'wrong-type-argument (list 'sdicf-object-p sdic))) (or (stringp word) (signal 'wrong-type-argument (list 'stringp word))) (let ((case-fold-search (if (eq method 'text) case-fold-search))) (funcall (nth 4 (assq (sdicf-get-strategy sdic) sdicf-strategy-alist)) sdic (cond ((eq method 'prefix) (concat "" (sdicf-encode-string (downcase word)))) ((eq method 'suffix) (concat (sdicf-encode-string (downcase word)) "")) ((eq method 'exact) (concat "" (sdicf-encode-string (downcase word)) "")) ((eq method 'text) word) ((eq method 'regexp) word) (t (signal 'sdicf-invalid-method (list method)))) (and (or (eq method 'text) (eq method 'regexp)) case-fold-search) (eq method 'regexp)))) (defun sdicf-entry-headword (entry) "$B%(%s%H%j(B ENTRY $B$N8+=P$78l$rJV$9!#(B" (or (sdicf-entry-p entry) (signal 'wrong-type-argument (list 'sdicf-entry-p entry))) (sdicf-decode-string (substring entry (match-beginning 1) (match-end 1)))) (defun sdicf-entry-keywords (entry &optional add-headword) "\ $B%(%s%H%j(B ENTRY $B$N8!:w%-!<$N%j%9%H$rJV$9(B ADD-HEADWORD $B$,(B Non-nil $B$N>l9g$O8!:w%-!<$K8+=P$78l$r2C$($?%j%9%H$rJV$9(B" (or (sdicf-entry-p entry) (signal 'wrong-type-argument (list 'sdicf-entry-p entry))) (let ((start (match-end 0)) (keywords (if (or add-headword (string= "" (substring entry 0 3))) (list (sdicf-decode-string (substring entry (match-beginning 1) (match-end 1))))))) (while (eq start (string-match "<.>\\([^<]+\\)" entry start)) (setq start (match-end 0) keywords (cons (sdicf-decode-string (substring entry (match-beginning 1) (match-end 1))) keywords))) (nreverse keywords))) (defun sdicf-entry-text (entry) "$B%(%s%H%j(B ENTRY $B$NK\J8$rJV$9!#(B" (or (stringp entry) (signal 'wrong-type-argument (list 'stringp entry))) (sdicf-decode-string (substring entry (string-match "[^>]*$" entry)))) (provide 'sdicf) ;;; sdicf.el ends here sdic-2.1.3/lisp/sdicf-client.el0000444000175000017500000001366507510305732011770 ;; sdicf-client.el ---- -*- Emacs-Lisp -*- Library to search SDIC form dictionary. ;; $Id: sdicf-client.el,v 1.4 2002/07/02 11:17:46 tsuchiya Exp $ ;; Copyright (C) 1998,99 TSUCHIYA Masatoshi ;; Author: TSUCHIYA Masatoshi ;; Keywords: dictionary ;; This file is part of SDIC. ;; SDIC is free software; you can redistribute it and/or modify it ;; under the terms of the GNU General Public License as published by ;; the Free Software Foundation; either version 2 of the License, or ;; (at your option) any later version. ;; SDIC is distributed in the hope that it will be useful, but ;; WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with SDIC; if not, write to the Free Software Foundation, ;; Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ;;; Commentary: ;; SDIC 形式の辞書を sdicf.el を利用して検索するライブラリです。 ;;; Install: ;; (1) 辞書を適切な形式に変換して、適当な場所( 例: /usr/dict/ )に保存 ;; して下さい。辞書変換用スクリプトとして以下の Perl スクリプトが ;; 利用できます。 ;; ;; gene.perl - GENE95 辞書 ;; edict.perl - EDICT 辞書 ;; eijirou.perl - 英辞郎 ;; ;; (2) 使えるようにした辞書の定義情報を sdic-eiwa-dictionary-list また ;; は sdic-waei-dictionary-list に追加して下さい。 ;; ;; (setq sdic-eiwa-dictionary-list ;; (cons '(sdicf-client "/usr/dict/gene.dic") sdic-eiwa-dictionary-list)) ;; ;; 辞書定義情報は次のような構成になっています。 ;; ;; (sdicf-client ファイル名 (オプションA 値A) (オプションB 値B) ...) ;; ;; 特別な指定が不要な場合には、オプションは省略できます。 ;; ;; (sdicf-client ファイル名) ;;; Options: ;; sdicf-client.el に対して指定できるオプションは次の通りです。 ;; ;; coding-system ;; 辞書の漢字コードを指定します。省略した場合は、 ;; sdic-default-coding-system の値を使います。 ;; ;; title ;; 辞書のタイトルを指定します。省略した場合は、辞書ファイルの ;; basename をタイトルとします。 ;; ;; add-keys-to-headword ;; 全ての検索キーを含めて見出し語を構成する場合に t に設定して下さ ;; い。和英辞書を検索する場合に、振り仮名も含めて出力する場合に利 ;; 用します。 ;; ;; strategy ;; sdicf.el を通して辞書を検索する時の strategy を指定します。省略 ;; した場合は、sdicf.el の自動判定によって選ばれた strategy を使用 ;; します。 ;;; Note; ;; sdicf.el は SDIC 形式の辞書を検索するためのライブラリです。それぞれ ;; の違いは次の通りです。3種類の strategy がサポートされています。 ;; ;; `direct' ;; 辞書データを全てメモリに読み込んでから検索を行います。外部コマ ;; ンドを必要としませんが、大量のメモリが必要になります。 ;; ;; `grep' ;; fgrep を利用して検索を行います。 ;; ;; `array' ;; array を利用して検索を行います。辞書の index file を事前に生成 ;; しておいてから検索を行いますので、高速に検索が可能です。しかし、 ;; index file は辞書の3倍程度の大きさになります。 ;; ;; 比較的小規模の辞書を検索する場合は `grep' が最適でしょう。しかし、 ;; 5MByte より大きい辞書の場合は `array' の利用を考慮すべきだと思いま ;; す。 ;; ;; SDIC 形式の辞書の構造については、sdic.texi を参照してください。 ;;; ライブラリ定義情報 (require 'sdic) (require 'sdicf) (provide 'sdicf-client) (put 'sdicf-client 'version "2.0") (put 'sdicf-client 'init-dictionary 'sdicf-client-init-dictionary) (put 'sdicf-client 'open-dictionary 'sdicf-client-open-dictionary) (put 'sdicf-client 'close-dictionary 'sdicf-client-close-dictionary) (put 'sdicf-client 'search-entry 'sdicf-client-search-entry) (put 'sdicf-client 'get-content 'sdicf-client-get-content) ;;;---------------------------------------------------------------------- ;;; 本体 ;;;---------------------------------------------------------------------- (defun sdicf-client-init-dictionary (file-name &rest option-list) "Function to initialize dictionary" (let ((dic (sdic-make-dictionary-symbol))) (if (file-readable-p (setq file-name (expand-file-name file-name))) (progn (mapcar (lambda (c) (put dic (car c) (nth 1 c))) option-list) (put dic 'file-name file-name) (put dic 'identifier (concat "sdicf-client+" file-name)) (or (get dic 'title) (put dic 'title (file-name-nondirectory file-name))) (or (get dic 'coding-system) (put dic 'coding-system sdic-default-coding-system)) dic) (error "Can't read dictionary: %s" (prin1-to-string file-name))))) (defun sdicf-client-open-dictionary (dic) "Function to open dictionary" (if (put dic 'sdic-object (sdicf-open (get dic 'file-name) (get dic 'coding-system) (get dic 'strategy))) dic)) (defun sdicf-client-close-dictionary (dic) "Function to close dictionary" (if (get dic 'sdic-object) (sdicf-close (get dic 'sdic-object)))) (defun sdicf-client-search-entry (dic string &optional search-type) "\ Function to search word with look or grep, and write results to current buffer. search-type の値によって次のように動作を変更する。 nil : 前方一致検索 t : 後方一致検索 lambda : 完全一致検索 0 : 全文検索 検索結果として見つかった見出し語をキーとし、その定義文の先頭の point を値とする 連想配列を返す。 " (let ((case-fold-search t) list) (mapcar (if (get dic 'add-keys-to-headword) (lambda (entry) (setq list (sdicf-entry-keywords entry)) (cons (if (= (length list) 1) (car list) (apply 'concat (car list) " " (mapcar (lambda (s) (format "[%s]" s)) (cdr list)))) entry)) (lambda (entry) (cons (sdicf-entry-headword entry) entry))) (sdicf-search (get dic 'sdic-object) (cond ((not search-type) 'prefix) ((eq search-type t) 'suffix) ((eq search-type 'lambda) 'exact) ((eq search-type 0) 'text) (t (error "Illegal search method : %S" search-type))) string)))) (defun sdicf-client-get-content (dic entry) (sdicf-entry-text entry)) sdic-2.1.3/lisp/sdic-compat.el0000444000175000017500000002635507510305732011627 ;; sdic-compat.el ---- -*- Emacs-Lisp -*- Library to search COMPAT format dictionary. ;; $Id: sdic-compat.el,v 2.5 2002/07/02 11:17:46 tsuchiya Exp $ ;; Copyright (C) 1998,99 TSUCHIYA Masatoshi ;; Author: TSUCHIYA Masatoshi ;; Keywords: dictionary ;; This file is part of SDIC. ;; SDIC is free software; you can redistribute it and/or modify it ;; under the terms of the GNU General Public License as published by ;; the Free Software Foundation; either version 2 of the License, or ;; (at your option) any later version. ;; SDIC is distributed in the hope that it will be useful, but ;; WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with SDIC; if not, write to the Free Software Foundation, ;; Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ;;; Commentary: ;; COMPAT 形式の辞書を外部プログラム( look / grep )を利用して検索する ;; ライブラリです。COMPAT 形式の詳細については sdic.texi を参照して下 ;; さい。 ;;; Install: ;; (1) look と大文字/小文字の違いを無視した検索が出来る grep ( fgrep ;; または GNU grep )が必要です。また、正規表現検索を利用する場合は ;; egrep も必要です。パスが通っているか確認して下さい。 ;; ;; (2) 辞書を適切な形式に変換して、適当な場所( 例: /usr/dict/ )に保存 ;; して下さい。辞書変換用スクリプトとして以下の Perl スクリプトが ;; 利用できます。 ;; ;; gene.perl - GENE95 辞書 ;; jgene.perl - GENE95 辞書から和英辞書を生成する ;; eijirou.perl - 英辞郎 ;; ;; --compat オプションを指定する必要があります。 ;; ;; (3) 使えるようにした辞書の定義情報を sdic-eiwa-dictionary-list また ;; は sdic-waei-dictionary-list に追加して下さい。 ;; ;; (setq sdic-eiwa-dictionary-list ;; (cons '(sdic-compat "/usr/dict/gene.dic") sdic-eiwa-dictionary-list)) ;; ;; 辞書定義情報は次のような構成になっています。 ;; ;; (sdic-compat ファイル名 (オプションA 値A) (オプションB 値B) ...) ;; ;; 特別な指定が不要な場合には、オプションは省略できます。 ;; ;; (sdic-compat ファイル名) ;;; Options: ;; sdic-compat.el に対して指定できるオプションは次の通りです。 ;; ;; coding-system ;; 辞書の漢字コードを指定します。省略した場合は、 ;; sdic-default-coding-system の値を使います。 ;; ;; title ;; 辞書のタイトルを指定します。省略した場合は、辞書ファイルの ;; basename をタイトルとします。 ;; ;; look ;; 前方一致検索/完全一致検索の時に利用する外部コマンドの名前を指定 ;; します。省略した場合は sdic-compat-look-command の値を使います。 ;; ;; look-case-option ;; look オプションによって指定された外部コマンドに対して、英大文字 ;; /小文字を区別しないで検索するように指示するためのコマンドライン ;; 引数を指定します。省略した場合は sdic-compat-look-case-option の ;; 値を使います。 ;; ;; grep ;; 後方一致検索/全文検索の時に利用する外部コマンドの名前を指定しま ;; す。省略した場合は sdic-compat-grep-command の値を使います。 ;; ;; grep-case-option ;; grep オプションによって指定された外部コマンドに対して、英大文字 ;; /小文字を区別しないで検索するように指示するためのコマンドライン ;; 引数を指定します。省略した場合は sdic-compat-grep-case-option の ;; 値を使います。 ;; ;; egrep ;; 正規表現検索の時に利用する外部コマンドの名前を指定します。省略 ;; した場合は sdic-compat-egrep-command の値を使います。 ;; ;; egrep-case-option ;; egrep オプションによって指定された外部コマンドに対して、英大文 ;; 字/小文字を区別しないで検索するように指示するためのコマンドライ ;; ン引数を指定します。省略した場合は ;; sdic-compat-egrep-case-option の値を使います。 ;;; Note: ;; sdic-compat-look-command / sdic-compat-grep-command / ;; sdic-compat-egrep-command の値は自動的に設定されます。例えば、 ;; sdic-compat-grep-command の場合、fgrep / fgrep.exe / grep / ;; grep.exe と4種のコマンドを検索して、見つかったコマンドを使います。 ;; ;; sdic-compat.el と sdic-gene.el は同じ機能を提供しているライブラリで ;; す。sdic-compat.el は外部コマンドを呼び出しているのに対して、 ;; sdic-gene.el は Emacs の機能のみを利用しています。ただし、辞書をバッ ;; ファに読み込んでから検索を行なうので、大量のメモリが必要になります。 ;; ;; Default の設定では、必要な外部コマンドが見つかった場合は ;; sdic-compat.el を、見つからなかった場合には sdic-gene.el を使うよう ;; になっています。 ;;; ライブラリ定義情報 (require 'sdic) (require 'sdicf) (provide 'sdic-compat) (put 'sdic-compat 'version "2.0") (put 'sdic-compat 'init-dictionary 'sdic-compat-init-dictionary) (put 'sdic-compat 'open-dictionary 'sdic-compat-open-dictionary) (put 'sdic-compat 'close-dictionary 'sdic-compat-close-dictionary) (put 'sdic-compat 'search-entry 'sdic-compat-search-entry) (put 'sdic-compat 'get-content 'sdic-compat-get-content) ;;;---------------------------------------------------------------------- ;;; 定数/変数の宣言 ;;;---------------------------------------------------------------------- (defvar sdic-compat-look-command (sdicf-find-program "look" "look.exe") "*Executable file name of look") (defvar sdic-compat-look-case-option "-f" "*Command line option for look to ignore case") (defvar sdic-compat-grep-command (sdicf-find-program "fgrep" "fgrep.exe" "grep" "grep.exe") "*Executable file name of grep") (defvar sdic-compat-grep-case-option "-i" "*Command line option for grep to ignore case") (defvar sdic-compat-egrep-command (sdicf-find-program "egrep" "egrep.exe" "grep" "grep.exe") "*Executable file name of egrep") (defvar sdic-compat-egrep-case-option "-i" "*Command line option for egrep to ignore case") (defconst sdic-compat-search-buffer-name " *sdic-compat*") ;;;---------------------------------------------------------------------- ;;; 本体 ;;;---------------------------------------------------------------------- (defun sdic-compat-available-p () "\ Function to check availability of library. ライブラリの利用可能性を検査する関数" (and (file-executable-p sdic-compat-look-command) (file-executable-p sdic-compat-grep-command))) (defun sdic-compat-init-dictionary (file-name &rest option-list) "Function to initialize dictionary" (let ((dic (sdic-make-dictionary-symbol))) (if (file-readable-p (setq file-name (expand-file-name file-name))) (progn (mapcar '(lambda (c) (put dic (car c) (nth 1 c))) option-list) (put dic 'file-name file-name) (put dic 'identifier (concat "sdic-compat+" file-name)) (or (get dic 'title) (put dic 'title (file-name-nondirectory file-name))) (or (get dic 'look) (put dic 'look sdic-compat-look-command)) (or (get dic 'look-case-option) (put dic 'look-case-option sdic-compat-look-case-option)) (or (get dic 'grep) (put dic 'grep sdic-compat-grep-command)) (or (get dic 'grep-case-option) (put dic 'grep-case-option sdic-compat-grep-case-option)) (or (get dic 'egrep) (put dic 'egrep sdic-compat-egrep-command)) (or (get dic 'egrep-case-option) (put dic 'egrep-case-option sdic-compat-egrep-case-option)) (or (get dic 'coding-system) (put dic 'coding-system sdic-default-coding-system)) (and (stringp (get dic 'look)) (stringp (get dic 'grep)) dic)) (error "Can't read dictionary: %s" (prin1-to-string file-name))))) (defun sdic-compat-open-dictionary (dic) "Function to open dictionary" (and (or (sdicf-buffer-live-p (get dic 'sdic-compat-search-buffer)) (put dic 'sdic-compat-search-buffer (generate-new-buffer sdic-compat-search-buffer-name))) dic)) (defun sdic-compat-close-dictionary (dic) "Function to close dictionary" (kill-buffer (get dic 'sdic-compat-search-buffer)) (put dic 'sdic-compat-search-buffer nil)) (defun sdic-compat-search-entry (dic string &optional search-type) "\ Function to search word with look or grep, and write results to current buffer. search-type の値によって次のように動作を変更する。 nil : 前方一致検索 t : 後方一致検索 lambda : 完全一致検索 0 : 全文検索 regexp : 正規表現検索 検索結果として見つかった見出し語をキーとし、その定義文の先頭の point を値とする 連想配列を返す。" (save-excursion (set-buffer (get dic 'sdic-compat-search-buffer)) (save-restriction (if (get dic 'sdic-compat-erase-buffer) (delete-region (point-min) (point-max)) (goto-char (point-max)) (narrow-to-region (point-max) (point-max))) (put dic 'sdic-compat-erase-buffer nil) (cond ;; 前方一致検索の場合 -> look を使って検索 ((eq search-type nil) (if (string-match "\\Ca" string) (sdicf-call-process (get dic 'look) (get dic 'coding-system) nil t nil string (get dic 'file-name)) (sdicf-call-process (get dic 'look) (get dic 'coding-system) nil t nil (get dic 'look-case-option) string (get dic 'file-name)))) ;; 後方一致検索の場合 -> grep を使って検索 ((eq search-type t) (if (string-match "\\Ca" string) (sdicf-call-process (get dic 'grep) (get dic 'coding-system) nil t nil (concat string "\t") (get dic 'file-name)) (sdicf-call-process (get dic 'grep) (get dic 'coding-system) nil t nil (get dic 'grep-case-option) (concat string "\t") (get dic 'file-name)))) ;; 完全一致検索の場合 -> look を使って検索 / 余分なデータを消去 ((eq search-type 'lambda) (if (string-match "\\Ca" string) (sdicf-call-process (get dic 'look) (get dic 'coding-system) nil t nil string (get dic 'file-name)) (sdicf-call-process (get dic 'look) (get dic 'coding-system) nil t nil (get dic 'look-case-option) string (get dic 'file-name))) (goto-char (point-min)) (while (if (looking-at (format "%s\t" (regexp-quote string))) (= 0 (forward-line 1)) (delete-region (point) (point-max))))) ;; 全文検索の場合 -> grep を使って検索 ((eq search-type 0) (if (string-match "\\Ca" string) (sdicf-call-process (get dic 'grep) (get dic 'coding-system) nil t nil string (get dic 'file-name)) (sdicf-call-process (get dic 'grep) (get dic 'coding-system) nil t nil (get dic 'grep-case-option) string (get dic 'file-name)))) ;; 正規表現検索の場合 -> egrep を使って検索 ((eq search-type 'regexp) (or (stringp (get dic 'egrep)) (error "%s" "Command to search regular expression pattern is not specified")) (if (string-match "\\Ca" string) (sdicf-call-process (get dic 'egrep) (get dic 'coding-system) nil t nil string (get dic 'file-name)) (sdicf-call-process (get dic 'egrep) (get dic 'coding-system) nil t nil (get dic 'egrep-case-option) string (get dic 'file-name)))) ;; それ以外の検索形式を指定された場合 (t (error "Not supported search type is specified. \(%s\)" (prin1-to-string search-type)))) ;; 各検索結果に ID を付与する (goto-char (point-min)) (let (ret) (while (if (looking-at "\\([^\t]+\\)\t") (progn (setq ret (cons (cons (sdic-match-string 1) (match-end 0)) ret)) (= 0 (forward-line 1))))) (nreverse ret))))) (defun sdic-compat-get-content (dic point) (save-excursion (set-buffer (get dic 'sdic-compat-search-buffer)) (put dic 'sdic-compat-erase-buffer t) (if (<= point (point-max)) (buffer-substring (goto-char point) (progn (end-of-line) (point))) (error "Can't find content. (ID=%d)" point)))) sdic-2.1.3/lisp/sdic-gene.el0000444000175000017500000001726407510305732011261 ;; sdic-gene.el ---- -*- Emacs-Lisp -*- Library to search COMPAT format dictionary. ;; $Id: sdic-gene.el,v 2.6 2002/07/02 11:17:46 tsuchiya Exp $ ;; Copyright (C) 1998,99 TSUCHIYA Masatoshi ;; Author: TSUCHIYA Masatoshi ;; Keywords: dictionary ;; This file is part of SDIC. ;; SDIC is free software; you can redistribute it and/or modify it ;; under the terms of the GNU General Public License as published by ;; the Free Software Foundation; either version 2 of the License, or ;; (at your option) any later version. ;; SDIC is distributed in the hope that it will be useful, but ;; WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with SDIC; if not, write to the Free Software Foundation, ;; Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ;;; Commentary: ;; This file is a part of sdic. Please see sdic.el for more detail. ;; COMPAT 形式の辞書を外部プログラムに頼らずに検索するライブラリです。 ;; COMPAT 形式の詳細については sdic.texi を参照して下さい。 ;;; Install: ;; (1) 辞書を適切な形式に変換して、適当な場所( 例: /usr/dict/ )に保存 ;; して下さい。辞書変換用スクリプトとして以下の Perl スクリプトが ;; 利用できます。 ;; ;; gene.perl - GENE95 辞書 ;; jgene.perl - GENE95 辞書から和英辞書を生成する ;; eijirou.perl - 英辞郎 ;; ;; (2) 使えるようにした辞書の定義情報を sdic-eiwa-dictionary-list また ;; は sdic-waei-dictionary-list に追加して下さい。 ;; ;; (setq sdic-eiwa-dictionary-list ;; (cons '(sdic-gene "/usr/dict/gene.dic") sdic-eiwa-dictionary-list)) ;; ;; 辞書定義情報は次のような構成になっています。 ;; ;; (sdic-gene ファイル名 (オプションA 値A) (オプションB 値B) ...) ;; ;; 特別な指定が不要な場合には、オプションは省略できます。 ;; ;; (sdic-gene ファイル名) ;;; Options: ;; sdic-gene.el に対して指定できるオプションは次の通りです。 ;; ;; coding-system ;; 辞書の漢字コードを指定します。省略した場合は、 ;; sdic-default-coding-system の値を使います。 ;; ;; title ;; 辞書のタイトルを指定します。省略した場合は、辞書ファイルの ;; basename をタイトルとします。 ;; ;; extract ;; 圧縮辞書を展開するための外部コマンドを指定します。省略した場合 ;; は、辞書が圧縮されていないと見なします。 ;; ;; extract-option ;; extract オプションによって指定された外部コマンドに対して、辞書 ;; を展開して標準出力に出力させるためのコマンドライン引数を指定し ;; ます。省略した場合は sdic-gene-extract-option の値を使います。 ;;; Note: ;; sdic-compat.el と sdic-gene.el は同じ機能を提供しているライブラリで ;; す。sdic-compat.el は外部コマンドを呼び出しているのに対して、 ;; sdic-gene.el は Emacs の機能のみを利用しています。ただし、辞書をバッ ;; ファに読み込んでから検索を行なうので、大量のメモリが必要になります。 ;; ;; Default の設定では、必要な外部コマンドが見つかった場合は ;; sdic-compat.el を、見つからなかった場合には sdic-gene.el を使うよう ;; になっています。 ;;; ライブラリ定義情報 (require 'sdic) (require 'sdicf) (provide 'sdic-gene) (put 'sdic-gene 'version "2.0") (put 'sdic-gene 'init-dictionary 'sdic-gene-init-dictionary) (put 'sdic-gene 'open-dictionary 'sdic-gene-open-dictionary) (put 'sdic-gene 'close-dictionary 'sdic-gene-close-dictionary) (put 'sdic-gene 'search-entry 'sdic-gene-search-entry) (put 'sdic-gene 'get-content 'sdic-gene-get-content) ;;;---------------------------------------------------------------------- ;;; 定数/変数の宣言 ;;;---------------------------------------------------------------------- (defvar sdic-gene-extract-option "-dc" "\ *Option for archiver. 圧縮辞書を展開するために使うオプション") (defconst sdic-gene-search-buffer-name " *sdic-gene*") ;;;---------------------------------------------------------------------- ;;; 本体 ;;;---------------------------------------------------------------------- (defun sdic-gene-init-dictionary (file-name &rest option-list) "Function to initialize dictionary" (let ((dic (sdic-make-dictionary-symbol))) (if (file-readable-p (setq file-name (expand-file-name file-name))) (progn (mapcar '(lambda (c) (put dic (car c) (nth 1 c))) option-list) (put dic 'file-name file-name) (put dic 'identifier (concat "sdic-gene+" file-name)) (or (get dic 'title) (put dic 'title (file-name-nondirectory file-name))) (if (get dic 'extract) (or (get dic 'extract-option) (put dic 'extract-option sdic-gene-extract-option))) (or (get dic 'coding-system) (put dic 'coding-system sdic-default-coding-system)) dic) (error "Can't read dictionary: %s" (prin1-to-string file-name))))) (defun sdic-gene-open-dictionary (dic) "Function to open dictionary" (if (or (sdicf-buffer-live-p (get dic 'sdic-gene-search-buffer)) (save-excursion (set-buffer (put dic 'sdic-gene-search-buffer (generate-new-buffer sdic-gene-search-buffer-name))) (buffer-disable-undo) (insert "\n") (prog1 (if (get dic 'extract) (= 0 (sdicf-call-process (get dic 'extract) (get dic 'coding-system) nil t nil (get dic 'extract-option) (get dic 'file-name))) (condition-case err (sdicf-insert-file-contents (get dic 'file-name) (get dic 'coding-system)) (error nil))) (setq buffer-read-only t) (set-buffer-modified-p nil)))) dic)) (defun sdic-gene-close-dictionary (dic) "Function to close dictionary" (kill-buffer (get dic 'sdic-gene-search-buffer)) (put dic 'sdic-gene-search-buffer nil)) (defsubst sdic-gene-search-internal (string) "通常の検索を行う内部関数" (let (ret (case-fold-search t)) (while (search-forward string nil t) (save-excursion (setq ret (cons (cons (buffer-substring (progn (beginning-of-line) (point)) (progn (skip-chars-forward "^\t") (point))) (1+ (point))) ret)))) (nreverse ret))) (defsubst sdic-gene-re-search-internal (string) "正規表現検索を行う内部関数" (let (ret (case-fold-search t)) (while (re-search-forward string nil t) (save-excursion (setq ret (cons (cons (buffer-substring (progn (beginning-of-line) (point)) (progn (skip-chars-forward "^\t") (point))) (1+ (point))) ret)))) (nreverse ret))) (defun sdic-gene-search-entry (dic string &optional search-type) "\ Function to search word with look or grep, and write results to current buffer. search-type の値によって次のように動作を変更する。 nil : 前方一致検索 t : 後方一致検索 lambda : 完全一致検索 0 : 全文検索 regexp : 正規表現検索 検索結果として見つかった見出し語をキーとし、その定義文の先頭の point を値とする 連想配列を返す。 " (save-excursion (set-buffer (get dic 'sdic-gene-search-buffer)) (goto-char (point-min)) (cond ;; 前方一致検索 ((eq search-type nil) (sdic-gene-search-internal (concat "\n" string))) ;; 後方一致検索 ((eq search-type t) (sdic-gene-search-internal (concat string "\t"))) ;; 完全一致検索 ((eq search-type 'lambda) (sdic-gene-search-internal (concat "\n" string "\t"))) ;; 全文検索 ((eq search-type 0) (sdic-gene-search-internal string)) ;; 正規表現検索 ((eq search-type 'regexp) (sdic-gene-re-search-internal string)) ;; それ以外の検索形式を指定された場合 (t (error "Not supported search type is specified. \(%s\)" (prin1-to-string search-type)))))) (defun sdic-gene-get-content (dic point) (save-excursion (set-buffer (get dic 'sdic-gene-search-buffer)) (if (<= point (point-max)) (buffer-substring (goto-char point) (progn (end-of-line) (point))) (error "Can't find content. (ID=%d)" point)))) sdic-2.1.3/lisp/stem.el0000444000175000017500000005743607510305732010400 ;;; stem.el ---- routines for stemming ;;; $Id: stem.el,v 1.12 2002/07/02 11:17:46 tsuchiya Exp $ ;;; Author: TSUCHIYA Masatoshi ;;; Keywords: stemming ;;; Commentary: ;; 論文『An algorithm for suffix stripping (M.F.Porter)』に記述されて ;; いるアルゴリズムに基づいて、英単語の語尾を取り除くためのライブラリ。 ;; 利用及び再配布の際は、GNU 一般公用許諾書の適当なバージョンにしたがっ ;; て下さい。 ;; 一次配布元 ;; http://www-nagao.kuee.kyoto-u.ac.jp/member/tsuchiya/sdic/index.html ;; -*- Emacs-Lisp -*- (provide 'stem) (defvar stem:minimum-word-length 4 "Porter のアルゴリズムが適用できる最小語長") ;;;============================================================ ;;; 非公開関数 ;;;============================================================ ;; 動作速度を向上させるために、関数内部で外部変数をいじっている ;; 関数があり、予期しない副作用が発生する可能性が高い。従って、 ;; 非公開関数を直接呼び出すことは避けること。 ;;------------------------------------------------------------ ;; stemming-rule の条件節を記述する関数群 ;;------------------------------------------------------------ (defsubst stem:match (arg) "\ 変数 str を検査する非公開関数 (語幹の部分を変数 stem に代入する)" (and (string-match arg str) (setq stem (substring str 0 (match-beginning 0))))) (defsubst stem:m () "\ 変数 stem に含まれている VC の数を求める非公開関数" (save-match-data (let ((pos 0)(m 0)) (while (string-match "\\(a\\|e\\|i\\|o\\|u\\|[^aeiou]y+\\)[aeiou]*" stem pos) (setq m (1+ m)) (setq pos (match-end 0))) (if (= pos (length stem)) (1- m) m)))) (defsubst stem:m> (i) "\ 変数 stem に含まれている VC の数の条件を記述する非公開関数" (< i (stem:m))) (defsubst stem:m= (i) "\ 変数 stem に含まれている VC の数の条件を記述する非公開関数" (= i (stem:m))) (defsubst stem:*v* () "\ 変数 stem が母音を含んでいるか検査する関数" (save-match-data (if (string-match "\\(a\\|e\\|i\\|o\\|u\\|[^aeiou]y\\)" stem) t))) (defsubst stem:*o () "\ 変数 stem が cvc の形で終っているか検査する関数" (save-match-data (if (string-match "[^aeiou][aeiouy][^aeiouwxy]$" stem) t))) ;;------------------------------------------------------------ ;; stemming-rule を記述した関数群 ;;------------------------------------------------------------ (defun stem:step1a (str) "第1a段階の stemming rule (非公開関数)" (let ((s)(stem)) (if (setq s (cond ((stem:match "sses$") "ss") ((stem:match "ies$") "i") ((stem:match "ss$") "ss") ((stem:match "s$") ""))) (concat stem s) str))) (defun stem:step1b (str) "第1b段階の stemming rule (非公開関数)" (let ((s)(stem)) (cond ((and (stem:match "eed$") (stem:m> 0)) (concat stem "ee")) ((or (and (not stem) (stem:match "ed$") (stem:*v*)) (and (stem:match "ing$") (stem:*v*))) (if (and (stem:m= 1) (stem:*o)) (concat stem "e") (setq str stem) (if (setq s (cond ((stem:match "at$") "ate") ((stem:match "bl$") "ble") ((stem:match "iz$") "ize") ((stem:match "\\([^lsz]\\)\\1$") (substring str (match-beginning 1) (match-end 1))))) (concat stem s) str))) (t str)))) (defun stem:step1c (str) "第1c段階の stemming rule (非公開関数)" (let ((stem)) (if (and (stem:match "y$") (stem:*v*)) (concat stem "i") str))) (defun stem:step1 (str) "第1段階の stemming rule (非公開関数)" (stem:step1c (stem:step1b (stem:step1a str)))) (defun stem:step2 (str) "第2段階の stemming rule (非公開関数)" (let ((s)(stem)) (if (and (setq s (cond ((stem:match "ational$") "ate") ((stem:match "tional$") "tion") ((stem:match "enci$") "ence") ((stem:match "anci$") "ance") ((stem:match "izer$") "ize") ((stem:match "abli$") "able") ((stem:match "alli$") "al") ((stem:match "entli$") "ent") ((stem:match "eli$") "e") ((stem:match "ousli$") "ous") ((stem:match "ization$") "ize") ((stem:match "ation$") "ate") ((stem:match "ator$") "ate") ((stem:match "alism$") "al") ((stem:match "iveness$") "ive") ((stem:match "fulness$") "ful") ((stem:match "ousness$") "ous") ((stem:match "aliti$") "al") ((stem:match "iviti$") "ive") ((stem:match "biliti$") "ble"))) (stem:m> 0)) (concat stem s) str))) (defun stem:step3 (str) "第3段階の stemming rule (非公開関数)" (let ((s)(stem)) (if (and (setq s (cond ((stem:match "icate$") "ic") ((stem:match "ative$") "") ((stem:match "alize$") "al") ((stem:match "iciti$") "ic") ((stem:match "ical$") "ic") ((stem:match "ful$") "") ((stem:match "ness$") ""))) (stem:m> 0)) (concat stem s) str))) (defun stem:step4 (str) "第4段階の stemming rule (非公開関数)" (let ((stem)) (if (and (or (stem:match "al$") (stem:match "ance$") (stem:match "ence$") (stem:match "er$") (stem:match "ic$") (stem:match "able$") (stem:match "ible$") (stem:match "ant$") (stem:match "ement$") (stem:match "ment$") (stem:match "ent$") (and (string-match "[st]\\(ion\\)$" str) (setq stem (substring str 0 (match-beginning 1)))) (stem:match "ou$") (stem:match "ism$") (stem:match "ate$") (stem:match "iti$") (stem:match "ous$") (stem:match "ive$") (stem:match "ize$")) (stem:m> 1)) stem str))) (defun stem:step5 (str) "第5段階の stemming rule (非公開関数)" (let ((stem)) (if (or (and (stem:match "e$") (or (stem:m> 1) (and (stem:m= 1) (not (stem:*o))))) (and (stem:match "ll$") (setq stem (concat stem "l")) (stem:m> 1))) stem str))) (defvar stem:irregular-verb-alist '(("abode" "abide") ("abided" "abide") ("alighted" "alight") ("arose" "arise") ("arisen" "arise") ("awoke" "awake") ("awaked" "awake") ("awoken" "awake") ("baby-sat" "baby-sit") ("backbit" "backbite") ("backbitten" "backbite") ("backslid" "backslide") ("backslidden" "backslide") ("was" "be" "am" "is" "are") ("were" "be" "am" "is" "are") ("been" "be" "am" "is" "are") ("bore" "bear") ("bare" "bear") ("borne" "bear") ("born" "bear") ("beat" "beat") ("beaten" "beat") ("befell" "befall") ("befallen" "befall") ("begot" "beget") ("begat" "beget") ("begotten" "beget") ("began" "begin") ("begun" "begin") ("begirt" "begird") ("begirded" "begird") ("beheld" "behold") ("bent" "bend") ("bended" "bend") ("bereaved" "bereave") ("bereft" "bereave") ("besought" "beseech") ("beseeched" "beseech") ("beset" "beset") ("bespoke" "bespeak") ("bespoken" "bespeak") ("bestrewed" "bestrew") ("bestrewn" "bestrew") ("bestrode" "bestride") ("bestrid" "bestride") ("bestridden" "bestride") ("bet" "bet") ("betted" "bet") ("betook" "betake") ("betaken" "betake") ("bethought" "bethink") ("bade" "bid") ("bid" "bid") ("bad" "bid") ("bedden" "bid") ("bided" "bide") ("bode" "bide") ("bound" "bind") ("bit" "bite") ("bitten" "bite") ("bled" "bleed") ("blended" "blend") ("blent" "blend") ("blessed" "bless") ("blest" "bless") ("blew" "blow") ("blown" "blow") ("blowed" "blow") ("bottle-fed" "bottle-feed") ("broke" "break") ("broken" "break") ("breast-fed" "breast-feed") ("bred" "breed") ("brought" "bring") ("broadcast" "broadcast") ("broadcasted" "broadcast") ("browbeat" "browbeat") ("browbeaten" "browbeat") ("built" "build") ("builded" "build") ("burned" "burn") ("burnt" "burn") ("burst" "burst") ("busted" "bust") ("bust" "bust") ("bought" "buy") ("cast" "cast") ("chid" "chide") ("chided" "chide") ("chidden" "chide") ("chose" "choose") ("chosen" "choose") ("clove" "cleave") ("cleft" "cleave") ("cleaved" "cleave") ("cloven" "cleave") ("clave" "cleave") ("clung" "cling") ("clothed" "clothe") ("clad" "clothe") ("colorcast" "colorcast") ("clorcasted" "colorcast") ("came" "come") ("come" "come") ("cost" "cost") ("costed" "cost") ("countersank" "countersink") ("countersunk" "countersink") ("crept" "creep") ("crossbred" "crossbreed") ("crowed" "crow") ("crew" "crow") ("cursed" "curse") ("curst" "curse") ("cut" "cut") ("dared" "dare") ("durst" "dare") ("dealt" "deal") ("deep-froze" "deep-freeze") ("deep-freezed" "deep-freeze") ("deep-frozen" "deep-freeze") ("dug" "dig") ("digged" "dig") ("dived" "dive") ("dove" "dive") ("did" "do") ("done" "do") ("drew" "draw") ("drawn" "draw") ("dreamed" "dream") ("dreamt" "dream") ("drank" "drink") ("drunk" "drink") ("dripped" "drip") ("dript" "drip") ("drove" "drive") ("drave" "drive") ("driven" "drive") ("dropped" "drop") ("dropt" "drop") ("dwelt" "dwell") ("dwelled" "dwell") ("ate" "eat") ("eaten" "eat") ("fell" "fall") ("fallen" "fall") ("fed" "feed") ("felt" "feel") ("fought" "fight") ("found" "find") ("fled" "fly" "flee") ("flung" "fling") ("flew" "fly") ("flied" "fly") ("flown" "fly") ("forbore" "forbear") ("forborne" "forbear") ("forbade" "forbid") ("forbad" "forbid") ("forbidden" "forbid") ("forecast" "forecast") ("forecasted" "forecast") ("forewent" "forego") ("foregone" "forego") ("foreknew" "foreknow") ("foreknown" "foreknow") ("foreran" "forerun") ("forerun" "forerun") ("foresaw" "foresee") ("foreseen" "foresee") ("foreshowed" "foreshow") ("foreshown" "foreshow") ("foretold" "foretell") ("forgot" "forget") ("forgotten" "forget") ("forgave" "forgive") ("forgiven" "forgive") ("forwent" "forgo") ("forgone" "forgo") ("forsook" "forsake") ("forsaken" "forsake") ("forswore" "forswear") ("forsworn" "forswear") ("froze" "freeze") ("frozen" "freeze") ("gainsaid" "gainsay") ("gelded" "geld") ("gelt" "geld") ("got" "get") ("gotten" "get") ("ghostwrote" "ghostwrite") ("ghostwritten" "ghostwrite") ("gilded" "gild") ("gilt" "gild") ("girded" "gird") ("girt" "gird") ("gave" "give") ("given" "give") ("gnawed" "gnaw") ("gnawn" "gnaw") ("went" "go" "wend") ("gone" "go") ("graved" "grave") ("graven" "grave") ("ground" "grind") ("gripped" "grip") ("gript" "grip") ("grew" "grow") ("grown" "grow") ("hamstrung" "hamstring") ("hamstringed" "hamstring") ("hung" "hang") ("hanged" "hang") ("had" "have") ("heard" "hear") ("heaved" "heave") ("hove" "heave") ("hewed" "hew") ("hewn" "hew") ("hid" "hide") ("hidden" "hide") ("hit" "hit") ("held" "hold") ("hurt" "hurt") ("indwelt" "indwell") ("inlaid" "inlay") ("inlet" "inlet") ("inputted" "input") ("input" "input") ("inset" "inset") ("insetted" "inset") ("interwove" "interweave") ("interweaved" "interweave") ("jigsawed" "jigsaw") ("jigsawn" "jigsaw") ("kept" "keep") ("knelt" "kneel") ("kneeled" "kneel") ("knitted" "knit") ("knit" "knit") ("knew" "know") ("known" "know") ("laded" "lade") ("laden" "lade") ("laid" "lay") ("led" "lead") ("leaned" "lean") ("leant" "lean") ("leaped" "leap") ("leapt" "leap") ("learned" "learn") ("learnt" "learn") ("left" "leave") ("lent" "lend") ("let" "let") ("lay" "lie") ("lain" "lie") ("lighted" "light") ("lit" "light") ("lip-read" "lip-read") ("lost" "lose") ("made" "make") ("meant" "mean") ("met" "meet") ("melted" "melt") ("methougt" "methinks") ;; ("-" "methinks") ("misbecame" "misbecome") ("misbecome" "misbecome") ("miscast" "miscast") ("miscasted" "miscast") ("misdealt" "misdeal") ("misdid" "misdo") ("misdone" "misdo") ("misgave" "misgive") ("misgiven" "misgive") ("mishit" "mishit") ("mislaid" "mislay") ("misled" "mislead") ("misread" "misread") ("misspelt" "misspell") ("missplled" "misspell") ("misspent" "misspend") ("mistook" "mistake") ("mistaken" "mistake") ("misunderstood" "misunderstand") ("mowed" "mow") ("mown" "mow") ("offset" "offset") ("outbid" "outbid") ("outbade" "outbid") ("outbidden" "outbid") ("outdid" "outdo") ("outdone" "outdo") ("outfought" "outfight") ("outgrew" "outgrown") ("outgrown" "outgrown") ("outlaid" "outlay") ("output" "output") ("outputted" "output") ("ooutputted" "output") ("outrode" "outride") ("outridden" "outride") ("outran" "outrun") ("outrun" "outrun") ("outsold" "outsell") ("outshone" "outshine") ("outshot" "outshoot") ("outwore" "outwear") ("outworn" "outwear") ("overbore" "overbear") ("overborne" "overbear") ("overbid" "overbid") ("overblew" "overblow") ("overblown" "overblow") ("overcame" "overcome") ("overcome" "overcome") ("overdid" "overdo") ("overdone" "overdo") ("overdrew" "overdraw") ("overdrawn" "overdraw") ("overdrank" "overdrink") ("overdrunk" "overdrink") ("overate" "overeat") ("overeaten" "overeat") ("overfed" "overfeed") ("overflowed" "overflow") ("overflown" "overfly" "overflow") ("overflew" "overfly") ("overgrew" "overgrow") ("overgrown" "overgrow") ("overhung" "overhang") ("overhanged" "overhang") ("ovearheard" "overhear") ("overlaid" "overlay") ("overleaped" "overleap") ("overleapt" "overleap") ("overlay" "overlie") ("overlain" "overlie") ("overpaid" "overpay") ("overrode" "override") ("overridden" "override") ("overran" "overrun") ("overrun" "overrun") ("oversaw" "oversee") ("overseen" "oversee") ("oversold" "oversell") ("overset" "overset") ("overshot" "overshoot") ("overspent" "overspend") ("overspread" "overspread") ("overtook" "overtake") ("overtaken" "overtake") ("overthrew" "overthrow") ("overthrown" "overthrow") ("overworked" "overwork") ("overwrought" "overwork") ("partook" "partake") ("partaken" "partake") ("paid" "pay") ("penned" "pen") ("pent" "pen") ("pinch-hit" "pinch-hit") ("pleaded" "plead") ("plead" "plead") ("pled" "plead") ("prepaid" "prepay") ("preset" "preset") ("proofread" "proofread") ("proved" "prove") ("proven" "prove") ("put" "put") ("quick-froze" "quick-freeze") ("quick-frozen" "quick-freeze") ("quit" "quit") ("quitted" "quit") ("read" "read") ("reaved" "reave") ("reft" "reave") ("rebound" "rebind") ("rebroadcast" "rebroadcast") ("rebroadcasted" "rebroadcast") ("rebuilt" "rebuild") ("recast" "recast") ("recasted" "recast") ("re-did" "re-do") ("re-done" "re-do") ("reeved" "reeve") ("rove" "reeve") ("reheard" "rehear") ("relaid" "relay") ("remade" "remake") ("rent" "rend") ("repaid" "repay") ("reread" "reread") ("reran" "rerun") ("rerun" "rerun") ("resold" "resell") ("reset" "reset") ("retook" "retake") ("retaken" "retake") ("retold" "retell") ("rethought" "rethink") ("rewound" "rewind") ("rewinded" "rewind") ("rewrote" "rewrite") ("rewritten" "rewrite") ("rid" "ride") ;; ("rid" "ride" "rid") ("ridded" "rid") ("rode" "ride") ("ridden" "ride") ("rang" "ring") ("rung" "ring") ("rose" "rise") ("risen" "rise") ("rived" "rive") ("riven" "rive") ("roughcast" "roughcast") ("roughhewed" "roughhew") ("roughhewn" "roughhew") ("ran" "run") ("run" "run") ("sawed" "saw") ("sawn" "saw") ("said" "say") ("saw" "see") ("seen" "see") ("sought" "seek") ("sold" "sell") ("sent" "send") ("set" "set") ("sewed" "sew") ("sewn" "sew") ("shook" "shake") ("shaken" "shake") ("shaved" "shave") ("shaven" "shave") ("sheared" "shear") ("shore" "shear") ("shorn" "shear") ("shed" "shed") ("shone" "shine") ("shined" "shine") ("shit" "shit") ("shat" "shit") ("shitted" "shit") ("shod" "shoe") ("shoed" "shoe") ("shot" "shoot") ("showed" "show") ("shown" "show") ("shredded" "shred") ("shred" "shred") ("shrank" "shrink") ("shrunk" "shrink") ("shrunken" "shrink") ("shrived" "shrive") ("shrove" "shrive") ("shriven" "shrive") ("shut" "shut") ("sight-read" "sight-read") ("simulcast" "simulcast") ("simulcasted" "simulcast") ("sang" "sing") ("sung" "sing") ("sank" "sink") ("sunk" "sink") ("sunken" "sink") ("sat" "sit") ("sate" "sit") ("slew" "slay") ("slain" "slay") ("slept" "sleep") ("slid" "slide") ("slidden" "slide") ("slunk" "slink") ("smelled" "smell") ("smelt" "smell") ("smote" "smite") ("smitten" "smite") ("smit" "smite") ("sowed" "sow") ("sown" "sow") ("spoke" "speak") ("spoken" "speak") ("sped" "speed") ("speeded" "speed") ("spelled" "spell") ("spelt" "spell") ("spellbound" "spellbind") ("spent" "spend") ("spilled" "spill") ("spilt" "spill") ("spun" "spin") ("span" "spin") ("spat" "spit") ("spit" "spit") ("split" "split") ("spoiled" "spoil") ("spoilt" "spoil") ("spoon-fed" "spoon-feed") ("spread" "spread") ("sprang" "spring") ("sprung" "spring") ("stood" "stand") ("staved" "stave") ("stove" "stave") ("stayed" "stay") ("staid" "stay") ("stole" "steal") ("stolen" "steal") ("stuck" "stick") ("stung" "sting") ("stank" "stink") ("stunk" "stink") ("strewed" "strew") ("strewn" "strew") ("strode" "stride") ("stridden" "stride") ("struck" "strike") ("stricken" "strike") ("strung" "string") ("strove" "strive") ("striven" "strive") ("sublet" "sublet") ("sunburned" "sunburn") ("sunburnt" "sunburn") ("swore" "swear") ("sware" "swear") ("sworn" "swear") ("sweat" "sweat") ("sweated" "sweat") ("swept" "sweep") ("swelled" "swell") ("swollen" "swell") ("swam" "swim") ("swum" "swim") ("swung" "swing") ("took" "take") ("taken" "take") ("taught" "teach") ("tore" "tear") ("torn" "tear") ("telecast" "telecast") ("telecasted" "telecast") ("told" "tell") ("thought" "think") ("thrived" "thrive") ("throve" "thrive") ("thriven" "thrive") ("threw" "thrown") ("thrown" "thrown") ("thrust" "thrust") ("tossed" "toss") ("tost" "toss") ("trod" "tread") ("treaded" "tread") ("trode" "tread") ("trodden" "tread") ("typecast" "typecast") ("typewrote" "typewrite") ("typewritten" "typewrite") ("unbent" "unbend") ("unbended" "unbend") ("unbound" "unbind") ("underbid" "underbid") ("underbidden" "underbid") ("undercut" "undercut") ("underwent" "undergo") ("undergone" "undergo") ("underlaid" "underlay") ("underlay" "underlie") ("underlain" "underlie") ("underpaid" "underpay") ("undersold" "undersell") ("undershot" "undershoot") ("understood" "understand") ("undertook" "undertake") ("undertaken" "undertake") ("underwrote" "underwrite") ("underwritten" "underwrite") ("undid" "undo") ("undone" "undo") ("undrew" "undraw") ("undrawn" "undraw") ("ungirded" "ungird") ("ungirt" "ungird") ("unlearnt" "unlearn") ("unlearned" "unlearn") ("unmade" "unmake") ("unsaid" "unsay") ("unstuck" "unstick") ("unstrung" "unstring") ("unwound" "unwind") ("upheld" "uphold") ("uprose" "uprise") ("uprisen" "uprise") ("upset" "upset") ("upswept" "upsweep") ("woke" "wake") ("waked" "wake") ("woken" "wake") ("waylaid" "waylay") ("wore" "wear") ("worn" "wear") ("wove" "weave") ("weaved" "weave") ("woven" "weave") ("wed" "wed") ("wedded" "wed") ("wept" "weep") ("wended" "wend") ("wetted" "wet") ("wet" "wet") ("won" "win") ("wound" "wind") ("winded" "wind") ("wiredrew" "wiredraw") ("wiredrawn" "wiredraw") ("wist" "wit") ("withdrew" "withdraw") ("withdrawn" "withdraw") ("withheld" "withhold") ("withstood" "withstand") ("worked" "work") ("wrought" "work") ("wrapped" "wrap") ("wrapt" "wrap") ("wrung" "wring") ("wrote" "write") ("writ" "write") ("written" "write")) "不規則動詞と原形の連想配列") (defun stem:extra (str) "\ 動詞/形容詞の活用形と名詞の複数形の活用語尾を取り除く非公開関数 与えられた語の原形として可能性のある語のリストを返す" (or (assoc str stem:irregular-verb-alist) (if (string= str "as") (list "as")) (let (c l stem) (setq l (cond ;; 比較級/最上級 ((stem:match "\\([^aeiou]\\)\\1e\\(r\\|st\\)$") (list (substring str (match-beginning 1) (match-end 1)) (substring str (match-beginning 0) (match-beginning 2)))) ((stem:match "\\([^aeiou]\\)ie\\(r\\|st\\)$") (setq c (substring str (match-beginning 1) (match-end 1))) (list c (concat c "y") (concat c "ie"))) ((stem:match "e\\(r\\|st\\)$") '("" "e")) ;; 3単現/複数形 ((stem:match "ches$") '("ch" "che")) ((stem:match "shes$") '("sh" "che")) ((stem:match "ses$") '("s" "se")) ((stem:match "xes$") '("x" "xe")) ((stem:match "zes$") '("z" "ze")) ((stem:match "ves$") '("f" "fe")) ((stem:match "\\([^aeiou]\\)oes$") (setq c (substring str -4 -3)) (list c (concat c "o") (concat c "oe"))) ((stem:match "\\([^aeiou]\\)ies$") (setq c (substring str -4 -3)) (list c (concat c "y") (concat c "ie"))) ((stem:match "es$") '("" "e")) ((stem:match "s$") '("")) ;; 過去形/過去分詞 ((stem:match "\\([^aeiou]\\)ied$") (setq c (substring str -4 -3)) (list c (concat c "y") (concat c "ie"))) ((stem:match "\\([^aeiou]\\)\\1ed$") (list (substring str -4 -3) (substring str -4 -1))) ((stem:match "cked$") '("c" "cke")) ((stem:match "ed$") '("" "e")) ;; 現在分詞 ((stem:match "\\([^aeiou]\\)\\1ing$") (list (substring str -5 -4))) ((stem:match "ing$") '("" "e")) )) (append (mapcar '(lambda (s) (concat stem s)) l) (list str)) ))) ;;;============================================================ ;;; 公開関数 ;;;============================================================ (defun stem:stripping-suffix (str) "\ 活用語尾を取り除く関数 与えられた語の元の語として可能性のある語の辞書順のリストを返す" (save-match-data (delq nil (let ((w "")) (mapcar (function (lambda (x) (if (string= x w) nil (setq w x)))) (sort (append ;; 大文字を小文字に変換 (list (prog1 str (setq str (downcase str)))) ;; 独自のヒューリスティックスを適用 (stem:extra str) (if (> (length str) stem:minimum-word-length) ;; 単語長が条件を満たせば、Porter のアルゴリズムを適用 (mapcar '(lambda (func) (setq str (funcall func str))) '(stem:step1 stem:step2 stem:step3 stem:step4 stem:step5)))) 'string<)))))) (defun stem-english (str) "\ 活用語尾を取り除く関数 与えられた語の元の語として可能性のある語の文字列長の昇順のリストを返す" (sort (stem:stripping-suffix str) (function (lambda (a b) (< (length a) (length b)))))) ;; この stem-english の動作は、 ;; ;; Id: stem.el,v 1.4 1998/11/30 09:27:27 tsuchiya Exp tsuchiya ;; ;; 以前のバージョンの stem.el で定義されていた stem:stripping-suffix ;; の動作と互換である。現在の stem:stripping-suffix は辞書順のリストを ;; 返すため、異なる動作とするようになっているので注意すること。 ;;; Porter のアルゴリズムを適用する関数 (defun stem:stripping-inflection (word) "\ Porter のアルゴリズムに基づいて派生語を処理する関数" (save-match-data (stem:step5 (stem:step4 (stem:step3 (stem:step2 (stem:step1 word)))))))