GNU Dico Manual (split by section):   Section:   Chapter:FastBack: Preface   Up: Top   FastForward: Intro   Contents: Table of ContentsIndex: Concept Index

1 Overview

A dictionary server operates on a set of databases. Each database contains a set of headwords with corresponding articles, therefore it can be regarded as a dictionary, in which articles supply definitions (or translations) for headwords.

The server offers facilities for searching headwords in the databases and for fetching articles from them.

This chapter provides an overview of the dictionary protocol and defines basic terms and notions used throughout this manual.

When describing the protocol, the following typographic conventions are used: the data sent by the client are prefixed with ‘C:’ and the data sent in response by the server are prefixed with ‘S:’.

Each database has a unique name – a string of characters that serves to identify this particular database in a set of available databases. Two more pieces of textual data are associated with a database. The database information string (or info, for short), supplies a short description of the database. It is a sentence, tersely describing the database, e.g. ‘English-German Dictionary’. The database description provides a full description of the dictionary, with author credits and copyright information. The length of this description is not limited.

Both pieces of information can be requested by the remote user. The command SHOW DB lists all available databases along with their descriptions:

S: 110 3 databases present
S: jargon "Jargon File (4.3.1, 29 Jun 2001)"
S: deu-eng "German-English Freedict dictionary"
S: en-pl-naut "English-Polish dictionary of nautical terms"
S: .
S: 250 ok

Each line of output lists a name of the dictionary, and the corresponding description.

The SHOW INFO command displays full information about a database, whose name is given as its argument:

C: SHOW INFO en-pl-naut
S: 112 information for en-pl-naut
S: English-Polish dictionary of nautical terms
S: Permission is granted to copy, distribute and/or modify 
S: this document under the terms of the GNU Free Docu-
S: mentation License, Version 1.2 or any later version 
S: published by the Free Software Foundation; with no 
S: Invariant Sections, no Front-Cover and Back-Cover Texts
S: .
S: 250 ok

A definition for any given headword can be requested using the DEFINE command. It takes two arguments, the name of the database and the headword to look for in that database, e.g.:

DEFINE en-pl-naut sprit

If the headword is found in the database, its definition is displayed, otherwise a diagnostic message is returned, telling that the headword was not found.

A special mechanism is provided for looking up the headword in a database (or databases). The MATCH command returns headwords that match a given string (a search key) using a particular strategy. In other words, a strategy identifies the algorithm for comparing two strings: a headword and the search key. A strategy is identified by its name. For example, the strategy ‘exact’ means literal comparison and returns only those headwords that match the key exactly. The strategy ‘prefix’ matches word prefixes. These two strategies are always present. Depending on the configuration, the server may offer other strategies as well. See Available Strategies, for a complete list of strategies implemented in GNU Dico 2.10.

One of the strategies is selected as a default strategy. Usually such strategy tolerates possible typing errors and allows the user to find matching headwords even if he does not know exactly how the word in question is spelled. The default strategy is denoted as ‘.’ (a dot).

The MATCH command takes three arguments: the name of the database to search, the strategy and the search key. For example:

S: MATCH wn prefix sail
C: 152 4 matches found: list follows
C: wn "sail"
C: wn "sail through"
C: wn "sailboat"
C: wn "sailcloth"
C: .
C: 250 Ok

Two database names are special. The ‘*’ means search in all databases and return all matches. The ‘!’ means search in all databases until the match is found in one of them and return only matches from that particular database.

These are basic facilities provided by the DICT protocol. For a complete and detailed description of the protocol, see Dictionary Server Protocol.

GNU Dico Manual (split by section):   Section:   Chapter:FastBack: Preface   Up: Top   FastForward: Intro   Contents: Table of ContentsIndex: Concept Index