File: example_complex.conf

package info (click to toggle)
dictd 1.9.15-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 3,760 kB
  • ctags: 3,266
  • sloc: ansic: 28,734; sh: 4,576; makefile: 1,002; perl: 410; yacc: 280; cpp: 275; lex: 217
file content (96 lines) | stat: -rw-r--r-- 2,181 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#
# it is assumed that dictd is run with '--pp m4'
#
# Run 'm4 examplex_complex.conf' to see how this
#   configuration file will be expanded by m4
#

#########################################################
#
# Simple macroses to define a simple database entry
#

define(db_simple_2arg,`
database $1 {
  data   $2.dict.dz
  index  $2.index
}')

define(db_simple, db_simple_2arg($1, $1))

db_simple(gcide)
db_simple_2arg(gaz, gazetteer)



#########################################################
#
# More complex macros implementing a combination of
# standard databases, virtual dictionaries and plugins.
#

define(db3,`

database $1_standard {
  index $2.index
  data  $2.dict.dz

  # In order not to make "exact" and "lev" search twice
  # we disable these strategies here.
  disable_strategy exact
  disable_strategy lev

  # top level virtual "dictionary" implementing all strategies is visible
  invisible
}

database_plugin $1_fast_exact {
  plugin "dictdplugin_judy.so"

  data "\
    allchars = 0\n\
    utf8     = $3\n\
    index    = $2.index\n\
    data     = $2.dict.dz\n\
  "

  # We want judy-based plugin implement "exact" and "lev" strategies only.
  # "prefix" strategy is also provided by Judy plugin,
  # but for short query it may work even slower than standard databases.
  # Therefore we disable it too.
  disable_strategy "prefix"

  # All others strategies are not provided by Judy plugin,
  # but we disable them explicitly. At least this saves one function call ;-)
  disable_strategy "substring"
  disable_strategy "suffix"
  disable_strategy "re"
  disable_strategy "regexp"
  disable_strategy "soundex"
  disable_strategy "word"

  # top level virtual "dictionary" implementing all strategies is visible
  invisible
}

database_virtual $1 {
  # virtual database implements
  # fast "exact" and "lev"  search strategies
  # using Judy-based plugin
  # and standard algorithms for all other strategies.

  name   "@00-database-short"
  info   "@00-database-info"

  database_list "$1_fast_exact,$1_standard"
}')

define(db_invis,  `db_invis3($1, $1, 1)')
define(db, `db3($1, $1, 1)')

db(vera)
db(wn)
db(hitchcock)
db(easton)
db(elements)
db(jargon)