
capability (mime,xversion);
timing yes;

pidfile /var/run/dicod/dicod.pid;

module-load-path ("/usr/lib/dico");

// Enable handling of databases in dict.org format:
load-module dictorg {
	command "dictorg sort trim-ws dbdir=/usr/share/dictd";
}

// dicodconfig automatically generates the database sections for dictorg
// formatted dictionaries, the following line makes use of this facility:
#include /var/lib/dicod/dictorg-db.list

// Uncomment the following to enable handling of databases in Emacs outline 
// format:
/* load-module outline {
	command "outline";
}
*/

// Uncomment the following to enable Guile interface:
/* load-module guile {
	command "guile";
}
*/

// Uncomment the following to enable Guile interface:
/* load-module python {
	command "python load-path=/usr/share/dico/python";
}
*/

// Emacs outline database example:
/* database {
	name "devdict";
	handler "outline /usr/share/dico/outline/devils.out";
}
*/

#database {
#	name "plnum";
#	handler "guile"
#	        " init-script=/tmp/dico-2.0/tests/example.scm "
#		" init-fun=example-init"
#		" example.db";
#}

#m4_define(`wikipedia',`
#database {
#        name "$1-`wikipedia'";
#        handler "python load-path=/usr/share/dico/python init-script=mediawiki $1.`wikipedia'.org";
#        mime-headers <<- EOT
#          Content-Type: text/x-wiki
#          Content-Transfer-Encoding: quoted-printable
#          X-Wiki-Language: $1
#        EOT;
#m4_ifelse(`$2',,,`
#        description "`$2'";')
#m4_ifelse(`$3',,,`
#        info <<- EOT
#`$3'
#EOT;')
#}')

#m4_define(`wiktionary',`
#database {
#        name "$1-`wiktionary'";
#        handler "python load-path=/usr/share/dico/python init-script=mediawiki $1.`wiktionary'.org";
#        mime-headers <<- EOT
#          Content-Type: text/x-wiki
#          Content-Transfer-Encoding: quoted-printable
#          X-Wiki-Language: $1
#        EOT;
#m4_ifelse(`$2',,,`
#        description "`$2'";')
#m4_ifelse(`$3',,,`
#        info <<- EOT
#`$3'
#EOT;')
#}')

/* wikipedia(`en',
  `en.wikipedia.org') */

/* wiktionary(en,
  `en.wiktionary.org',
  `English language Wiktionary, a collaborative project to produce a
   free-content multilingual dictionary.') */

alias d DEFINE;
alias da d "*";
alias df d "!";
alias m MATCH;
alias mas m "*";
alias mfs m "!";
alias ma mas ".";
alias mf mfs ".";
alias s STATUS;
alias h HELP;
alias q QUIT;

help-text <<- EOT
	+
  The following commands are abbreviations that Gray likes to use when
  debugging the daemon.  You may or may not find them useful.  However
  it is, do not write your client software to relay on them.  They may
  disappear or change any time Gray pleases, without notice.

  d database word                 -- DEFINE database word
  da word                         -- DEFINE * word
  df word                         -- DEFINE ! word
  ma word                         -- MATCH * . word
  mf word                         -- MATCH ! . word
  mas strategy word               -- MATCH * strategy word
  mfs strategy word               -- MATCH ! strategy word
  m database strategy word        -- MATCH database strategy word
  s                               -- STATUS
  h                               -- HELP
  q                               -- QUIT
EOT;

user dicod;
max-children 18;
#inactivity-timeout 5;

server-info <<EOT
This is a Dico server.
EOT;

# The "Match everything (experimental)" strategy is not suited for
# production servers, it consumes all CPU, leading to an easy DOS attack
# method. It can be enabled by uncommenting the following:
/* load-module stratall {
  command "stratall";
}

# Deny this strategy in default searches:
strategy all {
  deny-all yes;
}
*/

# New strategy `substr' matches a substring anywhere in the headword.
# To enable this strategy, uncomment the following:
/* load-module substr {
  command "substr";
}

# Substr strategy can be quite resource consuming, hence it is better to limit
# it to 3+ pattern length:
strategy substr {
  deny-length-lt 3;
}
*/
