storfa aur, geirfa'r iaith!

Eurfa ::  Rhymer ::  Translist ::  Background ::  Download ::  Kyfieithu ::  Konjugator ::  Cymrux ::     [Cymraeg]

Eurfa and dictd

Dictd (dictionary daemon) is a protocol designed to serve dictionaries over a network. It is the format used by the largest free dictionary site on the Web, Freedict. Recasting the data in Eurfa into different formats is easy, and the dictd version means that Eurfa can be used with dictd clients:

Kdict (Linux)

Already available in Welsh as part of the Kyfieithu project, but revised for this Eurfa release:

OmniDictionary (Apple Mac)

Magical Jellybean Dictionary (Microsoft Windows)

I'm not sure whether this app is still being developed:

KTranslator

Raul Fernandes has developed this app to provide quick desktop access to dictionaries. As well as the dictd format, it supports StarDict, Sdict, Babylon dic, and plain text formats, and has initial support for Babylon bgl, Freedict XML, Atlantida, and XDXF formats. KTranslator has been translated into Welsh for this Eurfa release.

As well as being a standalone app, a popup version can be called by holding down the Ctrl key (configurable) and double-clicking. The end-result is similar to BBC Vocab, except that dictionary lookup is available across the desktop as a whole, rather than on web-pages only:

Dictd in practice

The standard version of Eurfa is delivered over a PHP app called Krowbar. This is less work to configure than dictd, and it works easily over a network, since it uses a browser instead of a special client. It is also easier (for me!) to finetune the queries to show as much information as possible. However, having Eurfa data in a format that can be used on the desktop is useful enough to make it worthwhile releasing the conversion.

The main citation table in Eurfa (eurfa_nmni) is run through two PHP scripts which generate xml files for Welsh-English and English-Welsh. These files are then run through the Freedict build-scripts to create dict.dz and index files for Welsh-English and English-Welsh. Unfortunately, using the build-scripts is a non-trivial process, and I am grateful to Michael Bunk and Kęstutis Biliūnas for their help here.

Note that because only the citation table is used, searches on mutated forms and verbal forms will come up empty. If there is demand, I can look at including these as well.

There are a couple of formatting errors (eg the names of the dictionary files), but these are not serious, and can be fixed in future releases.

Setting up a dictd server

(Note that setting up a server is not necessary to use KTranslator - all you need to do there is go to Tools -> Preferences -> Dictionaries ->Add, and follow the wizard to point to the location of the Eurfa dictd index files.)

It is simplest to set up dictd on a Linux box - the instructions here are for openSUSE, but other distros will be similar. Install the dictd package. Move the Eurfa dictd files into a folder of your choice, for example /usr/share/dict. Copy the sample configuration file to a sensible location, eg:

cp /usr/share/doc/packages/dictd/example.conf /usr/local/etc/dict.conf

Edit dict.conf to contain the following (note that this assumes LAN access only):

	access {
		allow *
		}
	database eurfa_cym {
		data "/usr/share/dict/eurfa_cym.dict.dz"
		index "/usr/share/dict/eurfa_cym.index"
	}
	database eurfa_eng {
		data "/usr/share/dict/eurfa_eng.dict.dz"
		index "/usr/share/dict/eurfa_eng.index"
	}
	

Save the file. Edit /usr/sbin/rcdictd (the openSUSE startup script), and point it to the configuration file by changing the line:

startproc $DICTD_BIN -L /var/log/dictd

to:

startproc $DICTD_BIN -L /var/log/dictd -c /usr/local/etc/dict.conf

Then start the dict server:

rcdictd start

Configure your client to point to this server. For instance, in Kdict, go to Settings -> Configure Kdict -> Server, and enter the IP address of your server. Server -> Server Information should display info about the server. Server -> Get Capabilities should get a list of the dictionaries in /usr/share/dict. (You need to do this each time you revise the list of dictionaries, otherwise they will not show in the drop-down list.) Note that you may need to specify a font (eg Gentium) that can display all the accented letters - Settings -> Configure Kdict -> Appearance, and tick Use Custom Fonts.