eding Documentation

Synopsis

eding can be used to look up words in Frank Richter's Ding German-English dictionary, to store selected words in a quiz file, and to quiz the user using an SRS challenge-response system. The system uses sorting routines specifically designed for UTF-8 German text that may be of interest independently.

Installation

PREREQUISITES

The main thing you need is Frank Richter's Ding dictionary.

N.B. You only need the dictionary file. Usually there is a production version in a directory called de-en, and a development version in a directory called de-en-devel. By the time you read this, things may have changed! If so, you're on your own. The important thing is to get a file named de-en.txt.gz. (So far, I have always used the one in de-en-devel, but I suspect the production version will work fine.)

IMPORTANT NOTE: eding provides a routine called eding-check-dictionary that can be used to check for problems in the Ding dictionary. DON'T PANIC if you run it and it finds problems in the dictionary. I normally find 40 to 50 problems in the dictionary but it doesn't keep eding from working! You don't need to run eding-check-dictionary. It is an experimental routine that I have recently added.

The only other thing you need is a version of Emacs that can handle UTF-8 encoding and the german-postfix input method. Unless you are running a very old version of Emacs, you are probably all set, so you can skip down to INSTALLATION OPTIONS below. If you are running an old version of Emacs, or have trouble, read the next paragraph:

Your Emacs installation *has* to be able to handle utf-8 file encoding and needs to be able to handle the german-postfix input method. If you are using an older version of Emacs, you may need to add a package containing Emacs lisp code for internationalization. Linux distributions using older versions of Emacs generally have packages for this. Look for a package with a name something like emacs-leim-etc. for your distribution. THE FOLLOWING FIX IS EASY AND ALWAYS WORKS: just go to gnu.org to get Emacs 22.1 or later. It is dead easy to compile and install and simply has everything you need built right in!

INSTALLATION OPTIONS

QUICK START FOR THE IMPATIENT:

