rulexdb_fetch_rule3
Extract specified rule from the rulex database
Usage
#include <rulexdb.h> char *rulexdb_fetch_rule(RULEXDB *rulexdb, int rule_type, int position);
Overview
The rulexdb_fetch_rule() function retrieves a rule identified by its type and position in the ruleset from the rulex database referenced by rulexdb argument.
The argument rule_type specifies the rule type. It may accept one of the following values:
RULEXDB_LEXCLASS-
The rule is the word classifier and belongs to the
Classifiersdataset.
RULEXDB_PREFIX-
The rule describes prefix detection and replacement and belongs to the
Prefix detectors ruleset.
RULEXDB_RULE-
The requested rule should be extracted from the
Generalrules dataset.
RULEXDB_CORRECTOR-
The rule is a correction rule that belongs to the
Correctorsdataset.
The argument position defines position of the requested rule in the ruleset.
Return value
Upon success, the rulexdb_fetch_rule() function returns pointer to the textual representation of the extracted rule. This pointer remains valid until the next database operation. Otherwise, NULL is returned.