logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

rulexdb_retrieve_item - retrieve an item from the rulex database

Author

       Igor B. Poretsky <poretsky@mlbox.ru>.

                                                  June 22, 2023                         RULEXDB_RETRIEVE_ITEM(3)

Description

       The  rulexdb_retrieve_item()  function  retrieves  an  item  from  one  of the dictionary datasets in the
       database referenced by rulexdb argument.

       The argument key points to a text string containing the word to be fetched.

       The argument value points to the memory area where corresponding pronunciation string will be placed.

       The argument item_type specifies target dataset. It may accept one of the following values:

       RULEXDB_LEXBASE
              The item should be fetched from the Implicit dictionary and, therefore, it  represents  a  lexical
              base.

       RULEXDB_EXCEPTION
              The item representing an exception should be fetched from the Explicit dictionary.

       RULEXDB_DEFAULT
              Target  dictionary  should be guessed according to the key specified: if it represents any lexical
              base, then Implicit dictionary will be chosen, otherwise the Explicit dictionary will be used.

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_EPARM
              The argument rulexdb or item_type has an invalid value.

Name

       rulexdb_retrieve_item - retrieve an item from the rulex database

Return Value

       The rulexdb_retrieve_item() function returns RULEXDB_SUCCESS  which  is  zero  when  specified  item  was
       successfully  retrieved,  positive  value  RULEXDB_SPECIAL  when  specified  key  does  not  exist in the
       dictionary, or negative error code otherwise.

See Also

rulexdb_classify(3),     rulexdb_close(3),     rulexdb_dataset_name(3),    rulexdb_discard_dictionary(3),
       rulexdb_discard_ruleset(3),    rulexdb_fetch_rule(3),    rulexdb_lexbase(3),     rulexdb_load_ruleset(3),
       rulexdb_open(3),     rulexdb_remove_item(3),     rulexdb_remove_rule(3),     rulexdb_remove_this_item(3),
       rulexdb_search(3), rulexdb_seq(3), rulexdb_subscribe_item(3), rulexdb_subscribe_rule(3)

Synopsis

#include<rulexdb.h>intrulexdb_retrieve_item(RULEXDB*rulexdb,constchar*key,char*value,intitem_type);

See Also