Difference between revisions of "Edict"

From WikEmacs
Jump to navigation Jump to search
(added where to find edict.el package)
m (→‎Linux: formatting fix)
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
{{Package
 +
|name=edict
 +
|description=provides interface for dictionary lookup.
 +
|source= SUSE, Debian, and Ubuntu packages are available, works on Windows XP
 +
|maintainer= Roland Mas, Debian package mainainer
 +
|in_emacs=no
 +
|Development status=inactive
 +
}}
 +
 
The elisp package edict.el is an instance of [[Lookup]]. It is often referred to simply as edict, which is confusing because it is associated with Edict, the Japanese dictionary. The lisp package can work with other dictionaries.
 
The elisp package edict.el is an instance of [[Lookup]]. It is often referred to simply as edict, which is confusing because it is associated with Edict, the Japanese dictionary. The lisp package can work with other dictionaries.
  
 
edict.el allows searching a local dictionary (e.g. Edict, Kanjidic) for character at point or a region. Search results are displayed in an Emacs buffer.
 
edict.el allows searching a local dictionary (e.g. Edict, Kanjidic) for character at point or a region. Search results are displayed in an Emacs buffer.
  
 +
For a time edict.el was developed for XEmacs, but version 0.9.8 was an "FSF and XEmacs-21 compatibility release". The SUSE edict-emacs-0.9.8-972.2.rpm works on GNU Emacs 24.0.94.1 on Windows XP (so presumably on Gnu Emacs 24 on Linux).
 +
 +
It is not clear who the code maintainer is, as searches point to former maintainers. The most recent info suggests that Roland Mas is the current Debian package maintainer, but it does not look like the elisp code is under development.
  
 +
==Usage==
 +
*{{Command|edict-search-english}} (prompts for word to search for)
 +
*{{Command|edict-search-kanji}} (first highlight a character or sequence)
  
 
==Package availability==
 
==Package availability==
 
===Linux===
 
===Linux===
There are SUSE linux RPMs for both edict.el and EDICT (the Japanese-English dictionary). Note that you can create your own dictionary, or use other dictionaries.
+
There are SUSE Linux RPMs for both edict.el and EDICT (the Japanese-English dictionary).
 
 
<add link to rpmfind here>
 
  
 +
{{note}}You can create your own dictionary, or use other dictionaries.
 
* edict-emacs-0.9.8-972.2  edict.el, an Emacs Front-end for EDICT
 
* edict-emacs-0.9.8-972.2  edict.el, an Emacs Front-end for EDICT
 
* edict-20060807-136.2    The Japanese Dictionary Files for Jim Breen's EDICT Project
 
* edict-20060807-136.2    The Japanese Dictionary Files for Jim Breen's EDICT Project
  
===Windows XP==
+
There is also a Debian package edict-el and an Ubuntu package.
 +
 
 +
===Windows XP===
 
The Suse RPMs can also be used on Windows XP. Use 7-Zip on the RPM, and then the enclosed cpio archive. It will create a usr/share/emacs/site-lisp/edict hierarchy, but you can move the edict folder or just its contents to anywhere, then add to load-path.
 
The Suse RPMs can also be used on Windows XP. Use 7-Zip on the RPM, and then the enclosed cpio archive. It will create a usr/share/emacs/site-lisp/edict hierarchy, but you can move the edict folder or just its contents to anywhere, then add to load-path.
 +
 +
Tested OK on Windows XP with GNU Emacs 24.0.94.1 (i386-mingw-nt5.1.2600).
  
 
==Modifications==
 
==Modifications==
Line 57: Line 75:
 
(setq edict-dictionaries
 
(setq edict-dictionaries
 
       (list kanjidict foodict bardict))
 
       (list kanjidict foodict bardict))
 +
</source>
 +
 +
You can also save entries to your private dictionary. The location is specified in suse-start.el, so modify it if the default is not to your liking:
 +
<source lang="lisp">
 +