(N.B. C-c means "control-c" below)

  1. create a directory named ~/.eding
  2. gunzip de-en.txt.gz
  3. move de-en.txt to ~/.eding/de-en-devel.de
    -or- move it wherever you want and put a soft link to it named de-en-devel.de in ~/.eding. (for example if you put it in /tmp/de-en.txt, type
        cd ~/.eding
        ln -s /tmp/de-en.txt de-en-devel.de
    
    and you should be all set)
  4. append the file eding.el that came with the eding distribution to the end of your ~/.emacs file. (If you don't have a ~/.emacs file just copy eding.el to ~/.emacs)
  5. start Emacs
  6. type C-c d h to read the built-in manual

ALTERNATIVE, MORE EFFICIENT INSTALLATION

(N.B. M-x means "ALT-x" or "META-x" below)

  1. do steps 1) through 3) above.
  2. copy the eding.el file that came with the eding distribution to ~/.eding/eding.el
  3. start Emacs
  4. type: M-x byte-compile-file (carriage return)
    then: "~/.eding/eding.el" at the prompt
  5. Add this to your ~/.emacs file:
        (setq load-path
              (append (list nil "~/.eding")
                      load-path))
    
        (load "eding")
    (If you don't have a ~/.emacs file, just create one with those lines in it.)
  6. Re-start Emacs
  7. type C-c d h to read the built-in manual

eding command list

Here's a list of the main eding command names and their default keybindings. These appear first in the built-in manual because we assume that after the first read-through the main reason for using the help system will be to remind yourself of a keybinding that you have forgotten. We kept them near the beginning of the manual here to keep this version of the documentation as close to the on-line version as possible.

Please note that we adopt the standard Emacs convention of writing the key sequences control-c and alt-x as C-c and M-x respectively.

Keybinding: FunctionDescription
C-c d d: eding-lookup
Opens the dictionary, creates a buffer *eding* and makes it current. Prompts for a "String-Aufdruck" which is used as a regular expression in a regular expression search.
C-c d D: eding-lookup-soft
Same as C-c d d, but locally sets the variable eding-soft-lookup which causes eding-lookup to print out results from *related* words in addition to words that directly match. Vortrefflich!
C-c d e: eding-toggle-english
Toggles the eding-english variable. This variable is nil by default. When non-nil, it makes the routines act as if the user were German.
C-c d f: eding-set-quizfile
Sets the filename used to store lines that can be used in a quiz at a later date. You *need* to either set this or create a ~/.eding directory if you want to use the quiz capability.
C-c d a: eding-quiz-addline
Causes the line that the cursor is on to be appended to the quiz file. If the mark is active any line that is part of the region is added.
C-c d q: eding-start-quiz
Starts a quiz made up from the lines that were previously saved in the currently-active quiz file.
C-c d p: eding-set-postfix
Explicitly sets input method to german-postfix.
C-c d C: eding-check-dictionary
Runs a check on the dictionary file.
C-c d r: eding-randomize-quizfile
Randomizes the due dates of challenges. Why you would want to do this is explained in the help string.
C-c d h: eding-help
Prints out a list of ding-related commands, the corresponding keystrokes, and general help.

You can get detailed help on most of these commands by typing "C-h f" followed by the command name. The easy way to remember these (and most Emacs key bindings in general) is to realize that Emacs key bindings can consist of "prefixes" and command keys. Think of C-c d as the "Dictionary prefix," the "Deutsch prefix," or even the "Ding prefix." C-c is the standard first character for user-defined commands. "d" means Dictionary, Deutch, or Ding. Then each command is mnemonic. "a" for addline, "h" for help, etc. "d" was originally chosen to remind me of "Ding lookup." It is by far the most often-used command and the double-d at the end makes it easy to type quickly.

The rest of this help file explains the system in a general sense to give you a feel for using it, and describes the use of the eding-start-quiz function in some detail because it is, after all, the main reason that the system exists in the first place.

Dictionary lookup

You can search the dictionary using eding-lookup and eding-soft-lookup. These routines prompt you for a regular expression (Explained below if you don't know what this means. For now just think of it as a search string.) and print out parsed lines from the dictionary that match the regular expression. eding-lookup only prints out lines that match while eding-soft-lookup also includes lines that don't match but are related to lines that do match. The soft match can be a good way to get a better feel for the use of a word and to discover synonyms for words. By default, the search searches both the German and English parts of the line, but you can easily change this using regular expression syntax.

eding search strings are used as regular expressions for searching the dictionary. A regular expression is a string of characters that describes a text pattern. The simplest regular expressions are just strings of letters and numbers. A simple string like "Klo" will match any line that contains the sequence of letters "Klo." (or "klo" for that matter...) So if you don't want to bother learning about regular expressions, the program will work fine for you if you just type words in as search strings.

More complicated regular expressions include elements that match word boundaries, the beginning or end of the line, etc. They *can* be quite complicated, but very simple regular expressions are all you need to make your eding searches more precise. The following table and examples will tell you all you really need to know:

Rule 1:
\d (or \D) as the first thing in your search string means only look at the German side. \e (or \E) as the first thing means only look at the English side. (N.B. this is an eding extension to regular expression syntax! It is not normally available outside eding.)
Rule 2:
By default regular expressions don't care much about case. If you search for "fratz" you will get both fratzenhaft and Fratze. (plus some other stuff...)
Rule 3:
^ as the first thing (other than an optional \e or \d) in your search string matches the beginning of the line.
Rule 4:
$ as the last thing in your search string matches the end of the line. You can't use it anywhere else. (In eding this is probably the only reason you would use it anyway. As of this writing there is only one dollar sign in the Ding dictionary and I'll bet you already know where it is.)
Rule 5:
\b matches a word boundary
Rule 6:
[xyz] matches the character x, y, or z. (You can put any list of charaters you want in the brackets!) If the first character in the list is a caret ('^') it means "match any character NOT in this list."
Rule 7:
[^ ]* matches zero or more characters that ARE NOT spaces. The asterisk means "match zero or more of the thing right before me." N.B.: As of this writing, there are NO OCCURANCES of the caret in the Ding dictionary. (Not even in the definition of "Einschaltungszeichen!") So the only reasons you should use it are for negating a bracketed character list or as described in Rule 3 above.
Rule 8:
Period ('.') is a special character in regular expressions which matches ANY character. So if you want to search for something that has a period in it (the dictionary has many abbreviations in it!) you need to "escape" the period with a backslash. If you want to know what "d.h." stands for, you need to search for "d\.h\." or you will get about two thousand results including daheim, daher, etc.

Here are some examples of search strings:

SEARCH STRING FINDS LINES THAT
streng
have German or English words containing "streng"
\dstreng
have German words containing "streng"
\estreng
have English words containing "streng"
\d^streng
have a German side starting with "streng"
\d\bstreng
have German words that start with "streng"
\dstreng\b
have German words that end with "streng" (Note that most German entries end with a designation of gender or part of speech, e.g. {m} to denote a masculine noun. Thus if you are looking for German words that end a certain way it is much better to use \b than it is to use $ at the end!)
\d\bkla[^ ]*ch\b
have German words that start with "kla" and end with "ch" (like Kladderadatsch!)
\d^kl[äü]
have a German side that starts with "klä" or "klü"

As you can see, regular expressions are very powerful, and we've only scratched the surface here. You can learn more about them by reading the Emacs documentation.

The lines found by the lookup routines are printed in alphabetical order in a special buffer named *eding* which is created if it doesn't already exist.

The sorting routine emulates the approach used by my Brockhaus dictionary when alphabetizing. In the Brockhaus approach, 'ä' is essentially equivalent to 'a' but follows 'a' if the words are otherwise the same alphabetically. Thus träge follows trage but Tragetasche follows Trägerwelle.

Once you have some lines in the *eding* buffer, you can automatically add lines to a quiz file using the function eding-quiz-addline. Just move the cursor to a line you want to add and type "C-c d a." This copies the line to your quiz file. See the documentation for this function (by typing "C-h f eding-quiz-addline") for tips on improving your quiz file.

Once you have a bunch of lines in your quiz file, you can quiz yourself periodically to ingrain the words you have learned into your vocabulary. It's pretty amazing how fast and well you can learn a lot of words if you do just one quiz session (usually about 20 minutes) each day. You start the quiz by typing "C-c d q."

SRS Quiz System

The quiz routine implements an SRS system which schedules challenges based on your past performance in responding to them. The system is designed to rate your performance based on speed of response. The idea is simple: The computer prints out a challenge and starts a timer. Once you have read the challenge and stated the correct response out loud, you hit return and the computer stops the timer. Since the challenge generally has at most a handful of words or phrases to read and respond to, the system assumes that any response that takes more than 5 seconds to respond to is a problem for you. (This value is actually variable and you can control it by modifying the value of prob-thresh in the code.) Any challenge that gives you trouble is automatically added to a list of challenges that will be re-presented after you have gone through the entire quiz once. These problem challenges will be re-presented over and over until you can respond to them in less than 5 seconds.

The program automatically keeps track of your performance and stores it in the quiz file. For each quiz session, however, only your initial response to a challenge is stored. The secondary phase where you are presented with problem challenges is just there to help you learn the information so you can do better next time.

Here are some important things to know about how the quiz works: