133 lines
5.9 KiB
HTML
133 lines
5.9 KiB
HTML
<!--startcut ==========================================================-->
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
|
|
<HTML>
|
|
<HEAD>
|
|
<title>Dict Continued LG #34</title>
|
|
</HEAD>
|
|
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#A000A0"
|
|
ALINK="#FF0000">
|
|
<!--endcut ============================================================-->
|
|
|
|
<H4>
|
|
"Linux Gazette...<I>making Linux just a little more fun!</I>"
|
|
</H4>
|
|
|
|
<P> <HR> <P>
|
|
<!--===================================================================-->
|
|
|
|
<center><h1>
|
|
<font color="maroon">Dict Continued</font>
|
|
</h1></center>
|
|
<center>
|
|
<h4>By <a href="mailto: layers@marktwain.net">Larry Ayers</a></h4>
|
|
</center>
|
|
|
|
<hr>
|
|
|
|
<p>Last month I wrote about the DICT client-server protocol, a GPL-licensed
|
|
system for looking up words in a variety of dictionary databases. I received
|
|
some feedback from Rik Faith, DICT's primary developer, in response to my
|
|
statements concerning the server's memory usage. Here is a quote from the
|
|
message:<br>
|
|
|
|
<blockquote>
|
|
|
|
<p>In your review, you mention that dictd requires a lot of memory to run, and
|
|
suggest that people may not want to run the service all of the time. First,
|
|
since dictd memory maps all of the files that it uses, ps may show that it is
|
|
"using" far more memory than it actually is. I suspect that this may vary
|
|
between kernel versions and ps, depending on how mmap'd memory is reported.
|
|
Second, dictd doesn't do anything when it is waiting for a socket connection,
|
|
so the memory it uses will be swapped out over time. Hence, I think it should
|
|
be fine to start dictd at boot time and to leave it running -- I do this on my
|
|
underpowered laptop and it works out ok in the sense that dictd doesn't use
|
|
any resources when it is not responding to queries. If you happened to notice
|
|
a situation where a waiting dictd is using cpu time, then that's a bug that
|
|
I'd like to fix.
|
|
|
|
<p>Thanks for your review of dict-related software -- I hope we can improve
|
|
dictd and related tools a great deal over the next 6-12 months.
|
|
</blockquote>
|
|
|
|
<p>I was curious about the dictionary index files and just how they had been
|
|
generated. In response to my query, Faith responded:<br>
|
|
|
|
<blockquote>
|
|
We currently write one-off scripts for each input database. These sources
|
|
are all distributed on the ftp site. We are moving toward a dictionary
|
|
interchange format (DICF) from which indexes will be automatically
|
|
generated. But one-off scripts will still be required to convert the
|
|
databases into DICF format. We expect, however, that a large amount of new
|
|
material will be written directly in DICF. Our plan was to have DICF ready
|
|
by 4Q1998, but this schedule may slip.
|
|
</blockquote>
|
|
|
|
<hr>
|
|
|
|
<p>When I first began to use the DICT system, it occurred to me that an Emacs
|
|
mode would be useful, so that a keystroke would open up a window showing
|
|
definitions of the word under the cursor. Some time later I was browsing the
|
|
<i>gnu.emacs.sources</i> newsgroup and happened to find two independently
|
|
developed dict.el files, both functional but with slightly different features.
|
|
|
|
<p>Alexander Vorobiev's version was the first one I tried. It works well
|
|
under both GNU Emacs and XEmacs. This dict.el doesn't have any mouse bindings
|
|
included, but does have a feature I appreciate: rather than directly sending
|
|
the input word to the <i>dictd</i> server, the word first appears in the
|
|
mini-buffer at the bottom of the screen, allowing it to be edited first. For
|
|
example, this can useful if you would like the singular rather than the plural
|
|
form of a word defined, or if the definition of a phrase is sought.
|
|
|
|
<p>The other dict.el was written by Shenghuo Zhu. This one also will work on
|
|
both emacsen, but the mouse-binding (button two looks up the word under the
|
|
cursor) works only with GNU Emacs, though it probably wouldn't be too
|
|
difficult to adapt it to XEmacs. Syntax-highlighting for GNU Emacs is also
|
|
included.
|
|
|
|
<p>Both modes allow a keystroke combination to be set for looking up a word;
|
|
I've been using <kbd>Control-c-Enter</kbd>. Since the two files are small, I've
|
|
bundled them into one gzipped tar archive and included them with this issue of
|
|
the Gazette. You can find the file <a href="./ayers_dictmodes.tar.gz">here</a>.
|
|
Instructions for installation of the modes can be found near the beginning of
|
|
each file. In the archive you will find that one of the modes has been renamed
|
|
dict2.el; before using that mode it should have its original name, dict.el, restored.
|
|
|
|
<p>Dict-mode can even be used as a substitute for the Emacs Ispell
|
|
spell-check interface. If a misspelled word is passed to the <i>dictd</i>
|
|
server, a response such as this will be generated:<br>
|
|
|
|
<pre>
|
|
No definitions found for "arcive", perhaps you mean:
|
|
web1913: Archive Argive Arrive
|
|
wn: archive Argive arrive
|
|
foldoc: archive
|
|
</pre>
|
|
|
|
<p>Of course Ispell is more suitable for spell-checking an entire buffer, but
|
|
if a single word's spelling is doubtful, dict-mode offers an alternate solution.
|
|
|
|
<hr>
|
|
<!-- hhmts start -->
|
|
Last modified: Wed 28 Oct 1998
|
|
<!-- hhmts end -->
|
|
|
|
<!--===================================================================-->
|
|
<P> <hr> <P>
|
|
<center><H5>Copyright © 1998, Larry Ayers <BR>
|
|
Published in Issue 34 of <i>Linux Gazette</i>, November 1998</H5></center>
|
|
|
|
<!--===================================================================-->
|
|
<P> <hr> <P>
|
|
<A HREF="./index.html"><IMG ALIGN=BOTTOM SRC="../gx/indexnew.gif"
|
|
ALT="[ TABLE OF CONTENTS ]"></A>
|
|
<A HREF="../index.html"><IMG ALIGN=BOTTOM SRC="../gx/homenew.gif"
|
|
ALT="[ FRONT PAGE ]"></A>
|
|
<A HREF="./bennet.html"><IMG SRC="../gx/back2.gif"
|
|
ALT=" Back "></A>
|
|
<A HREF="./ayers2.html"><IMG SRC="../gx/fwd.gif" ALT=" Next "></A>
|
|
<P> <hr> <P>
|
|
<!--startcut ==========================================================-->
|
|
</BODY>
|
|
</HTML>
|
|
<!--endcut ============================================================-->
|