GNU Dico Manual (split by node):   Section:   Chapter:FastBack: Modules   Up: guile   FastForward: Interface   Contents: Table of ContentsIndex: Concept Index

5.5.4 Dico Scheme Primitives

GNU Dico provides the following Scheme primitives for accessing various fields of the strat and key arguments to match callback:

Function: dico-key? obj

Return ‘#t’ if obj is a Dico key object.

Function: dico-key->word key

Extract the lookup word from the key object key.

Function: dico-make-key strat word

Create new key object from strategy strat and word word.

Function: dico-strat-selector? strat

Return true if strat has a selector (see Selector).

Function: dico-strat-select? strat word key

Return true if key matches word as per strategy selector strat. The key is a ‘Dico Key’ object.

Function: dico-strat-name strat

Return the name of strategy strat.

Function: dico-strat-description strat

Return a textual description of the strategy strat.

Function: dico-strat-default? strat

Return true if strat is a default strategy. See default strategy.

Function: dico-register-strat strat descr [fun]

Register a new strategy. If fun is given it will be used as a callback for that strategy. Notice, that you can use strategies implemented in Guile in your C code as well (see strategy).

The selector function must be declared as follows:

(define (fun key word)
  ...)

It must return #t if key matches word, and #f otherwise.

GNU Dico Manual (split by node):   Section:   Chapter:FastBack: Modules   Up: guile   FastForward: Interface   Contents: Table of ContentsIndex: Concept Index