Commits

Anonymous committed 7231f95

Baseline release for edict package, version 1.01

  • Participants
  • Tags v1_01

Comments (0)

Files changed (29)

+edict
+		    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
+he 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
+
+	Appendix: 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.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) 19yy  <name of author>
+
+    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.
+
+  <signature of Ty Coon>, 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.
+1998-03-13  SL Baur  <steve@altair.xemacs.org>
+
+	* Created an XEmacs package
+
+	* edict.el:
+	* edict-test.el: Minimal patches to bytecompile under XEmacs 21.0.
+	Converted to ISO-2022-JP.
+
+# Makefile for Edict
+
+# This file is part of XEmacs.
+
+# XEmacs 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.
+
+# XEmacs 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 XEmacs; see the file COPYING.  If not, write to
+# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+VERSION = 1.01
+AUTHOR_VERSION = 0.9.7
+MAINTAINER = Stephen J. Turnbull <turnbull@sk.tsukuba.ac.jp>
+PACKAGE = edict
+PKG_TYPE = regular
+REQUIRES = mule-base xemacs-base
+CATEGORY = mule
+
+EXTRA_SOURCES = edict-test.el.distrib edict.el.distrib edict.doc edictj.demo \
+                ts-mode.el
+
+ELCS = edict.elc dui.elc edict-morphology.elc edict-japanese.elc \
+       edict-english.elc edict-edit.elc edict-test.elc
+
+COMPATIBILITY-FLAGS = -eval "(setq byte-compile-print-gensym nil)"
+
+include ../../XEmacs.rules
+
+EXCLUDES = --exclude='edictj' --exclude='CVS'
+
+all:: $(ELCS) auto-autoloads.elc
+
+srckit: srckit-std
+
+binkit: binkit-sourceonly

File Makefile.perham

+#
+#  Copyright (c) 1992 Per Hammarlund (perham@nada.kth.se)
+#
+# This is a silly makefile to ease the handling of the edict software,
+# it can do silly things like building a distribution (taring),
+# cleaning and such.
+#
+#   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 1, 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.
+# 
+
+EMACS-LISP-FILES = edict-test.el edict.el
+TEXT-FILES = COPYING README edict.ChangeLog edict.doc
+DEMO-DICT-FILE = edictj.demo
+INSTALL-FILES = Makefile install.edict
+DISTRIBUTION-FILES =  $(EMACS-LISP-FILES) $(TEXT-FILES) $(DEMO-DICT-FILE) $(INSTALL-FILES)
+DIST-FILE-NAME = edict.tar
+
+
+distribution:	$(DISTRIBUTION-FILES)
+	tar -cvf $(DIST-FILE-NAME) $(DISTRIBUTION-FILES);\
+	compress $(DIST-FILE-NAME)
+
+
+
+
+
+Copyright (C) 1992 Bob Kerns <rwk@crl.dec.com>
+
+Package contents Copyright (c) 1991, 1992  Per Hammarlund <perham@nada.kth.se>
+and Copyright (c) 1992 Bob Kerns <rwk@crl.dec.com>
+
+Some code that looks for translations of english and japanese using the
+EDICTJ Public Domain japanese/english dictionary.
+
+edict.el written by Per Hammarlund <perham@nada.kth.se>
+Morphology and private dictionary handling/editing by Bob Kerns <rwk@crl.dec.com>
+International installation script by Bob Kerns <rwk@crl.dec.com>
+Helpful remarks from Ken-Ichi Handa <handa@etl.go.jp>.
+The EDICTJ PD dictionary is maintained by Jim Breen <jwb@monu6.cc.monash.edu.au>
+Your credits here if you contribute!
+
+
+This distribution includes the following files.
+
+README			You should read this file first!  (OK, you are...)
+COPYING			The GNU public license.
+edict.ChangeLog		History of changes.
+edict.el		The actual code for the dictionary lookup program.
+edict-test.el		The test suite for the dictionary lookup program.
+edict.doc		The documentation.  Read this for usage instructions.
+install.edict		The installation script, internationalized.
+			(Please contribute a language, currently only
+			Japanese, English, and Swedish.)
+Makefile		You won't need this, this is to build distributions.
+edictj.demo		A demo version of the edictj public-domain dictionary.
+			You may use this to try out the software; I suggest using
+			the words 'car' and '��' as a test cases.
+
+			You should obtain the real dictionary via
+			anonymous ftp from the /pub/Nihongo directory
+			at monu6.cc.monash.edu.au. 
+
+The installation process, ie running the install script, creates the
+following additional files:
+
+edict.elc		Compiled version of edict.el; the actual compiled library
+			code to load.
+edict.emacs		Sample code to include in your .emacs file.
+
+To run the installation script, cd to the directory containing this software,
+and do ./install.edict, and answer the questions.
+
+cd /usr/local/src/edict
+./install.edict

File README.XEmacs

