rulexdb_subscribe_item3
Put new dictionary item into the rulex database
Usage
#include <rulexdb.h> int rulexdb_subscribe_item(RULEXDB *rulexdb, const char *key, const char *value, int item_type, int overwrite);
Overview
The rulexdb_subscribe_item() function inserts new item into one of the dictionary datasets in the database referenced by rulexdb argument.
The argument key points to a text string containing the original word.
The argument value points to the corresponding pronunciation string.
The argument item_type specifies target dataset. It may accept one of the following values:
RULEXDB_LEXBASE-
The item represents a lexical base, therefore should be inserted into the
Implicitdictionary.
RULEXDB_EXCEPTION-
Explicit item that should be inserted into the
Explicitdictionary.
RULEXDB_DEFAULT-
Target dictionary should be guessed according to specified key: if it represents any lexical base, then
Implicitdictionary will be chosen, otherwise theExplicitdictionary will be used. If key word is recognized as a lexical base, but the record for this key already exist in theImplicitdictionary, thenExplicitdictionary will be tried instead.
The argument overwrite If true (non-zero) the new item will replace already existing one with the same key if any. Otherwise the new item will not be stored.
Return value
The rulexdb_subscribe_item() function returns RULEXDB_SUCCESS which is zero when specified item was successfully subscribed, positive value RULEXDB_SPECIAL when specified key already exists in the dictionary, or negative error code otherwise.
Errors
RULEXDB_FAILURE-
Referenced database has not been opened, internal data structures are corrupted or some other general failure has occurred.
RULEXDB_EINVKEY-
Invalid key specified.
RULEXDB_EINVREC-
Invalid pronunciation string specified.
RULEXDB_EPARM-
The argument rulexdb or item_type has an invalid value.
RULEXDB_EACCESS-
The database is not opened for updating.