rulexdb_fetch_rule(3)

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 Classifiers dataset.

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 General rules dataset.

RULEXDB_CORRECTOR

The rule is a correction rule that belongs to the Correctors dataset.

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.

Author

Igor B. Poretsky <[email protected]>.

From librulexdb-dev 3.8.6-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.