105 |
|
|
106 |
/* Get the ID number of a document object. |
/* Get the ID number of a document object. |
107 |
`doc' specifies a document object. |
`doc' specifies a document object. |
108 |
The return value is the ID number of the document object. If the object has never been |
The return value is the ID number of the document object. If the object has not been |
109 |
registered, -1 is returned. */ |
registered, -1 is returned. */ |
110 |
int est_doc_id(ESTDOC *doc); |
int est_doc_id(ESTDOC *doc); |
111 |
|
|
135 |
|
|
136 |
/* Concatenate sentences of the text of a document object. |
/* Concatenate sentences of the text of a document object. |
137 |
`doc' specifies a document object. |
`doc' specifies a document object. |
138 |
The return value is concatenated sentences of a document object. Because the region of the |
The return value is concatenated sentences of the document object. Because the region of the |
139 |
return value is allocated with the `malloc' call, it should be released with the `free' call |
return value is allocated with the `malloc' call, it should be released with the `free' call |
140 |
if it is no longer in use. */ |
if it is no longer in use. */ |
141 |
char *est_doc_cat_texts(ESTDOC *doc); |
char *est_doc_cat_texts(ESTDOC *doc); |
143 |
|
|
144 |
/* Dump draft data of a document object. |
/* Dump draft data of a document object. |
145 |
`doc' specifies a document object. |
`doc' specifies a document object. |
146 |
The return value is draft data of a document object. Because the region of the return value |
The return value is draft data of the document object. Because the region of the return value |
147 |
is allocated with the `malloc' call, it should be released with the `free' call if it is no |
is allocated with the `malloc' call, it should be released with the `free' call if it is no |
148 |
longer in use. */ |
longer in use. */ |
149 |
char *est_doc_dump_draft(ESTDOC *doc); |
char *est_doc_dump_draft(ESTDOC *doc); |
155 |
`wwitdh' specifies whole width of the result. |
`wwitdh' specifies whole width of the result. |
156 |
`hwitdh' specifies width of strings picked up from the beginning of the text. |
`hwitdh' specifies width of strings picked up from the beginning of the text. |
157 |
`awitdh' specifies width of strings picked up around each highlighted word. |
`awitdh' specifies width of strings picked up around each highlighted word. |
158 |
The return value is a snippet string of the body text of a document object. There are tab |
The return value is a snippet string of the body text of the document object. There are tab |
159 |
separated values. Each line is a string to be shown. Though most lines have only one field, |
separated values. Each line is a string to be shown. Though most lines have only one field, |
160 |
some lines have two fields. If the second field exists, the first field is to be shown with |
some lines have two fields. If the second field exists, the first field is to be shown with |
161 |
highlighted, and the second field means its normalized form. Because the region of the |
highlighted, and the second field means its normalized form. Because the region of the |
207 |
char *phrase; /* search phrase */ |
char *phrase; /* search phrase */ |
208 |
int gstep; /* step of N-gram */ |
int gstep; /* step of N-gram */ |
209 |
int tfidf; /* whether with TF-IDF tuning */ |
int tfidf; /* whether with TF-IDF tuning */ |
210 |
int simple; /* whether with the simplefied phrase */ |
int simple; /* whether with the simplified phrase */ |
211 |
CBLIST *attrs; /* conditions with attributes */ |
CBLIST *attrs; /* conditions with attributes */ |
212 |
char *order; /* sorting order */ |
char *order; /* sorting order */ |
213 |
int max; /* maximum number of retrieval */ |
int max; /* maximum number of retrieval */ |
223 |
ESTCONDFAST = 1 << 2, /* check N-gram keys skipping by two */ |
ESTCONDFAST = 1 << 2, /* check N-gram keys skipping by two */ |
224 |
ESTCONDAGIT = 1 << 3, /* check N-gram keys skipping by three */ |
ESTCONDAGIT = 1 << 3, /* check N-gram keys skipping by three */ |
225 |
ESTCONDNOIDF = 1 << 4, /* without TF-IDF tuning */ |
ESTCONDNOIDF = 1 << 4, /* without TF-IDF tuning */ |
226 |
ESTCONDSIMPLE = 1 << 10, /* with the simplefied phrase */ |
ESTCONDSIMPLE = 1 << 10, /* with the simplified phrase */ |
227 |
ESTCONDSCFB = 1 << 30 /* feed back scores (for debug) */ |
ESTCONDSCFB = 1 << 30 /* feed back scores (for debug) */ |
228 |
}; |
}; |
229 |
|
|
252 |
|
|
253 |
/* Set the order of a condition object. |
/* Set the order of a condition object. |
254 |
`cond' specifies a condition object. |
`cond' specifies a condition object. |
255 |
`expr' specifies an expression for the order. |
`expr' specifies an expression for the order. By default, the order is by score descending. */ |
|
By default, the order is by score descending. */ |
|
256 |
void est_cond_set_order(ESTCOND *cond, const char *expr); |
void est_cond_set_order(ESTCOND *cond, const char *expr); |
257 |
|
|
258 |
|
|
259 |
/* Set the maximum number of retrieval of a condition object. |
/* Set the maximum number of retrieval of a condition object. |
260 |
`cond' specifies a condition object. |
`cond' specifies a condition object. |
261 |
`max' specifies the maximum number of retrieval. |
`max' specifies the maximum number of retrieval. By default, the number of retrieval is not |
262 |
By default, the number of retrieval is not limited. */ |
limited. */ |
263 |
void est_cond_set_max(ESTCOND *cond, int max); |
void est_cond_set_max(ESTCOND *cond, int max); |
264 |
|
|
265 |
|
|
268 |
`options' specifies options: `ESTCONDSURE' specifies that it checks every N-gram key, |
`options' specifies options: `ESTCONDSURE' specifies that it checks every N-gram key, |
269 |
`ESTCONDUSU', which is the default, specifies that it checks N-gram keys with skipping one |
`ESTCONDUSU', which is the default, specifies that it checks N-gram keys with skipping one |
270 |
key, `ESTCONDFAST' skips two keys, `ESTCONDAGIT' skips three keys, `ESTCONDNOIDF' specifies |
key, `ESTCONDFAST' skips two keys, `ESTCONDAGIT' skips three keys, `ESTCONDNOIDF' specifies |
271 |
not to perform TF-IDF tuning, `ESTCONDSIMPLE' specifies to use simplefied phrase. Each option |
not to perform TF-IDF tuning, `ESTCONDSIMPLE' specifies to use simplified phrase. Each option |
272 |
can be specified at the same time by bitwise or. If keys are skipped, though search speed is |
can be specified at the same time by bitwise or. If keys are skipped, though search speed is |
273 |
improved, the relevance ratio grows less. */ |
improved, the relevance ratio grows less. */ |
274 |
void est_cond_set_options(ESTCOND *cond, int options); |
void est_cond_set_options(ESTCOND *cond, int options); |
353 |
|
|
354 |
enum { /* enumeration for options of optimization */ |
enum { /* enumeration for options of optimization */ |
355 |
ESTOPTNOPURGE = 1 << 0, /* omit purging dispensable region of deleted */ |
ESTOPTNOPURGE = 1 << 0, /* omit purging dispensable region of deleted */ |
356 |
ESTOPTNODBOPT = 1 << 1 /* omit optimizization of the database files */ |
ESTOPTNODBOPT = 1 << 1 /* omit optimization of the database files */ |
357 |
}; |
}; |
358 |
|
|
359 |
enum { /* enumeration for options of document retrieval */ |
enum { /* enumeration for options of document retrieval */ |
377 |
bitwise or: `ESTDBNOLCK', which means it opens a database file without file locking, or |
bitwise or: `ESTDBNOLCK', which means it opens a database file without file locking, or |
378 |
`ESTDBLCKNB', which means locking is performed without blocking. If `ESTDBNOLCK' is used, |
`ESTDBLCKNB', which means locking is performed without blocking. If `ESTDBNOLCK' is used, |
379 |
the application is responsible for exclusion control. `ESTDBCREAT' can be added to by bitwise |
the application is responsible for exclusion control. `ESTDBCREAT' can be added to by bitwise |
380 |
or: `ESTDBPERFNG', which means N-gram analysis is performed against Europian text also. |
or: `ESTDBPERFNG', which means N-gram analysis is performed against European text also. |
381 |
`ecp' specifies the pointer to a variable to which the error code is assigned. |
`ecp' specifies the pointer to a variable to which the error code is assigned. |
382 |
The return value is a database object of the database or `NULL' if failure. */ |
The return value is a database object of the database or `NULL' if failure. */ |
383 |
ESTDB *est_db_open(const char *name, int omode, int *ecp); |
ESTDB *est_db_open(const char *name, int omode, int *ecp); |
390 |
int est_db_close(ESTDB *db, int *ecp); |
int est_db_close(ESTDB *db, int *ecp); |
391 |
|
|
392 |
|
|
393 |
/* Get the last happended error code of a database. |
/* Get the last happened error code of a database. |
394 |
`db' specifies a database object. |
`db' specifies a database object. |
395 |
The return value is the last happended error code of the database. */ |
The return value is the last happened error code of the database. */ |
396 |
int est_db_error(ESTDB *db); |
int est_db_error(ESTDB *db); |
397 |
|
|
398 |
|
|
419 |
/* Optimize a database. |
/* Optimize a database. |
420 |
`db' specifies a database object connected as a writer. |
`db' specifies a database object connected as a writer. |
421 |
`options' specifies options: `ESTOPTNOPURGE' to omit purging dispensable region of deleted |
`options' specifies options: `ESTOPTNOPURGE' to omit purging dispensable region of deleted |
422 |
documents, `ESTOPTNODBOPT' to omit optimizization of the database files. The two can be |
documents, `ESTOPTNODBOPT' to omit optimization of the database files. The two can be |
423 |
specified at the same time by bitwise or. |
specified at the same time by bitwise or. |
424 |
The return value is true if success, else it is false. */ |
The return value is true if success, else it is false. */ |
425 |
int est_db_optimize(ESTDB *db, int options); |
int est_db_optimize(ESTDB *db, int options); |
464 |
char *est_db_get_doc_attr(ESTDB *db, int id, const char *name); |
char *est_db_get_doc_attr(ESTDB *db, int id, const char *name); |
465 |
|
|
466 |
|
|
467 |
/* Get the ID of a document spacified by URI. |
/* Get the ID of a document specified by URI. |
468 |
`db' specifies a database object. |
`db' specifies a database object. |
469 |
`uri' specifies the URI of a registered document. |
`uri' specifies the URI of a registered document. |
470 |
The return value is the ID of the document. On error, -1 is returned. */ |
The return value is the ID of the document. On error, -1 is returned. */ |
558 |
*************************************************************************************************/ |
*************************************************************************************************/ |
559 |
|
|
560 |
|
|
561 |
#define _EST_VERSION "0.5.2" |
#define _EST_VERSION "0.5.3" |
562 |
#define _EST_LIBVER 200 |
#define _EST_LIBVER 200 |
563 |
#define _EST_PROTVER "0.9" |
#define _EST_PROTVER "0.9" |
564 |
|
|
704 |
|
|
705 |
/* Get the phrase of a condition object. |
/* Get the phrase of a condition object. |
706 |
`cond' specifies a condition object. |
`cond' specifies a condition object. |
707 |
The return value is the phrase of a condition object or `NULL' if it is not specified. The |
The return value is the phrase of the condition object or `NULL' if it is not specified. The |
708 |
life duration of the returned string is synchronous with the one of the condition object. */ |
life duration of the returned string is synchronous with the one of the condition object. */ |
709 |
const char *est_cond_phrase(ESTCOND *cond); |
const char *est_cond_phrase(ESTCOND *cond); |
710 |
|
|
711 |
|
|
712 |
/* Get a list object of attribute expressions of a condition object. |
/* Get a list object of attribute expressions of a condition object. |
713 |
`cond' specifies a condition object. |
`cond' specifies a condition object. |
714 |
The return value is a list object of attribute expressions of a condition object or `NULL' if |
The return value is a list object of attribute expressions of the condition object or `NULL' if |
715 |
it is not specified. The life duration of the returned object is synchronous with the one of |
it is not specified. The life duration of the returned object is synchronous with the one of |
716 |
the condition object. */ |
the condition object. */ |
717 |
const CBLIST *est_cond_attrs(ESTCOND *cond); |
const CBLIST *est_cond_attrs(ESTCOND *cond); |
719 |
|
|
720 |
/* Get the order expression of a condition object. |
/* Get the order expression of a condition object. |
721 |
`cond' specifies a condition object. |
`cond' specifies a condition object. |
722 |
The return value is the order expression of a condition object or `NULL' if it is not |
The return value is the order expression of the condition object or `NULL' if it is not |
723 |
specified. The life duration of the returned string is synchronous with the one of the |
specified. The life duration of the returned string is synchronous with the one of the |
724 |
condition object. */ |
condition object. */ |
725 |
const char *est_cond_order(ESTCOND *cond); |
const char *est_cond_order(ESTCOND *cond); |
727 |
|
|
728 |
/* Get the maximum number of retrieval of a condition object. |
/* Get the maximum number of retrieval of a condition object. |
729 |
`cond' specifies a condition object. |
`cond' specifies a condition object. |
730 |
The return value is the maximum number of retrieval of a condition object or -1 if it is not |
The return value is the maximum number of retrieval of the condition object or -1 if it is not |
731 |
specified. */ |
specified. */ |
732 |
int est_cond_max(ESTCOND *cond); |
int est_cond_max(ESTCOND *cond); |
733 |
|
|
734 |
|
|
735 |
/* Get the options of a condition object. |
/* Get the options of a condition object. |
736 |
`cond' specifies a condition object. |
`cond' specifies a condition object. |
737 |
The return value is the options of a condition object. */ |
The return value is the options of the condition object. */ |
738 |
int est_cond_options(ESTCOND *cond); |
int est_cond_options(ESTCOND *cond); |
739 |
|
|
740 |
|
|