---
name: "rulexdb_lexbase"
section: "3"
platform: "linux"
package: "librulexdb-dev"
version: "3.8.6-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/rulexdb_lexbase"
---

# rulexdb\_lexbase(3)

try to find lexical base for the specified word

## NAME

rulexdb\_lexbase - try to find lexical base for the specified word

## SYNOPSIS

```
#include <rulexdb.h>

int rulexdb_lexbase(RULEXDB *rulexdb, const char *s, char *t, int n);
```

## DESCRIPTION

The **rulexdb\_lexbase**() function scans **Classifiers** ruleset starting from *n* which must be positive trying to match the word pointed by *s*. When match succeeds, the lexical base is constructed in memory area\
  pointed by *t*, which must have enough space for it, and the number of matched rule or 0 if no match found is returned.

The argument *rulexdb* references the rulex database to search in.

## RETURN VALUE

The **rulexdb\_lexbase**() function returns the number of matched rule that is always positive, 0 when no match found, or negative error code.

## ERRORS

- **RULEXDB\_FAILURE**

  Referenced database has not been opened, internal data structures are corrupted or some other general failure has occurred.

- **RULEXDB\_EMALLOC**

  Internal memory allocation error.

- **RULEXDB\_EPARM**

  Invalid parameters are specified.

## SEE ALSO

[**rulexdb\_classify**(3)](/rulexdb_classify/3.md), [**rulexdb\_close**(3)](/rulexdb_close/3.md), [**rulexdb\_dataset\_name**(3)](/rulexdb_dataset_name/3.md), [**rulexdb\_discard\_dictionary**(3)](/rulexdb_discard_dictionary/3.md), [**rulexdb\_discard\_ruleset**(3)](/rulexdb_discard_ruleset/3.md), [**rulexdb\_fetch\_rule**(3)](/rulexdb_fetch_rule/3.md), [**rulexdb\_load\_ruleset**(3)](/rulexdb_load_ruleset/3.md), [**rulexdb\_open**(3)](/rulexdb_open/3.md), [**rulexdb\_remove\_item**(3)](/rulexdb_remove_item/3.md), [**rulexdb\_remove\_rule**(3)](/rulexdb_remove_rule/3.md), [**rulexdb\_remove\_this\_item**(3)](/rulexdb_remove_this_item/3.md), [**rulexdb\_retrieve\_item**(3)](/rulexdb_retrieve_item/3.md), [**rulexdb\_search**(3)](/rulexdb_search/3.md), [**rulexdb\_seq**(3)](/rulexdb_seq/3.md), [**rulexdb\_subscribe\_item**(3)](/rulexdb_subscribe_item/3.md), [**rulexdb\_subscribe\_rule**(3)](/rulexdb_subscribe_rule/3.md)

## AUTHOR

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