rulex

Форк
0
/
rulexdb_search.3 
103 строки · 3.0 Кб
1
.\"                                      Hey, EMACS: -*- nroff -*-
2
.TH RULEXDB_SEARCH 3 "February 20, 2012"
3
.SH NAME
4
rulexdb_search \- search rulex database for specified word
5
.SH SYNOPSIS
6
.nf
7
.B #include <rulexdb.h>
8
.sp
9
.BI "int rulexdb_search(RULEXDB *" rulexdb ", const char *" key \
10
", char *" value ", int " flags );
11
.fi
12
.SH DESCRIPTION
13
The
14
.BR rulexdb_search ()
15
function searches the database referenced by
16
.I rulexdb
17
argument and tries to guess pronunciation for the word specified by
18
string pointed by
19
.I key
20
argument according to the acquired info. The resulting string is
21
 placed into the buffer pointed by
22
.I value
23
argument. This buffer must have enough space for it. When no useful
24
 info is found, the original word is copied to the
25
.I value
26
buffer and
27
.B RULEXDB_SPECIAL
28
code is returned.
29
.PP
30
At first search is performed in the \fBExplicit\fP dictionary. If it
31
 succeeds, the result is returned and procedure exits
32
 successfully. Otherwise the word is treated as an implicit form and
33
 program tries to guess its base and find it in the \fBImplicit\fP
34
 dictionary. If this process succeeds, the pronunciation string is
35
 constructed according to the acquired data and procedure exits
36
 successfully. At last, the word is matched against general rules. If
37
 no match succeeds, then program exits with
38
.B RULEXDB_SPECIAL
39
code, returning the original word as a result.
40
.PP
41
If this process appears to be not fully unsuccessful and some
42
information was found in the database, then the resulting string is
43
matched against correction rules and the first matched one is applied
44
if any.
45
.PP
46
The last argument specifies which steps of the described process are
47
to be performed. It consists of the following flags which may be
48
.RI bitwise- or 'd
49
to form wanted search mode:
50
.TP
51
.B RULEXDB_EXCEPTIONS
52
Search the word in the exceptions dictionary.
53
.TP
54
.B RULEXDB_FORMS
55
Try to treat specified word as an implicit form.
56
.TP
57
.B RULEXDB_RULES
58
Try to apply general rules.
59
.TP
60
Zero value (no flags) means that full search (all stages) should be
61
performed.
62
.SH "RETURN VALUE"
63
The
64
.BR rulexdb_search ()
65
function returns
66
.B RULEXDB_SUCCESS
67
which is zero upon success, positive value
68
.B RULEXDB_SPECIAL
69
when specified word was not found, or
70
negative error code if something is wrong.
71
.SH ERRORS
72
.TP
73
.B RULEXDB_FAILURE
74
Referenced database has not been opened, internal data structures are
75
corrupted or some other general failure has occurred.
76
.TP
77
.B RULEXDB_EMALLOC
78
Internal memory allocation error.
79
.TP
80
.B RULEXDB_EINVKEY
81
Invalid key specified.
82
.TP
83
.B RULEXDB_EPARM
84
Invalid parameters are specified.
85
.SH SEE ALSO
86
.BR rulexdb_classify (3),
87
.BR rulexdb_close (3),
88
.BR rulexdb_dataset_name (3),
89
.BR rulexdb_discard_dictionary (3),
90
.BR rulexdb_discard_ruleset (3),
91
.BR rulexdb_fetch_rule (3),
92
.BR rulexdb_lexbase (3),
93
.BR rulexdb_load_ruleset (3),
94
.BR rulexdb_open (3),
95
.BR rulexdb_remove_item (3),
96
.BR rulexdb_remove_rule (3),
97
.BR rulexdb_remove_this_item (3),
98
.BR rulexdb_retrieve_item (3),
99
.BR rulexdb_seq (3),
100
.BR rulexdb_subscribe_item (3),
101
.BR rulexdb_subscribe_rule (3)
102
.SH AUTHOR
103
Igor B. Poretsky <poretsky@mlbox.ru>.
104

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.