(setq edict-user-dictionary "~/edict/private-edict")
 
</source>
 
</source>
  
Line 69: Line 92:
 
</source>
 
</source>
  
 +
If you are using edict (the Japanese dictionary, not edict.el), you might need to change the value of edict-default-coding-system. It was utf-8 by default, and I had to set it to euc-jp in edict.el:
 +
<source lang="lisp">
 +
(defvar edict-default-coding-system 'euc-jp
 +
  "Default coding system for reading dictionary files.
 +
On SuSE Linux >= 9.0, EDICT is distributed as an 'utf-8 encoded file.
 +
For SuSE Linux <= 8.2 or other Linux like systems, 'euc-jp may be used
 +
for EDICT. For Windows systems 'shift_jis is may be preferable.")
 +
</source>
  
 +
If you see blocks for missing glyphs, try another font. This worked for the edict file included in edict-20060807-136.2.rpm:
 +
<source lang="lisp">
 +
M-x set-default-font
 +
font: -outline-HAN NOM A-normal-normal-normal-*-*-*-*-*-p-*-jisx0208-sjis
 +
</source>
  
 
+
==See also==
 
+
*[[Lookup]]
;; Add key bindings for Org-style outline cycling
+
*[[Dictem]]
(add-hook 'outline-minor-mode-hook
 
  (lambda ()
 
    (define-key outline-minor-mode-map [(control tab)] 'org-cycle)
 
    (define-key outline-minor-mode-map [(shift tab)] 'org-global-cycle)))
 
 
 
 
 
 
 
Now visit any elisp file (say {{Command|find-library RET outline}}) and keep pressing {{Keys|S-TAB}} and see what happens.  Experiment similarly with {{Keys|C-TAB}}.
 
 
 
 
 
 
 
(will describe modifications later).
 
 
 
==Specifying dictionaries==
 
Add lisp for this later.
 
 
 
==Usage==
 
*edict-search-english
 
*edict-search-kanji
 
  
 
==External Links==
 
==External Links==
;[http://www.foo.com where to get edict.el]
+
;[http://rpmfind.net/linux/RPM/EByName.html Find RPMs by name]
: track this down
+
: Search for edict
 +
;[http://ftp.de.debian.org/debian/pool/main/e/edict-el/edict-el_1.06.orig.tar.gz Debian package]
 +
: The maintainer of the package is Roland Mas
 +
;[https://launchpad.net/ubuntu/intrepid/+package/edict-el Ubuntu package]
 +
: only lists Rolan Mas as "Original maintainer"
 
;[http://www.csse.monash.edu.au/~jwb/japanese.html Monash dictionary project]
 
;[http://www.csse.monash.edu.au/~jwb/japanese.html Monash dictionary project]
 
: Jim Breem's Japanese dictionaries
 
: Jim Breem's Japanese dictionaries
 +
 +
[[Category:Dictionary]] [[Category:Lookup]]

Latest revision as of 00:47, 1 April 2012

edict
Description provides interface for dictionary lookup.
Author name of author
Maintainer Roland Mas, Debian package mainainer
Source SUSE, Debian, and Ubuntu packages are available, works on Windows XP
Part of Emacs no

The elisp package edict.el is an instance of Lookup. It is often referred to simply as edict, which is confusing because it is associated with Edict, the Japanese dictionary. The lisp package can work with other dictionaries.

edict.el allows searching a local dictionary (e.g. Edict, Kanjidic) for character at point or a region. Search results are displayed in an Emacs buffer.

For a time edict.el was developed for XEmacs, but version 0.9.8 was an "FSF and XEmacs-21 compatibility release". The SUSE edict-emacs-0.9.8-972.2.rpm works on GNU Emacs 24.0.94.1 on Windows XP (so presumably on Gnu Emacs 24 on Linux).

It is not clear who the code maintainer is, as searches point to former maintainers. The most recent info suggests that Roland Mas is the current Debian package maintainer, but it does not look like the elisp code is under development.

Usage

  • M-x edict-search-english (prompts for word to search for)
  • M-x edict-search-kanji (first highlight a character or sequence)

Package availability

Linux

There are SUSE Linux RPMs for both edict.el and EDICT (the Japanese-English dictionary).

Note Note: You can create your own dictionary, or use other dictionaries.

  • edict-emacs-0.9.8-972.2 edict.el, an Emacs Front-end for EDICT
  • edict-20060807-136.2 The Japanese Dictionary Files for Jim Breen's EDICT Project

There is also a Debian package edict-el and an Ubuntu package.

Windows XP

The Suse RPMs can also be used on Windows XP. Use 7-Zip on the RPM, and then the enclosed cpio archive. It will create a usr/share/emacs/site-lisp/edict hierarchy, but you can move the edict folder or just its contents to anywhere, then add to load-path.

Tested OK on Windows XP with GNU Emacs 24.0.94.1 (i386-mingw-nt5.1.2600).

Modifications

Add to .emacs:

; set a variable edictdir to location of edict.el and the other package elisp files
(add-to-list 'load-path edictdir)
; variable edict-dictionaries points to your dictionaries. It is in suse-start.el
(load "suse-start")

The elisp files are in package edict-emacs-xxx.rpm. It is not necessary to get the edict-xxx.rpm which contains dictionaries, but suse-start.el notes that:

;; the following dictionaries should be available when you
;; have installed edict.rpm:
(setq edict-dictionaries
      (list
       "/usr/share/edict/4jwords"
       "/usr/share/edict/aviation"
       "/usr/share/edict/classical"
       "/usr/share/edict/compdic"
       "/usr/share/edict/compverb"
       "/usr/share/edict/concrete"
       "/usr/share/edict/edict"
       "/usr/share/edict/edicth"
       "/usr/share/edict/enamdict"
       "/usr/share/edict/findic"
       "/usr/share/edict/geodic"
       "/usr/share/edict/j_places"
       "/usr/share/edict/jddict.v02"
       (cons "/usr/share/edict/kanjd212"  'euc-jp)
       "/usr/share/edict/kanjidic"
       "/usr/share/edict/lingdic"
       "/usr/share/edict/mktdic"
       "/usr/share/edict/pandpdic"
       ))

I prefer to define dictionary variables in .emacs before loading suse-start. That way I never have to find suse-start.el again, just change the dictionary variable in .emacs. So a possible modification in suse-start.el is:

(setq edict-dictionaries
      (list kanjidict foodict bardict))

You can also save entries to your private dictionary. The location is specified in suse-start.el, so modify it if the default is not to your liking:

(setq edict-user-dictionary "~/edict/private-edict")

By default:

  • edict-search-english is on M-+
  • edict-search-kanji is on M-_

but these can be set with:

(global-set-key (kbd "C-c j") 'edict-search-english)
(global-set-key (kbd "C-c k") 'edict-search-kanji)

If you are using edict (the Japanese dictionary, not edict.el), you might need to change the value of edict-default-coding-system. It was utf-8 by default, and I had to set it to euc-jp in edict.el:

(defvar edict-default-coding-system 'euc-jp
  "Default coding system for reading dictionary files.
On SuSE Linux >= 9.0, EDICT is distributed as an 'utf-8 encoded file.
For SuSE Linux <= 8.2 or other Linux like systems, 'euc-jp may be used
for EDICT. For Windows systems 'shift_jis is may be preferable.")

If you see blocks for missing glyphs, try another font. This worked for the edict file included in edict-20060807-136.2.rpm:

M-x set-default-font
font: -outline-HAN NOM A-normal-normal-normal-*-*-*-*-*-p-*-jisx0208-sjis

See also

External Links

Find RPMs by name
Search for edict
Debian package
The maintainer of the package is Roland Mas
Ubuntu package
only lists Rolan Mas as "Original maintainer"
Monash dictionary project
Jim Breem's Japanese dictionaries