+***** edict.el optimized for XEmacs *****
+
+Version 0.9.7
+
+This file Copyright 1998 Stephen J. Turnbull <turnbull@sk.tsukuba.ac.jp>.
+
+The edict.el package is Copyright 1991, 1992 Per Hammarlund 
+  <perham@nada.kth.se> and 1998 Stephen J. Turnbull
+  <turnbull@sk.tsukuba.ac.jp>.
+
+Individual files may have their own Copyrights differing from the above.
+
+This file is part of XEmacs.
+
+It 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.
+
+XEmacs 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 XEmacs; if not, write to the Free Software Foundation,
+Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+Original author:  Per Hammarlund <perham@nada.kth.se>
+Other authors:    Bob Kerns <rwk@crl.dec.com>
+                  Stephen J. Turnbull <turnbull@sk.tsukuba.ac.jp>
+
+Adapted-by:  Stephen J. Turnbull <turnbull@sk.tsukuba.ac.jp> for XEmacs
+Maintainer:  Stephen J. Turnbull <turnbull@sk.tsukuba.ac.jp>
+
+***** Whatzit? *****
+
+The original edict.el, by Per Hammarlund, was an interface to the
+EDICT Japanese-English dictionary compiled by Jim Breen at Monash
+University.  Using the region and couple of keystrokes, edict.el will
+look up the Japanese key and return all the EDICT entries containing
+that key, in a pop-up buffer.  English is even easier, you just put
+point anywhere in the word you want to look up.  
+
+Bob Kerns added a morphology engine, which reduces a highly inflected
+Japanese word to a list of dictionary forms (eg, itta -> (iku, iu)),
+all of which are looked up.
+
+After several years of service, it became partially incompatible with
+recent FSF Emacsen, especially the byte compiler, and never was
+adapted for XEmacs (which only recently acquired Japanese capability).
+This BETA release adapts edict.el to XEmacs (because that's what the
+maintainer uses), packages it for ease of installation on XEmacs, and
+provides a unified interface to the functions via the Dictionary
+Lookup minor mode.
+
+The next release should provide assurance of FSF Emacs, version 20,
+compatibility for edict.el proper, and possibly a port of the
+Dictionary Lookup minor mode.
+
+***** Installation *****
+
+For XEmacs >= 20.3, get edict-<version>-pkg.tar.gz from
+
+    http://turnbull.sk.tsukuba.ac.jp/Tools/XEmacs/packages/edict/
+
+and untar it in the the directory ~/.xemacs (or root directory of your
+package hierarchy, if you know what that is).  If you are using XEmacs 
+>= 20.5, you're done.
+
+If you're using XEmacs 20.3 or 20.4, then add
+
+	 (load-file "~/.xemacs/lisp/edict/auto-autoloads.el")
+
+to your ~/.emacs or ~/.xemacs/init.el.  Get edict (the dictionary)
+from ftp://ftp.cc.monash.edu.au/pub/nihongo/, and install it in an
+appropriate etc/ or etc/edict/ in your package hierarchy
+(~/.xemacs/etc/ is fine).  For trial purposes, there is a tiny
+edict.demo dictionary supplied with edict.el.
+
+Users of other versions of Mule are welcome to play around; please
+tell me what you did, whether it works or not.
+
+***** User Setup *****
+
+Users of recent XEmacsen should need little setup, unless you are
+using public dictionaries not named "edict" or user dictionaries not
+in your home directory or not named ".edict".  In that case, set the
+variables `edict-dictionaries' and `edict-user-dictionary' as needed.
+
+Other users may need to set up autoloads and possibly their
+load-paths.  The necessary autoloads may be found by "grep -A 1
+'^;;;###autoload$' *.el".  You will also probably need to set the
+variable `edict-dictionary-path' to help edict find your public
+dictionaries.
+
+For some reason, Mule occasionally has trouble recognizing the file
+coding system of edict files.  If so, the Monash distribution
+dictionary `edict', which is in EUC-JP format, should be correctly
+initialized by
+
+	   (setq edict-dictionaries '(("edict" . euc-jp)))
+
+in .emacs.  The value of this variable is a LIST of CONS-or-STRING.
+If a CONS, it should have a STRING as car and a CODING-SYSTEM as cdr.
+Note that the name of this variable has changed.  If your dictionary
+directory is not found at all, you can setq `edict-dictionary-path' to
+a LIST of strings, each of which should be a path to a directory which
+might contain edict dictionaries.
+
+FSF Emacs users will probably not be able to use `dl-mode', described
+below, bcause of differences in implementation of keymaps.  (This is
+completely untested at this writing.)  In that case, you should also
+do the relevant `define-key' calls in .emacs.  (See the commentary at
+the top of edict.el; the autoloads are unnecessary because edict.el
+now uses the auto-autoloads.el file.)
+
+***** Usage *****
+
+The interface to edict is now the Dictionary Lookup minor mode
+(dl-mode).  It is invoked as usual by (eg) "M-x dl-mode", and its
+modeline indicator is "dl".  dl-mode is autoloaded.  The various
+functions are bound to keys in a mode-specific keymap, which is
+invoked by a prefix key.  The default prefix is "C-c $" (by analogy
+with ispell's "M-$").
+
+Unlike the former interface, dui is intended to be a general interface
+to various dictionary-like commands.  Dictionary lookup is bound to
+"s" (for "search") in the sub-keymap; insertion and help are bound
+to "i" and "d" (for "describe method" respectively.  The search mode
+is initialized to "EDICT search Japanese" by default.
+
+Using a prefix argument allows you to change modes.  Eg, "C-u C-c $ s"
+generates a prompt for a "Method:".  Currently valid search methods
+include "EDICT search Japanese", "EDICT search English", and "ispell
+word".  Valid insert methods include "EDICT add English" and "EDICT add 
+Japanese".
+
+edict.el provides a simple dictionary editing mode, automatically
+invoked by the "EDICT add ..." methods, with TAB switching 
+between fields.  An experimental `electric-henkan' mode is available,
+in which the mode recognizes whether a field is Japanese or English
+and invokes your preferred henkan method appropriately.  To try this
+out (setq edict-use-electric-henkan t).  Note that electric henkan
+uses the LEIM interface, so it cannot work if your preferred input
+method is XIM.
+
+Due to the indirect way in which the actual methods are called, a
+separate help function, `dui-describe-method', bound to "C-c $ d", is
+provided to access method documentation.
+
+Enjoy!
+
+***** Bug reports, comments, and feature requests *****
+
+Please send these to "Stephen Turnbull" <turnbull@sk.tsukuba.ac.jp>.
+
+Bug reports are of course of high priority, but I am hoping that users 
+will also report inflections and idioms that the morphology engine
+does not handle.
+
+Known bugs and problems are divided between the file TODO and the
+commentary to edict.el.  (Documentation and organization are both
+known bugs....)
+
+With the reimplementation as a minor mode, it now makes sense to
+provide keystrokes for variations on the basic theme.  One example
+(already implemented for ispell) is to use dl-mode to access other
+dictionary applications.  Another possibility is that kanjidic can be
+loaded into the *edict* buffer as well; one could imagine restricted
+functions (not yet implemented) that only search kanjidic or only
+edict.
+
+***** Historical notes *****
+
+The files edict.el.distrib and edict-test.el.distrib are from the original
+distribution grabbed off of monash.  The .el files in this package have
+been converted to ISO-2022-JP encoding.
+BUGS
+
+1.   [OK] Register some insert [ and edit - can't, are none ] methods.
+2.   [OK] Deal with the case of first entry in the dictionary.
+3.   Give kanjidic entries precedence in list.
+4.   Give private dictionary entries precedence in list.
+5.   Editing does not work when the dictionaries aren't loaded
+     (edict-user-dictionary is unbound).  Probably should also check
+     for existence of edict-buffer.
+6.   Completion of search methods will find insert methods, eg, need to
+     filter in the same way as history.
+
+PRETTIFICATION
+
+1.   Move customizable variables to separate file.
+

File dui-registry.el

+;;; dui-registry.el --- Registry of dui dictionary methods
+
+;; Copyright (C) 1998 by Stephen J. Turnbull
+
+;; Author:      Stephen J. Turnbull <turnbull@sk.tsukuba.ac.jp>
+;; Keywords:    mule, dictionary
+;; Version:     0.5
+
+;;   This file is part of XEmacs.
+
+;;   XEmacs 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.
+
+;;   XEmacs 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 XEmacs; if not, write to the Free Software Foundation,
+;;   Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+;;; Commentary:
+
+;;; To do:
+
+;;; Changelog:
+
+;; 1998-04-08  Stephen Turnbull  <turnbull@sk.tsukuba.ac.jp>
+;;        (created):  broken out from edict.el
+
+;;; Code:
+
+(require 'dui)
+
+(dui-register-method
+ "ispell word"
+ 'search
+ 'ispell-word
+ "Invokes ispell on the word at point.
+
+Heaven only knows what will happen if it's Japanese.")
+
+(defun edict-search-english-wrapper ()
+  "Interface `edict-search-english' to `dui-invoke-method'."
+  (edict-search-english nil))
+
+;; Probably could do without the wrapper:
+;  (dui-register-method
+;    "EDICT search english"
+;    'search
+;    'edict-search-english
+;    "Attempts to translate the english word we are looking at. Picks the word 
+;  in the same way as ispell, ie backs up from whitespace, and then expands.
+;
+;  Result is presented in a window that is not selected."
+;    nil)
+
+(dui-register-method
+  "EDICT search English"
+  'search
+  'edict-search-english-wrapper
+  "Attempts to translate the english word we are looking at. Picks the word 
+in the same way as ispell, ie backs up from whitespace, and then expands.
+
+Result is presented in a window that is not selected.")
+
+(defun edict-search-kanji-wrapper ()
+  "Interface `edict-search-kanji' to `dui-invoke-method'."
+  (let ((m (mark))
+	(p (point)))
+    (cond
+     ((null m)
+      (error "Please set the region around the Japanese phrase to look up."))
+     ((< m p) (edict-search-kanji nil m p))
+     (t (edict-search-kanji nil p m)))))
+
+(dui-register-method
+  "EDICT search Japanese"
+  'search
+  'edict-search-kanji-wrapper
+  "Attempts to translate the Japanese `word' between mark and point.
+
+Verbs and adjectives will be deinflected, common auxiliaries and suffixes
+removed, and all resulting candidates looked up.
+
+Result is presented in a window that is not selected.")
+
+;; Make it default
+(or (featurep 'dui-registry)
+    (setq dui-method-history
+	  (cons "EDICT search Japanese" dui-method-history)))
+
+(defun edict-add-kanji-wrapper ()
+  "Interface `edict-add-kanji' to `dui-invoke-method'."
+  (let ((m (mark))
+	(p (point)))
+    (cond
+     ((null m)
+      (error "Please mark the Japanese word to add to your private dictionary."))
+     ((< m p) (edict-add-kanji m p))
+     (t (edict-add-kanji p m)))))
+
+(dui-register-method
+  "EDICT add Japanese to private dictionary"
+  'insert
+  'edict-add-kanji-wrapper
+  "Adds the Japanese `word' between mark and point to the private dictionary.
+
+The entry is formatted for EDICT, and edict-edit-mode is entered.")
+
+(dui-register-method
+  "EDICT add English to private dictionary"
+  'insert
+  'edict-add-kanji-wrapper
+  "Adds the English word near point to the private dictionary.
+
+The entry is formatted for EDICT, and edict-edit-mode is entered.")
+
+(dui-princ-errors)
+
+(provide 'dui-registry)
+
+;;; dui-registry.el ends here
+;;; dui.el --- Dictionary user interface
+
+;; Copyright (C) 1998 by Stephen J. Turnbull
+
+;; Author:      Stephen J. Turnbull <turnbull@sk.tsukuba.ac.jp>
+;; Keywords:    mule, dictionary
+;; Version:     0.5
+
+;;   This file is part of XEmacs.
+
+;;   XEmacs 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.
+
+;;   XEmacs 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 XEmacs; if not, write to the Free Software Foundation,
+;;   Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+;;; Commentary:
+
+;; Some code that provides support for dictionary lookup and manipulations
+;; (such as inserting definitions and maintaining a private dictionary).
+;; Originally written in support of edict.el, by Per Hammarlund
+;; <perham@nada.kth.se>, but since generalized.
+
+;;; To do:
+
+;;; Changelog:
+
+;; 1998-03-27  Stephen Turnbull  <turnbull@sk.tsukuba.ac.jp>
+;;        (created):  broken out from monolithic edict.el
+
+;;; Code:
+
+;;; Dictionary lookup minor mode (dl-mode)
+
+;; User customization variables
+
+(defvar dl-mode-prefix '[(control ?c) (?\$)]
+  "Prefix key sequence for dl-mode command keys.
+
+After loading, change the mode's prefix by using dl-mode-set-prefix;
+setq'ing this variable can't work.")
+
+(defvar dl-indicator-string " dl"
+  "String indicating activation of dl minor mode in the modeline.
+
+Set to nil to inhibit modeline display.")
+
+;; A convention for modes; here honored by observance, not breach.
+;;
+(defvar dl-mode-hook nil
+  "A normal hook called at the end of the dl-mode activation process.
+
+If you can think of a use for this, you're more clever than I.")
+
+;; Auxiliary customizations
+
+(defvar dl-conflict-warning "Binding conflict: %s -> %s."
+  "Format string warning about key sequences with conflicting bindings.
+
+Must contain two `%s' descriptors.  The first formats the key sequence,
+the second the description of the existing binding.")
+
+(defvar dl-warn-conflict-verbosity 3
+  "Controls verbosity of binding conflict warnings.
+
+0   turns off warnings entirely.
+1   issues a warning for each binding conflict (including sub-keymaps).
+2   prints a summary message with a count of conflicts (not including
+    sub-keymaps, only keys in those maps that have conflicts).
+3   adds verbose detail about what is being done.
+
+Each positive level performs all actions of lower levels.")
+
+;; The basic mode conventions.
+
+;; Mode flag and keymaps
+;;
+(defvar dl-mode nil "Activation flag for dl-mode.")
+
+(defvar dl-mode-submap nil
+  "Sub-keymap for dl-mode.
+
+All key sequences are prefixed by the sequence defined in dl-mode-map.")
+
+(defvar dl-mode-map nil
+  "Keymap for dl-mode.  Holds the prefix key for dl-mode functions.
+
+Its value will be installed into minor-mode-map-alist.  Prefix cannot
+be altered by setq'ing dl-mode-map.  Use dl-mode-set-prefix instead.")
+
+;; Mode toggle
+;;
+;; The side effect is arguably not a feature :-)
+;
+;;;###autoload
+(defun dl-mode (&optional arg)
+  "Minor mode for dictionary lookup, with interfaces to dictionary utilities.
+
+Null ARG toggles the mode, positive ARG turns the mode on, negative ARG
+turns the mode off.
+
+When the mode is already off, (dl-mode -1) has the side effect of checking
+and reporting any conflicting bindings.
+
+\\{dl-mode-map}"
+
+  (interactive "P")
+
+  ;; dl-warn-binding-conflicts doesn't make sense when the mode is active
+  (if (null dl-mode)
+      (dl-warn-binding-conflicts dl-mode-map))
+  (setq dl-mode (if (null arg) (not dl-mode)
+                  (> (prefix-numeric-value arg) 0)))
+  (run-hooks dl-mode-hook))
+
+;; Internal mode data
+
+;; Main keymap
+;;
+(or dl-mode-submap
+    (progn
+     (setq dl-mode-submap (make-sparse-keymap))
+     (define-prefix-command 'dl-mode-submap 'dl-mode-submap)
+     (define-key dl-mode-submap ?s 'dui-invoke-search-method)
+     (define-key dl-mode-submap ?i 'dui-invoke-insert-method)
+     ;; Hmm ... I don't think there are any of these :-P
+     ;;(define-key dl-mode-submap ?e 'dui-invoke-edit-method)
+     (define-key dl-mode-submap ?d 'dui-describe-method)
+     ))
+
+;; Helper functions
+
+;; Set the mode prefix
+;;
+;; This can't be done simply by setq'ing dl-mode-map; minor-mode-map-alist
+;; does not refer to that variable but contains a copy of its value.
+;;
+(defun dl-mode-set-prefix (key &optional context)
+  "Set the prefix key sequence for dl-mode to KEY.
+
+Return the new dl-mode-map.  When called interactively read KEY from
+the minibuffer (as a string; keys not bound to `self-insert' must be
+quoted with C-q).  If you need more flexibility than ASCII gives, you'll
+have to use the `eval-expression' interface.
+
+Example: `\\[dl-mode-set-prefix] C-q C-c $ RET' returns the prefix key
+to the default `C-c $'.
+
+Allowed values of CONTEXT:
+NIL                substitute a map containing KEY in minor-mode-map-alist.
+adding-minor-mode  manipulation of minor-mode-map-alist is done elsewhere."
+
+  ;; Should read key events but I don't know how to make that work.
+  (interactive "Key sequence (quote control characters with ^Q): ")
+
+  (setq dl-mode-map (make-sparse-keymap))
+  (define-key dl-mode-map key 'dl-mode-submap)
+  (cond ((null context)
+	 (let ((slot (assq 'dl-mode minor-mode-map-alist)))
+	   (setq minor-mode-map-alist
+		 (cons (cons 'dl-mode dl-mode-map)
+		       (if slot
+			   (delete slot minor-mode-map-alist)
+			 minor-mode-map-alist)))))
+	((equal context 'adding-minor-mode))
+	(t (error "Illegal context `%s' in dl-mode-set-prefix." context)))
+  dl-mode-map)
+
+;; Deal with binding conflicts
+;;
+;; Search keymaps for binding conflicts for each key in the mode's keymap.
+;; Current implementation searches only active keymaps; it won't tell
+;; about inactive keymaps, including those of minor modes that might be
+;; invoked later or (worse) major modes already invoked in other buffers.
+;;
+(defun dl-warn-binding-conflicts (map)
+  "Warn about key bindings that will conflict with those in MAP.
+
+Results will be non-sensical if MAP is invoked via a prefix or is
+already active.  The current implementation only looks in the active
+keymaps.  Maps of inactive minor modes and local maps major modes of
+other buffers will not be searched (although the latter will be shadowed
+since dl-mode is a global variable)."
+  (let ((found 0))
+    (if (> dl-warn-conflict-verbosity 1)
+	(progn
+	  (message "Checking for conflicting bindings...")
+	  (if (> dl-warn-conflict-verbosity 2)
+	      (message "Examining accessible maps of map:\n    `%s'" map))))
+    ;; A map is accessible from itself
+    (mapcar (lambda (slot)
+	      (let ((prefix (car slot))
+		    (map (cdr slot)))
+		(if (> dl-warn-conflict-verbosity 2)
+		    (message "Examining keys of map:\n    `%s'" map))
+		(map-keymap (lambda (key binding)
+			      (let* ((key (vconcat prefix (vector key)))
+				     (binding (key-binding key)))
+				(if (and binding
+					 (> dl-warn-conflict-verbosity 0))
+				    (progn
+				      (if (not (keymapp binding))
+					  (setq found (1+ found)))
+				      (message dl-conflict-warning
+					       key binding)))))
+			    map)))
+	    (accessible-keymaps map))
+    (if (> dl-warn-conflict-verbosity 1)
+	(message "Checking for conflicting bindings...done%s"
+		 (if (> found 0)
+		     (format ".  Found %d." found)
+		   ".")))))
+
+;; Register the mode with XEmacs
+;;
+(add-minor-mode 'dl-mode
+		dl-indicator-string
+		(dl-mode-set-prefix dl-mode-prefix 'adding-minor-mode))
+
+;;; end of dictionary lookup minor mode
+
+(defvar dui-warn-previously-registered-methods-p t
+  "Warn about previously registered methods.")
+
+;;     [SJT:  OK, ispell uses M-$, and LEIM and Wnn both use C-\.  I see
+;;	all three processes (spell-check, localized input methods, and
+;;	dictionary lookup) as being aspects of high-level dictionary-
+;;	based natural language input.  I would like to overload the same
+;;	mode-toggle for all of them.  I see IMs as being primary (analogous
+;;	to a minor mode), while the checking functions are secondary and/or
+;;	transient.  Unfortunately, both ispell and LEIM use prefix args to
+;;	modify the toggle's behavior.  But all of "C-$", "C-c $", "C-c \",
+;;	and "C-c \" are undefined.
+;;	  I see the interface as follows.
+;;	The main-entry point is the the transient function (ispell-word,
+;;	edict-lookup-*), accessed via the un-prefixed key.
+;;	The prefixed key would give a short choice menu, in the echo area.
+;;	A short-list of defaults would be alternative transient functions,
+;;	plus the choices to add or delete from the menu, or to do more
+;;	complicated maintenance (eg, customize, once we have an interface.)
+;;
+;; #### Need to define the call interface for the functions.
+(defvar dui-method-history nil
+  "List of recently used dictionary methods.")
+
+;; Maybe would like to do something like the following?
+;An alist containing elements of the form (METHOD &rest LISTS).
+;
+;METHOD is a unique string naming the dictionary method.  Each element
+;of LISTS is a list of the form (TYPE DESCRIPTION INVOCATION &rest
+;ARGS), where TYPE is a symbol (one of 'search, 'insert, or 'edit)
+;indicating the context where this invocation is used, DESCRIPTION is a
+;string describing this method, INVOCATION is a function to call to
+;invoke this method, and the function will be applied to (cons TYPE
+;ARGS).
+(defvar dui-method-alist nil
+  "Registry of dictionary methods and utilities.
+
+An alist containing elements of the form (METHOD TYPE DESCRIPTION
+INVOCATION &rest ARGS).
+
+METHOD is a unique string naming the dictionary method.  TYPE is a
+symbol (one of 'search, 'insert, or 'edit) indicating the context
+where this invocation is used, DESCRIPTION is a string describing this
+method, INVOCATION is a function to call to invoke this method, and
+the function will be applied to (cons TYPE ARGS).")
+
+;; Method component access functions
+(defun dui-get-method-name (slot) (nth 0 slot))
+(defun dui-get-method-type (slot) (nth 1 slot))
+(defun dui-get-method-description (slot) (nth 2 slot))
+(defun dui-get-method-invocation (slot) (nth 3 slot))
+(defun dui-get-method-args (slot) (nthcdr 4 slot))
+
+(defvar dui-registration-errors nil
+  "String containing description of method registration problems.")
+
+;; Flush any old errors hanging around.
+(setq dui-registration-errors nil)
+
+(defun dui-register-method
+  (method type invocation description &rest args)
+  "Register a dictionary method.
+
+METHOD is a unique string naming the dictionary method.  TYPE
+indicates the context in which the method is used (a symbol, one of
+'search, 'insert, or 'edit).  INVOCATION is a function to call to
+invoke this method, which is applied to ARGS.  DESCRIPTION is a string
+describing this method.  The same INVOCATION function may be
+registered in different contexts with different descriptions and
+argument lists, but must have a different METHOD name in each context.
+
+It may be useful to include METHOD as an element of ARGS to allow the
+INVOCATION function to be used by several slightly different methods."
+  (if (assoc method dui-method-alist)
+      (setq dui-registration-errors
+	    (concat dui-registration-errors
+		    (format "%s\n" method)))
+    (setq dui-method-alist
+	  (cons (append (list method type description invocation) args)
+		dui-method-alist))))
+
+;; #### should this filter on type?  probably not.
+(defun dui-remove-method (method)
+  "Remove a dictionary method from the registry."
+  (interactive (completing-read "Remove method: " dui-method-alist nil t))
+  (setq dui-method-alist
+	(delete (assoc method dui-method-alist)
+		dui-method-alist)))
+
+(defun dui-filter (type list)
+  "Return the sub-list of methods from LIST whose type is TYPE."
+  (apply 'append
+	 (mapcar #'(lambda (method)
+		     (if (eq (dui-get-method-type (assoc method dui-method-alist)) type)
+			 (list method)
+		       nil))
+		 list)))
+
+(defun dui-read-method (type prompt &optional default)
+  "Read the name of a dictionary method from the minibuffer.
+
+If DEFAULT is non-nil, use that as the default, substituting it into
+PROMPT at the first `%s'.
+
+Signals an error on null input.  The return value is a string."
+  (if default (setq prompt (format prompt default)))
+  (let* ((completion-ignore-case t)
+	 ;; This binding is necessary if dui-method-history
+	 ;; is buffer local.  For the name of the variable, see comments
+	 ;; in lisp/minibuf.el on `read-from-minibuffer'; it's dynamic
+         ;; scope lossage.
+	 (naming-this-symbol-simply-history-loses
+	  (dui-filter 'search dui-method-history))
+	 ;; Ah, bogosity. Oberhasli croaks with wta listp, history.
+	 ;; For now leave it in anyway.
+	 (method (completing-read prompt dui-method-alist nil t nil
+				  'naming-this-symbol-simply-history-loses)))
+	 ;;(method (completing-read prompt dui-method-alist nil t)))
+    (if (and (> (length method) 0)
+	     (eq (dui-get-method-type (assoc method dui-method-alist)) type))
+	method
+      (error "No valid method was specified"))))
+
+;; #### Make a method for defining additional keymap entries for folks
+;;      who want secondary dictionaries available.
+(defun dui-invoke-method (type ask)
+  "Invoke a dictionary method.
+
+With ASK non-nil, read a method of type TYPE from the minibuffer and
+invoke it.
+
+With ASK null, invoke the last selected method, if there is one,
+otherwise read from minibuffer and invoke."
+
+  (let* ((default (car (dui-filter type dui-method-history)))
+	 (method (if (or ask (not default))
+		     (dui-read-method
+		      type
+		      (if default
+			  "Method (default %s): "
+			"Method: ")
+		      default)  
+		   default))
+	 (slot (assoc method dui-method-alist))
+	 (invocation (dui-get-method-invocation slot))
+	 (args (dui-get-method-args slot)))
+    (setq dui-method-history
+	  (cons method (delete method dui-method-history)))
+    (apply invocation args)))
+
+;; #### `dui-invoke-insert-method' and  `dui-invoke-edit-method' probably
+;;      don't need defaults or histories.  Instead, they should be part
+;;      of the information associated with the search method and they
+;;      should be automatically invoked depending on the success or
+;;      failure of the search mehtod.  (Insert methods should only be
+;;      invoked if the appropriate user variable is set.)
+;;;###autoload
+(defun dui-invoke-search-method (ask)
+  "Invokes a dictionary lookup method.
+
+If ASK is non-nil, reads a method from the minibuffer.  Otherwise invokes the
+current default search method.
+
+\\[dui-describe-method] gives help for individual methods."
+  (interactive "P")
+  (dui-invoke-method 'search ask))
+
+;;;###autoload
+(defun dui-invoke-insert-method (ask)
+  "Invokes a method to add a dictionary entry.
+
+If ASK is non-nil, reads a method from the minibuffer.  Otherwise invokes the
+current default insert method.
+
+\\[dui-describe-method] gives help for individual methods."
+  (interactive "P")
+  (dui-invoke-method 'insert ask))
+
+;;;###autoload
+(defun dui-invoke-edit-method (ask)
+  "Invokes a dictionary editing method.
+
+If ASK is non-nil, reads a method from the minibuffer.  Otherwise invokes the
+current default edit method.
+
+\\[dui-describe-method] gives help for individual methods."
+  (interactive "P")
+  (dui-invoke-method 'edit ask))
+
+;;;###autoload
+(defun dui-describe-method (method)
+  "Shows the docstring for METHOD (a string) in a temporary buffer."
+  (interactive (completing-read "Describe method: " dui-method-alist nil t))
+  (with-output-to-temp-buffer
+      (princ (dui-get-method-description method))))
+
+(defun dui-princ-errors ()
+  (if (and dui-warn-previously-registered-methods-p
+	   dui-registration-errors)
+      (progn
+	(princ "Methods are already registered by the following names.
+If you wish to register a new method under one of these names, please use
+`dui-remove-method' first.
+")
+	(princ dui-registration-errors)
+	(setq dui-registration-errors nil))))
+
+(provide 'dui)
+
+;; load up the default methods
+;; must come after the provide call to dui
+(require 'dui-registry)
+
+;;; dui.el ends here

File edict-dot-emacs-oda

+
+
+;;;; edict.el stuff
+(autoload 'edict-search-english "edict" "Search for a translation of an
+English word")
+(global-set-key "\e*" 'edict-search-english)
+(autoload 'edict-search-kanji "edict" "Search for a translation of a Kanji
+sequence")
+(global-set-key "\e_" 'edict-search-kanji)
+(autoload 'edict-insert "edict" "Insert the last translation")
+(global-set-key "\e+" 'edict-insert)
+(setq *edict-files*  '("/usr/lib/dict/edict"))
+
+(setq *edict-private-file* "~/.private-edict")
+

File edict-edit.el

+;;; edict-edit.el --- Edit an EDICT dictionary.
+
+;; Copyright (C) 1991, 1992 Per Hammarlund (perham@nada.kth.se)
+
+;; Author:      Per Hammarlund <perham@nada.kth.se>
+;; Keywords:    mule, edict, dictionary
+;; Version:     0.9.7
+;; Adapted-by:  Stephen J. Turnbull <turnbull@sk.tsukuba.ac.jp> for XEmacs
+;; Maintainer:  Stephen J. Turnbull <turnbull@sk.tsukuba.ac.jp>
+
+;;   This file is part of XEmacs.
+
+;;   XEmacs 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.
+
+;;   XEmacs 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 XEmacs; if not, write to the Free Software Foundation,
+;;   Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+;;; Commentary:
+
+;; Some code that looks for translations of english and japanese using the
+;; EDICTJ Public Domain japanese/english dictionary.
+
+;; Written by Per Hammarlund <perham@nada.kth.se>
+;; Morphology and private dictionary handling/editing by Bob Kerns
+;; <rwk@crl.dec.com>
+;; Helpful remarks from Ken-Ichi Handa <handa@etl.go.jp>.
+;; The EDICTJ PD dictionary is maintained by Jim Breen
+;; <jwb@monu6.cc.monash.edu.au>
+
+;;; To do:
+
+;;; Changelog:
+
+;;; Code:
+
+(provide 'edict-edit)
+
+;;; Customizable variables
+
+(defvar edict-use-electric-henkan nil
+  "Determines whether to use electric henkan mode in edict buffers.
+
+If t, use it; if nil, don't use it.  If 'ask, ask and (re)set the flag.")
+
+(defvar edict-verbose-electric-henkan t
+  "If non-nil, warns the user of electric changes in henkan state.")
+
+;;; Internal variables
+
+;; The previous configuration before adding an entry to a private dictionary.
+(defvar edict-previous-window-configuration nil)
+
+;; The previously-selected buffer before adding an entry.
+(defvar edict-previous-buffer nil)
+
+;; The filename of the file read in to add an entry to.
+(defvar edict-filename nil)
+
+(defvar edict-edit-mode-map nil
+  "Mode map used by edict-add-english/kanji.")
+
+;; Initialize our mode map.
+(unless edict-edit-mode-map
+  (setq edict-edit-mode-map (make-keymap))
+  (if (featurep 'xemacs)
+      (map-keymap (lambda (key)
+		    (define-key edict-edit-mode-map key 'edict-standin))
+		  edict-edit-mode-map)
+    (dotimes (i 128)
+      ;; I don't know how to invoke multi-char commands, so don't hook
+      ;; those.
+      (unless (consp (aref edict-edit-mode-map i))
+	(setf (aref edict-edit-mode-map i) 'edict-standin))))
+  (if (featurep 'xemacs)
+      (progn
+	(define-key edict-edit-mode-map [(control c)] nil)
+	(define-key edict-edit-mode-map [(control x)] nil)
+	(define-key edict-edit-mode-map [(escape)] nil))
+    (setf (aref edict-edit-mode-map 3) nil
+	  (aref edict-edit-mode-map 24) nil
+	  (aref edict-edit-mode-map 27) nil))
+  (define-key edict-edit-mode-map "\C-c\C-c" 'edict-exit)
+  (define-key edict-edit-mode-map "\C-x\C-s" 'edict-exit)
+  (define-key edict-edit-mode-map "\t" 'edict-tab)
+  (define-key edict-edit-mode-map "\r" 'edict-new-entry)
+  (define-key edict-edit-mode-map "\C-A" 'edict-beginning-of-line)
+  (define-key edict-edit-mode-map "\C-E" 'edict-end-of-line)
+  (define-key edict-edit-mode-map "[" 'edict-open-bracket)
+  (define-key edict-edit-mode-map "]" 'edict-close-bracket)
+  (define-key edict-edit-mode-map "/" 'edict-slash))
+
+;;; Functions
+
+;; Add an entry to a particular file, and update edict-buffer.
+;; Any of kanji/yomi/eigo may be omitted.  The user will be given
+;; an oportunity to edit and then it will be saved.
+
+;; #### This isn't interactive, but it's not an unreasonable entry point?
+(defun edict-add-entry-to-file (filename kanji yomi eigo)
+  (edict-init)
+  (setq filename (expand-file-name filename))
+  (let* ((previous-buffer (current-buffer))
+	 (buffer (find-file-noselect filename))
+	 (window (get-buffer-window buffer)))
+    (set-buffer buffer)
+    ;; If it's a new file, give it a version string to print on loadup.
+    (when (equal (point-min) (point-max))
+      (insert (format "$B!)!)!)!)(B /%s's private dictionary/\n"
+		      (user-login-name))))
+    ;;	Unless it's already in edict-edit mode, put it in that mode.
+    ;; This gives us our fancy electric-dictionary editing.
+    (unless (eq major-mode 'edict-edit-mode)
+      (edict-edit-mode))
+    ;; Unless we already have a configuration to go back to, remember
+    ;; this one.
+    (unless edict-previous-window-configuration
+      (setq edict-previous-window-configuration
+	    (current-window-configuration)))
+    (unless edict-previous-buffer
+      (setq edict-previous-buffer previous-buffer))
+    ;; Remember the filename, so we can update it in the *edict* buffer
+    ;; when we finish.
+    (setq edict-filename filename)
+    (if window
+	(select-window window)
+      (split-window nil 4))
+    (goto-char (point-max))
+    (edict-insert-entry kanji yomi eigo)
+    ;; Go into henkan mode if appropriate
+    (switch-to-buffer buffer)
+    (edict-set-henkan (or (null kanji) (null yomi)))))
+
+
+;; Turn on or off henkan
+;; Should work in any Mule environment, in particular, not require LEIM.
+;; #### Probably fails pretty impolitely if no Japanese input methods are
+;;	registered with Mule.
+;; The guts were copied from mule-commands.el (toggle-input-method).
+;;
+(defun edict-set-henkan (henkan-flag)
+  "Electrically turn on or off the current default Japanese text input method.
+
+If HENKAN-FLAG is nil, turn it off, otherwise turn it on.
+With arg, read an input method from minibuffer and turn it on."
+
+  (if (eq 'ask edict-use-electric-henkan)
+      (if (and (featurep 'xim)
+	       (y-or-n-p
+		"XIM and electric-henkan don't mix.  Disable electric-henkan"))
+	  (setq edict-use-electric-henkan nil)
+	(setq edict-use-electric-henkan t))
+    (setq edict-use-electric-henkan t))
+  (if edict-use-electric-henkan
+      (let* ((default (or (car input-method-history) default-input-method)))
+	(if (and current-input-method (not henkan-flag))
+	    (inactivate-input-method)
+	  ;; #### Need to ensure that the IM is Japanese.  Could do
+	  ;;	     by looking up in registry, and requiring confirmation
+	  ;;	     if some heuristic isn't satisfied. 
+	  (activate-input-method
+	   (if (or henkan-flag (not default))
+	       (read-input-method-name
+		(if default
+		    "Japanese input method (default %s): "
+		  "Japanese input method: " )
+		default t)  
+	     default))
+	  (or default-input-method
+	      (setq default-input-method current-input-method)))
+	(and edict-verbose-electric-henkan
+	     (message "Henkan is electrically %s."
+		      (if henkan-flag "on" "off"))))))
+
+;; Insert a dictionary entry at point.
+(defun edict-insert-entry (kanji yomi eigo)
+  ;; Make sure this is on a line of its own.
+  (let ((p (point)))
+    (beginning-of-line)
+    (unless (equal p (point))
+      (end-of-line)
+      (newline)))
+  ;; Now insert a standard entry.
+  (let ((start (point))
+	(p nil))
+    ;; Insert a new entry, leaving out any items which are nil,
+    ;; and also leaving out the yomi if the entry consists of only kana.
+    ;; "$BF|K\8l(B"
+    (if kanji
+	(insert kanji)
+      (setq p (point)))
+    (when yomi
+      (unless (string-match edict-yomi-regexp yomi)
+	(error "yomi must be in kana: %s." yomi)))
+    ;; "$BF|K\8l(B [$B$K$[$s$4(B]"
+    (cond ((and kanji
+		(string-match edict-yomi-regexp kanji)))
+	  (t (insert " [")
+	     (if yomi
+		 (insert yomi)
+	       (if (not p)
+		   (setq p (point))))
+	     (insert "]")))
+    ;; "$BF|K\8l(B [$B$K$[$s$4(B] /Japanese language/"
+    (cond ((null eigo)
+	   (insert " /")
+	   (unless p (setq p (point))))
+	  ((stringp eigo)
+	   (insert " /" eigo))
+	  ((consp eigo)
+	   (insert " ")
+	   (dolist (def eigo)
+	     (insert "/")
+	     (insert def)))
+	  (t (error "not a string or list of strings: %s" eigo)))
+    (insert "/\n")
+    ;; Go to the first un-filled-in field.
+    (goto-char (or p start))))
+
+;; Inverse of edict-insert-entry.  Parse an entry.
+;; (multiple-value-bind (kanji yomi english) (edict-parse-entry)
+;;    (edict-insert-entry kanji yomi english))
+;; duplicates the current line's entry.
+
+(defun edict-parse-entry ()
+  (let ((kanji nil)
+	(yomi nil)
+	(english nil)
+	(start nil)
+	(p nil)
+	(end nil))
+    (save-excursion
+      (end-of-line)
+      (setq end (point))
+      (beginning-of-line)
+      (setq start (point))
+      (search-forward " " end)
+      (setq p (1- (point)))
+      (when (> p start)
+	(setq kanji (buffer-substring start p)))
+      ;; Pick up the [yomi] if there are any.
+      (when (re-search-forward edict-yomi-part-regexp end t)
+	(setq yomi (buffer-substring (match-beginning 1) (match-end 1)))
+	(goto-char (match-end 0)))
+      ;; Collect up all the definitions.
+      (while (re-search-forward "/\\([^/\n]+\\)/" end t)
+	(goto-char (match-end 1))
+	(push (buffer-substring (match-beginning 1) (match-end 1)) english)))
+    (values kanji yomi english)))
+
+;;;###autoload
+(defun edict-edit-mode ()
+  "Major mode for editing edict entries.
+TAB      Tab to next field in this entry.
+RETURN   Start a new entry on the next line.
+c-A      Edit the kanji field, and start entering kanji.
+c-E      Go to the end, and start editing english.
+C-c C-c  Install the edited changes & save the file.
+C-x C-s  Install the edited changes & save the file.
+"
+  (interactive)
+  (kill-all-local-variables)
+  ;; Associate these with the buffer.
+  (make-local-variable 'edict-previous-window-configuration)
+  (make-local-variable 'edict-previous-bufffer)
+  (make-local-variable 'edict-filename)
+  (set-syntax-table text-mode-syntax-table)
+  (use-local-map edict-edit-mode-map)
+  (setq local-abbrev-table text-mode-abbrev-table)
+  (setq major-mode 'edict-edit-mode)
+  (setq mode-name "Edict")
+  (setq paragraph-start "^\\|$")
+  (setq paragraph-separate "^\\|$")
+  (run-hooks 'text-mode-hook))
+
+;; Automagically pick the right mode, based on where we are in the string.
+;; That's henkan mode when we're in the entry or yomi sections, and english
+;; in the translation section.
+;; #### Can this be better done with extents or overlays?
+(defun edict-auto-set-henkan ()
+  (save-excursion
+    (let ((x (point))
+	  (end nil))
+      (end-of-line)
+      (setq end (point))
+      (beginning-of-line)
+      (edict-set-henkan
+       (or (looking-at "$")
+	   (when (re-search-forward "[]/]" end t)
+	     (<= x (match-beginning 0))))))))
+
+(defun edict-standin ()
+  "Invoke the command we would otherwise have invoked, after being sure
+we're in the right mode."
+  (interactive)
+  ;; #### This is evil, I think.
+  (setq this-command (aref global-map last-command-char))
+  (edict-execute-dictionary-command
+   (function (lambda ()
+	       (command-execute this-command)))))
+
+(defun edict-execute-dictionary-command (function)
+  (edict-auto-set-henkan)
+  (let ((buffer (current-buffer)))
+    ;; Canonicalize the end to end in exactly one slash.
+    (unless (<= (point) (point-min))
+      (save-excursion
+	(backward-char 1)
+	(when (looking-at "//\n")
+	  (forward-char 1)
+	  (delete-char 1))))
+    (funcall function)
+    ;; Canonicalize the end of the line to end in exactly one slash.
+    (save-excursion
+      (end-of-line)
+      (delete-horizontal-space)
+      (unless (<= (point) (point-min))
+	(backward-char 2)
+	(while (looking-at "//")
+	  ;; Two in a row; delete the second.
+	  (forward-char 1)
+	  (delete-char 1)
+	  (backward-char 2))
+	(forward-char 1)
+	(unless (looking-at "\n")
+	  (unless (looking-at "[/\n]")
+	    (end-of-line)
+	    (unless (edict-line-has-english)
+	      (insert " /"))
+	    (insert ?/)))))
+    ;; Then if we are at the end, make it end in two, for the sake of visual feedback.
+    ;; Except if we're on a blank line, don't add anything.
+    (unless (<= (point) (point-min))
+      (unless (save-excursion
+		(end-of-line)
+		(backward-char 1)
+		(looking-at "\n"))
+	(when (looking-at "\n")
+	  (insert "/")
+	  (backward-char 1))
+	(save-excursion
+	  (end-of-line)
+	  ;; Make sure there's a trailing newline.
+	  (when (>= (point) (point-max))
+	    (newline)
+	    (backward-char 1))
+	  (let ((end (point)))
+	    (beginning-of-line)
+	    (when (search-forward "/" end t)
+	      (when (looking-at "\n")
+		(insert "/")))))))
+    ;; Only set the henkan if we're still in the same buffer.
+    (when (eq buffer (current-buffer))
+      (edict-auto-set-henkan))))
+
+(defun edict-line-has-english (&optional complete)
+  (save-excursion
+    (let ((p (point)))
+      (end-of-line)
+      (let ((end (point)))
+	(goto-char p)
+	(beginning-of-line)
+	(if complete
+	    (re-search-forward "/[^/\n]+/" end t)
+	  (re-search-forward "/" end t))))))
+
+(defvar *brackets-allowed-in-english* nil
+  "*Allow brackets in the english section of dictionary entries, if non-null.")
+
+(defun edict-open-bracket ()
+  "Begin editing the yomi section of the entry, at the beginning of the entry.
+Self-inserts if in the english section."
+  (interactive)
+  (edict-execute-dictionary-command (function (lambda ()
+						(edict-char-bracket t)))))
+
+(defun edict-close-bracket ()
+  "Begin editing the yomi section of the entry, at the end of the entry.
+Self-inserts if in the english section.."
+  (interactive)
+  (edict-execute-dictionary-command (function (lambda ()
+						(if (looking-at "\\]")
+						    (edict-tab)
+						  (edict-char-bracket nil))))))
+
+(defun edict-char-bracket (open-p)
+  (let ((p (point)))
+    (end-of-line)
+    (let ((end (point)))
+      (beginning-of-line)
+      (cond ((and *brackets-allowed-in-english*
+		  (save-excursion
+		    (re-search-forward "/[^\n/]*/" end t))
+		  (<= (match-beginning 0) p))
+	     (goto-char p)
+	     (edict-standin))
+	    ((re-search-forward edict-yomi-part-regexp end t)
+	     (goto-char (or (if open-p
+				(match-beginning 1)
+			      (match-end 1))
+			    ;; Empty
+			    (1+ (match-beginning 0)))))
+	    ((re-search-forward "[ \t]" end t)
+	     (goto-char (match-beginning 0))
+	     (insert " []")
+	     (backward-char 1))
+	    (t (goto-char p)
+	       (edict-standin))))))
+
+(defun edict-slash ()
+  "Begin editing the english section of the entry, at the start of the entry.
+Self-inserts if in the english section."
+  (interactive)
+  (edict-execute-dictionary-command (function edict-slash-internal)))
+
+(defun edict-slash-internal ()
+  (if (looking-at "/\n")
+      (forward-char)
+    (let ((p (point)))
+      (end-of-line)
+      (let ((end (point)))
+	(beginning-of-line)
+	(cond ((and (save-excursion
+		      (re-search-forward "/[^/\n]*/" end t))
+		    (<= (match-beginning 0) p))
+	       (goto-char p)
+	       (edict-standin))
+	      ((search-forward "/" end t))
+	      ;; On an empty line, just insert a definition.
+	      ((looking-at "$")
+	       (insert " //")
+	       (backward-char 1))
+	      ;; Otherwise, this line has no english, go to the end and add one.
+	      (t (end-of-line)
+		 (backward-char 1)
+		 (unless (looking-at " ")
+		   (insert " "))
+		 (insert "//")
+		 (backward-char 1)))))))
+
+(defun edict-tab ()
+  "Tab to the next edict field in this entry.
+At the end, wraps back to the beginning.."
+  (interactive)
+  (edict-execute-dictionary-command (function edict-tab-internal)))
+
+(defun edict-tab-internal ()
+  (let ((p (point))
+	(end nil))
+    (end-of-line)
+    (setq end (point))
+    (goto-char p)
+    (cond ((re-search-forward "[ \t]\\(\\[\\)\\|\\(/\\)" end t)
+	   (let ((f-begin (or (match-beginning 1) (match-beginning 2)))
+		 (f-end (or (match-end 1) (match-end 2))))
+	     (goto-char f-begin)
+	     (edict-set-henkan (looking-at "\\["))
+	     (goto-char f-end)))
+	  (t (beginning-of-line)
+	     (edict-set-henkan t)))))
+
+(defun edict-beginning-of-line ()
+  "Go to the beginning of the edict entry."
+  (interactive)
+  (edict-execute-dictionary-command (function (lambda ()
+						(beginning-of-line)
+						(edict-set-henkan t)))))
+
+(defun edict-end-of-line ()
+  "Go to the beginning of the edict entry."
+  (interactive)
+  (edict-execute-dictionary-command (function (lambda ()
+						(end-of-line)
+						(edict-set-henkan nil)))))
+
+(defun edict-new-entry (arg)
+  "Start a new edict entry on the next line.
+If given an argument, copies the word but not the yomi or english.
+If given an argument > 4 (i.e. c-U c-U), copies the word and definition,
+but not the yomi."
+  (interactive "P")
+  (edict-execute-dictionary-command (function (lambda ()
+						(edict-new-entry-internal arg)))))
+
+(defun edict-new-entry-internal (arg)
+  (end-of-line)
+  ;;clean up in the dictionary to save space.
+  (delete-horizontal-space)
+  ;;first check that the last thing on this line is a '/', otherwise add one.
+  (unless (<= (point) (point-min))
+    (backward-char)
+    (unless (looking-at "/")
+      (end-of-line)
+      (insert "/"))
+    (multiple-value-bind (kanji yomi english)
+	(edict-parse-entry)
+      (end-of-line)
+      (if (>= (point) (point-max))
+	  (newline)
+	(forward-char 1))
+      (cond ((null arg)
+	     (edict-insert-entry nil nil nil))
+	    ((<= (prefix-numeric-value arg) 4)
+	     (edict-insert-entry kanji nil nil))
+	    (t (edict-insert-entry kanji nil english))))))
+
+(defun edict-exit ()
+  "Exit the editing of a private edict file, saving the buffer and updating the
+running copy of the dictionary, and restoring the window configuration."
+  (interactive)
+  (save-buffer)
+  (let* ((buffer (current-buffer))
+	 (edict-private-buffer (find-file-noselect (expand-file-name edict-user-dictionary)))
+	 (filename (or edict-filename (buffer-file-name edict-private-buffer)))
+	 (configuration edict-previous-window-configuration)
+	 (previous-buffer edict-previous-buffer))
+    (setq edict-previous-window-configuration nil
+	  edict-previous-buffer nil)
+    (set-buffer edict-buffer)
+    (goto-char (point-min))
+    (let ((begin-marker (format "%s %s" *edict-file-begin-marker* filename))
+	  (end-marker (format "%s %s" *edict-file-end-marker* filename)))
+      (if (search-forward begin-marker nil t)
+	  (progn
+	    (forward-line 1)
+	    (let ((loc (point)))
+	      (search-forward end-marker)
+	      (forward-line 0)
+	      (delete-region loc (point))
+	      (goto-char loc)))
+	;; Handle new file
+	(insert (format "%s\n%s\n" begin-marker end-marker))
+	(forward-line -1))
+      (insert-buffer buffer)
+      (when configuration
+	(set-window-configuration configuration))
+      (when previous-buffer
+	(switch-to-buffer previous-buffer)))))
+
+;;;###autoload
+(defun edict-add-word ()
+  "Add any word to the private dictionary."
+  (interactive)
+  (edict-add-entry-to-file edict-user-dictionary nil nil nil))
+
+;;;###autoload
+(defun edict-add-english ()
+  "Add the english word at point to the dictionary."
+  (interactive)
+  (let ((word (edict-get-english-word)))
+    (when word
+      (edict-add-entry-to-file edict-user-dictionary nil nil word))))
+
+;;;###autoload
+(defun edict-add-kanji (min max)
+  "Add the region as a kanji entry in the dictionary."
+  (interactive "r")
+  (edict-add-entry-to-file edict-user-dictionary
+			   (edict-clean-up-kanji (buffer-substring min max))
+			   nil nil))
+
+;;; edict-edit.el ends here

File edict-english.el

+;;; edict-english.el --- English morphology rules for edict.el
+
+;; Copyright (C) 1991, 1992 Per Hammarlund (perham@nada.kth.se)
+
+;; Author:      Per Hammarlund <perham@nada.kth.se>
+;; Keywords:    mule, edict, dictionary
+;; Version:     0.9.7
+;; Adapted-by:  Stephen J. Turnbull <turnbull@sk.tsukuba.ac.jp> for XEmacs
+;; Maintainer:  Stephen J. Turnbull <turnbull@sk.tsukuba.ac.jp>
+
+;;   This file is part of XEmacs.
+
+;;   XEmacs 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.
+
+;;   XEmacs 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 XEmacs; if not, write to the Free Software Foundation,
+;;   Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+;;; Commentary:
+
+;; Some code that looks for translations of english and japanese using the
+;; EDICTJ Public Domain japanese/english dictionary.
+
+;; Written by Per Hammarlund <perham@nada.kth.se>
+;; Morphology and private dictionary handling/editing by Bob Kerns
+;; <rwk@crl.dec.com>
+;; Helpful remarks from Ken-Ichi Handa <handa@etl.go.jp>.
+;; The EDICTJ PD dictionary is maintained by Jim Breen
+;; <jwb@monu6.cc.monash.edu.au>
+
+;; English morphological rules
+
+;;; To do:
+
+;;; Changelog:
+
+;; 1998-03-27  Stephen Turnbull  <turnbull@sk.tsukuba.ac.jp>
+;;        (created):  broken out from monolithic edict.el
+
+;;; Code:
+
+(provide 'edict-english)
+
+(require 'edict-morphology)
+
+(define-edict-rule english-plural
+  "\\([^i][^e]\\|i[^e]\\|[^i]e\\)\\(s\\)$"
+  (english english-noun)
+  edict-subst-affix edict-identity edict-ignore)
+
+(define-edict-rule english-plural-ies
+  "\\(ies\\)$"
+  (english english-noun)
+  edict-subst-affix "y")
+
+;;; edict-english.el ends here

File edict-japanese.el

+;;; edict-japanese.el --- Japanese morphology rules for edict.el
+
+;; Copyright (C) 1991, 1992 Per Hammarlund (perham@nada.kth.se)
+
+;; Author:      Per Hammarlund <perham@nada.kth.se>
+;; Keywords:    mule, edict, dictionary
+;; Version:     0.9.7
+;; Adapted-by:  Stephen J. Turnbull <turnbull@sk.tsukuba.ac.jp> for XEmacs
+;; Maintainer:  Stephen J. Turnbull <turnbull@sk.tsukuba.ac.jp>
+
+;;   This file is part of XEmacs.
+
+;;   XEmacs 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.
+
+;;   XEmacs 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 XEmacs; if not, write to the Free Software Foundation,
+;;   Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+;;; Commentary:
+
+;; Some code that looks for translations of english and japanese using the
+;; EDICTJ Public Domain japanese/english dictionary.
+
+;; Written by Per Hammarlund <perham@nada.kth.se>
+;; Morphology and private dictionary handling/editing by Bob Kerns
+;; <rwk@crl.dec.com>
+;; Helpful remarks from Ken-Ichi Handa <handa@etl.go.jp>.
+;; The EDICTJ PD dictionary is maintained by Jim Breen
+;; <jwb@monu6.cc.monash.edu.au>
+
+;; Japanese morphological rules
+
+;;; To do:
+
+;;; Changelog:
+
+;; 1998-03-27  Stephen Turnbull  <turnbull@sk.tsukuba.ac.jp>
+;;        (created):  broken out from monolithic edict.el
+
+;;; Code:
+
+(provide 'edict-japanese)
+
+(require 'edict-morphology)
+
+;; Strip "$B$$$^$9(B"
+(define-edict-rule $B!V$$$^$9!W$r:o=|$9$k(B
+  (concat "\\(" edict-category-c "\\|" edict-category-h
+	  "\\)\\([$B$$$-$.$7$A$K$S$_$j(B]\\)\\($B$^(B\\($B$9(B\\|$B$;$s(B\\)\\)$")
+  "$B$^$;$k(B$"
+  edict-subst-modified-affix
+  edict-identity ()
+  edict-modify-verb (1 2)
+  edict-ignore ())
+
+(define-edict-rule $B!V$^$9!W$r:o=|$9$k(B
+  (concat "\\(" edict-category-c
+	  "\\|[$B$$$-$.$7$A$K$S$_$j$($1$2$;$F$M$Y$a$l(B]\\)\\($B$^(B\\($B$9(B\\|$B$;$s(B\\)\\)$")
+  "$B$^$;$k(B$"
+  edict-subst-affix edict-identity "$B$k(B")
+
+(define-edict-rule $B!VMh$^$9!W$NFCJL%k!<%k(B
+  "\\($BMh$^(B\\($B$9(B\\|$B$;$s(B\\)\\)$"
+  ()
+  edict-subst-affix "$BMh$k(B")
+
+(define-edict-rule $B!V$-$^$9!W$NFCJL%k!<%k(B
+  "\\(^\\|$B$F(B\\|$B$s$G(B\\)\\($B$-$^(B\\($B$9(B\\|$B$;$s(B\\)\\)$"
+  "$B$^$;$k(B$"
+  edict-subst-modified-affix
+  edict-identity ()
+  edict-subst ("$B$/$k(B"))
+
+(define-edict-rule $B!V$7$^$9!W$NFCJL%k!<%k(B
+  "\\($B$7$^(B\\($B$9(B\\|$B$;$s(B\\)\\)$"
+  ()
+  edict-subst-affix "$B$9$k(B")
+
+;; The several cases of $B$F!?$C$F(B.
+;;  Note either pattern may generate multiple possibilities.
+;; Also, $B$?(B.
+(define-edict-rule $B!V$F!?$?!W$+$i!V$&!W$^$GJQ49$9$k(B
+  "\\($B$C(B\\($B$F(B\\|$B$?(B[$B$i(B]?\\)\\)$" 
+  ()
+  edict-subst-affix "$B$&(B")
+
+(define-edict-rule $B!V$F!?$?!W$+$i!V$D!W$^$GJQ49$9$k(B
+  "\\($B$C(B\\($B$F(B\\|$B$?(B[$B$i(B]?\\)\\)$" 
+  ()
+  edict-subst-affix "$B$D(B")
+
+(define-edict-rule $B!V$F!?$?!W$+$i!V$k!W$^$GJQ49$9$k(B
+  "\\($B$C(B\\($B$F(B\\|$B$?(B[$B$i(B]?\\)\\)$" 
+  ()
+  edict-subst-affix "$B$k(B")
+
+(define-edict-rule $B0lCJ$N!V$F!?$?!W$+$i!V$k!W$^$GJQ49$9$k(B
+  (concat "\\(" edict-category-c
+	  "\\|[$B$$$-$.$7$A$K$S$_$j$($1$2$;$F$M$Y$a$l(B]\\)\\(\\($B$F(B\\|$B$?(B[$B$i(B]?\\)\\)$")
+  ()
+  edict-subst-affix edict-identity "$B$k(B")
+
+(define-edict-rule $B!V$F!?$?!W$+$i!V$9!W$^$GJQ49$9$k(B
+  "\\($B$7(B\\($B$F(B\\|$B$?(B[$B$i(B]?\\)\\)$" 
+  ()
+  edict-subst-affix "$B$9(B")
+
+(define-edict-rule $B!V$F!?$?!W$+$i!V$/!W$^$GJQ49$9$k(B
+  "\\($B$$(B\\($B$F(B\\|$B$?(B[$B$i(B]?\\)\\)$" 
+  ()
+  edict-subst-affix "$B$/(B")
+
+(define-edict-rule $B!V$F!?$?!W$+$i!V$0!W$^$GJQ49$9$k(B
+  "\\($B$$(B[$B$G$@(B]\\)$" 
+  ()
+  edict-subst-affix "$B$0(B")
+
+(define-edict-rule $B!V$F!?$?!W$+$i!V$V!W$^$GJQ49$9$k(B
+  "\\($B$s(B\\($B$G(B\\|$B$@(B[$B$i(B]?\\)\\)$" 
+  ()
+  edict-subst-affix "$B$V(B")
+
+(define-edict-rule $B!V$F!?$?!W$+$i!V$`!W$^$GJQ49$9$k(B
+  "\\($B$s(B\\($B$G(B\\|$B$@(B[$B$i(B]?\\)\\)$" 
+  ()
+  edict-subst-affix "$B$`(B")
+
+(define-edict-rule $B!V$F!?$?!W$+$i!V$L!W$^$GJQ49$9$k(B
+  "\\($B$s(B\\($B$G(B\\|$B$@(B[$B$i(B]?\\)\\)$" 
+  ()
+  edict-subst-affix "$B$L(B")
+
+;; $B9T$/(B is an irregular verb.
+(define-edict-rule $B9T$/$NFCJL%k!<%k(B
+  "$B9T(B\\($B$C(B\\($B$F(B\\|$B$?(B[$B$i(B]?\\)\\)$"
+  ()
+  edict-subst-affix "$B$/(B")
+
+(define-edict-rule $B!VMh$F!W$NFCJL%k!<%k(B
+  "$BMh(B\\($B$F(B\\|$B$?(B[$B$i(B]?\\)$"
+  ()
+  edict-subst-affix "$BMh$k(B")
+
+(define-edict-rule $B!V$-$F!W$NFCJL%k!<%k(B
+  "\\($B$-$F(B\\|$B$-$?(B[$B$i(B]?\\)$"
+  ()
+  edict-subst-affix "$B$/$k(B")
+
+(define-edict-rule $B!V$7$F!W$NFCJL%k!<%k(B
+  "\\($B$7$F(B\\|$B$7$?(B[$B$i(B]?\\)$"
+  ()
+  edict-subst-affix "$B$9$k(B")
+
+;; Potential form.
+;; The filters here are due to $B!V0lCJ$N!V$F!?$?!W$+$i!V$k!W$^$GJQ49$9$k!W(B
+(define-edict-rule $B$l$k(B
+  (concat "\\(" edict-category-c "\\|" edict-category-h "\\)\\($B$l$k(B\\)$")
+  "$B$l$F(B$"
+  edict-subst-affix edict-identity "$B$k(B")
+
+(define-edict-rule $B$1$k(B
+  (concat "\\(" edict-category-c "\\|" edict-category-h "\\)\\($B$1$k(B\\)$")
+  "$B$1$F(B$"
+  edict-subst-affix edict-identity "$B$/(B")
+
+(define-edict-rule $B$;$k(B
+  (concat "\\(" edict-category-c "\\|" edict-category-h "\\)\\($B$;$k(B\\)$")
+  "$B$;$F(B$"
+  edict-subst-affix edict-identity "$B$9(B")
+
+(define-edict-rule $B$F$k(B
+  (concat "\\(" edict-category-c "\\|" edict-category-h "\\)\\($B$F$k(B\\)$")
+  "\\($B$F(B\\|$B$F$i$l$k(B\\)$"
+  edict-subst-affix edict-identity "$B$D(B")
+
+(define-edict-rule $B$M$k(B
+  (concat "\\(" edict-category-c "\\|" edict-category-h "\\)\\($B$M$k(B\\)$")
+  "$B$M$F(B"
+  edict-subst-affix edict-identity "$B$L(B")
+
+(define-edict-rule $B$a$k(B
+  (concat "\\(" edict-category-c "\\|" edict-category-h "\\)\\($B$a$k(B\\)$")
+  "$B$a$F(B"
+  edict-subst-affix edict-identity "$B$`(B")
+
+(define-edict-rule $B$((B
+  (concat "\\(" edict-category-c "\\|" edict-category-h "\\)\\($B$($k(B\\)$")
+  "$B$($F(B"
+  edict-subst-affix edict-identity "$B$&(B")
+
+(define-edict-rule $B$2$k(B
+  (concat "\\(" edict-category-c "\\|" edict-category-h "\\)\\($B$2$k(B\\)$")
+  "$B$1$F(B"
+  edict-subst-affix edict-identity "$B$0(B")
+
+(define-edict-rule $B$Y$k(B
+  (concat "\\(" edict-category-c "\\|" edict-category-h "\\)\\($B$Y$k(B\\)$")
+  "$B$Y$F(B"
+  edict-subst-affix edict-identity "$B$V(B")
+
+;; $B0lCJF0;l!#(B Also serves for the passive.
+(define-edict-rule $B$i$l$k(B
+  (concat "\\(" edict-category-c
+	  "\\|[$B$$$-$.$7$A$K$S$_$j$($1$2$;$F$M$Y$a$l(B]\\)\\($B$i$l$k(B\\)$")
+  ()
+  edict-subst-affix edict-identity "$B$k(B")
+
+;; Passive
+(define-edict-rule $B8^CJF0;l$N!V$"$l$k!W$rJQ49$9$k(B 
+  "\\([$B$o$+$,$5$?$J$^$P$i(B]\\)\\($B$l$k(B\\)$"
+  ()
+  edict-subst-modified-affix
+  edict-modify-verb (0 2)
+  edict-ignore ())
+
+(define-edict-rule $BMh$i$l$k$N%k!<%k(B
+  "$BMh(B\\($B$i$l$k(B\\)$"
+  ()
+  edict-subst-affix "$B$k(B")
+
+(define-edict-rule $B$5$l$k$N%k!<%k(B
+  "\\($B$5$l$k(B\\)$"
+  ()
+  edict-subst-affix "$B$9$k(B")
+
+;; Causative
+(define-edict-rule $B8^CJF0;l$N!V$"$;$k!W$rJQ49$9$k(B 
+  "\\([$B$o$+$,$5$?$J$^$P$i(B]\\)\\($B$;$k(B\\)$"
+  ()
+  edict-subst-modified-affix
+  edict-modify-verb (0 2)
+  edict-ignore ())
+
+(define-edict-rule $B0lCJF0;l$N!V$"$;$k!W$rJQ49$9$k(B 
+  (concat "\\(" edict-category-c
+	  "\\|[$B$$$-$.$7$A$K$S$_$j$($1$2$;$F$M$Y$a$l(B]\\)\\($B$5$;$k(B\\)$")
+  ()
+  edict-subst-affix edict-identity "$B$k(B")
+
+(define-edict-rule $B$5$;$k$N%k!<%k(B
+  "\\($B$5$;$k(B\\)$"
+  ()
+  edict-subst-affix "$B$9$k(B")
+
+;; eba conditional form.
+(define-edict-rule $B!V$($P!W$rJQ49$9$k(B "\\([$B$($1$2$;$F$M$Y$a$l(B]\\)\\($B$P(B\\)$"
+  ()
+  edict-subst-modified-affix
+  edict-modify-verb (3 2)
+  edict-ignore ())
+
+;; tara conditional form is handled as part of the $B$F!?$?!?$?$i(B rules.
+
+;; The informal negative form.