⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 odeum.3

📁 harvest是一个下载html网页得机器人
💻 3
📖 第 1 页 / 共 2 页
字号:
.PPThe function `oditerinit' is used in order to initialize the iterator of a database handle..TP.B int oditerinit(ODEUM *odeum);`odeum' specifies a database handle.  If successful, the return value is true, else, it is false.  The iterator is used in order to access every document stored in a database..PPThe function `oditernext' is used in order to get the next key of the iterator..TP.B ODDOC *oditernext(ODEUM *odeum);`odeum' specifies a database handle.  If successful, the return value is the handle of the next document, else, it is `NULL'.  `NULL' is returned when no document is to be get out of the iterator.  It is possible to access every document by iteration of calling this function.  However, it is not assured if updating the database is occurred while the iteration.  Besides, the order of this traversal access method is arbitrary, so it is not assured that the order of string matches the one of the traversal access.  Because the handle of the return value is opened with the function `oddocopen', it should be closed with the function `oddocclose'..PPThe function `odsync' is used in order to synchronize updating contents with the files and the devices..TP.B int odsync(ODEUM *odeum);`odeum' specifies a database handle connected as a writer.  If successful, the return value is true, else, it is false.  This function is useful when another process uses the connected database directory..PPThe function `odoptimize' is used in order to optimize a database..TP.B int odoptimize(ODEUM *odeum);`odeum' specifies a database handle connected as a writer.  If successful, the return value is true, else, it is false.  Elements of the deleted documents in the inverted index are purged..PPThe function `odname' is used in order to get the name of a database..TP.B char *odname(ODEUM *odeum);`odeum' specifies a database handle.  If successful, the return value is the pointer to the region of the name of the database, else, it is `NULL'.  Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if it is no longer in use..PPThe function `odfsiz' is used in order to get the total size of database files..TP.B int odfsiz(ODEUM *odeum);`odeum' specifies a database handle.  If successful, the return value is the total size of the database files, else, it is \-1..PPThe function `odbnum' is used in order to get the total number of the elements of the bucket arrays used in the inverted index..TP.B int odbnum(ODEUM *odeum);`odeum' specifies a database handle.  If successful, the return value is the total number of the elements of the bucket arrays, else, it is \-1..PPThe function `oddnum' is used in order to get the number of the documents stored in a database..TP.B int oddnum(ODEUM *odeum);`odeum' specifies a database handle.  If successful, the return value is the number of the documents stored in the database, else, it is \-1..PPThe function `odwnum' is used in order to get the number of the words stored in a database..TP.B int odwnum(ODEUM *odeum);`odeum' specifies a database handle.  If successful, the return value is the number of the words stored in the database, else, it is \-1..PPThe function `odwritable' is used in order to check whether a database handle is a writer or not..TP.B int odwritable(ODEUM *odeum);`odeum' specifies a database handle.  The return value is true if the handle is a writer, false if not..PPThe function `odfatalerror' is used in order to check whether a database has a fatal error or not..TP.B int odfatalerror(ODEUM *odeum);`odeum' specifies a database handle.  The return value is true if the database has a fatal error, false if not..PPThe function `odinode' is used in order to get the inode number of a database directory..TP.B int odinode(ODEUM *odeum);`odeum' specifies a database handle.  The return value is the inode number of the database directory..PPThe function `odremove' is used in order to remove a database directory..TP.B int odremove(const char *name);`name' specifies the name of a database directory.  If successful, the return value is true, else, it is false.  A database directory can contain databases of other APIs of QDBM, they are also removed by this function..PPThe function `oddocopen' is used in order to get a document handle..TP.B ODDOC *oddocopen(const char *uri);`uri' specifies the URI of a document.  The return value is a document handle.  The ID number of a new document is not defined.  It is defined when the document is stored in a database..PPThe function `oddocclose' is used in order to close a document handle..TP.B void oddocclose(ODDOC *doc);`doc' specifies a document handle.  Because the region of a closed handle is released, it becomes impossible to use the handle..PPThe function `oddocaddattr' is used in order to add an attribute to a document..TP.B void oddocaddattr(ODDOC *doc, const char *name, const char *value);`doc' specifies a document handle.  `name' specifies the string of the name of an attribute.  `value' specifies the string of the value of the attribute..PPThe function `oddocaddword' is used in order to add a word to a document..TP.B void oddocaddword(ODDOC *doc, const char *normal, const char *asis);`doc' specifies a document handle.  `normal' specifies the string of the normalized form of a word.  Normalized forms are treated as keys of the inverted index.  If the normalized form of a word is an empty string, the word is not reflected in the inverted index.  `asis' specifies the string of the appearance form of the word.  Appearance forms are used after the document is retrieved by an application..PPThe function `oddocid' is used in order to get the ID number of a document..TP.B int oddocid(const ODDOC *doc);`doc' specifies a document handle.  The return value is the ID number of a document..PPThe function `oddocuri' is used in order to get the URI of a document..TP.B const char *oddocuri(const ODDOC *doc);`doc' specifies a document handle.  The return value is the string of the URI of a document..PPThe function `oddocgetattr' is used in order to get the value of an attribute of a document..TP.B const char *oddocgetattr(const ODDOC *doc, const char *name);`doc' specifies a document handle.  `name' specifies the string of the name of an attribute.  The return value is the string of the value of the attribute, or `NULL' if no attribute corresponds..PPThe function `oddocnwords' is used in order to get the list handle contains words in normalized form of a document..TP.B const CBLIST *oddocnwords(const ODDOC *doc);`doc' specifies a document handle.  The return value is the list handle contains words in normalized form..PPThe function `oddocawords' is used in order to get the list handle contains words in appearance form of a document..TP.B const CBLIST *oddocawords(const ODDOC *doc);`doc' specifies a document handle.  The return value is the list handle contains words in appearance form..PPThe function `oddocscores' is used in order to get the map handle contains keywords in normalized form and their scores..TP.B CBMAP *oddocscores(const ODDOC *doc, int max, ODEUM *odeum);`doc' specifies a document handle.  `max' specifies the max number of keywords to get.  `odeum' specifies a database handle with which the IDF for weighting is calculate.  If it is `NULL', it is not used.  The return value is the map handle contains keywords and their scores.  Scores are expressed as decimal strings.  Because the handle of the return value is opened with the function `cbmapopen', it should be closed with the function `cbmapclose' if it is no longer in use..PPThe function `odbreaktext' is used in order to break a text into words in appearance form..TP.B CBLIST *odbreaktext(const char *text);`text' specifies the string of a text.  The return value is the list handle contains words in appearance form.  Words are speparated with space characters and such delimiters as period, comma and so on.  Because the handle of the return value is opened with the function `cblistopen', it should be closed with the function `cblistclose' if it is no longer in use..PPThe function `odnormalizeword' is used in order to make the normalized form of a word..TP.B char *odnormalizeword(const char *asis);`asis' specifies the string of the appearance form of a word.  The return value is is the string of the normalized form of the word.  Alphabets of the ASCII code are unified into lower cases.  Words combosed of only delimiters are treated as empty strings.  Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if it is no longer in use..PPThe function `odpairsand' is used in order to get the common elements of two sets of documents..TP.B ODPAIR *odpairsand(ODPAIR *apairs, int anum, ODPAIR *bpairs, int bnum, int *np);`apairs' specifies the pointer to the former document array.  `anum' specifies the number of the elements of the former document array.  `bpairs' specifies the pointer to the latter document array.  `bnum' specifies the number of the elements of the latter document array.  `np' specifies the pointer to a variable to which the number of the elements of the return value is assigned.  The return value is the pointer to a new document array whose elements commonly belong to the specified two sets.  Elements of the array are sorted in descending order of their scores.  Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if it is no longer in use..PPThe function `odpairsor' is used in order to get the sum of elements of two sets of documents..TP.B ODPAIR *odpairsor(ODPAIR *apairs, int anum, ODPAIR *bpairs, int bnum, int *np);`apairs' specifies the pointer to the former document array.  `anum' specifies the number of the elements of the former document array.  `bpairs' specifies the pointer to the latter document array.  `bnum' specifies the number of the elements of the latter document array.  `np' specifies the pointer to a variable to which the number of the elements of the return value is assigned.  The return value is the pointer to a new document array whose elements belong to both or either of the specified two sets.  Elements of the array are sorted in descending order of their scores.  Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if it is no longer in use..PPThe function `odpairsnotand' is used in order to get the difference set of documents..TP.B ODPAIR *odpairsnotand(ODPAIR *apairs, int anum, ODPAIR *bpairs, int bnum, int *np);`apairs' specifies the pointer to the former document array.  `anum' specifies the number of the elements of the former document array.  `bpairs' specifies the pointer to the latter document array of the sum of elements.  `bnum' specifies the number of the elements of the latter document array.  `np' specifies the pointer to a variable to which the number of the elements of the return value is assigned.  The return value is the pointer to a new document array whose elements belong to the former set but not to the latter set.  Elements of the array are sorted in descending order of their scores.  Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if it is no longer in use..PPThe function `odpairssort' is used in order to sort a set of documents in descending order of scores..TP.B void odpairssort(ODPAIR *pairs, int pnum);`pairs' specifies the pointer to a document array.  `pnum' specifies the number of the elements of the document array..PPThe function `odlogarithm' is used in order to get the natural logarithm of a number..TP.B double odlogarithm(double x);`x' specifies a number.  The return value is the natural logarithm of the number.  If the number is equal to or less than 1.0, the return value is 0.0.  This function is useful when an application calculates the IDF of search results..PPThe function `odvectorcosine' is used in order to get the cosine of the angle of two vectors..TP.B double odvectorcosine(const int *avec, const int *bvec, int vnum);`avec' specifies the pointer to one array of numbers.  `bvec' specifies the pointer to the other array of numbers.  `vnum' specifies the number of elements of each array.  The return value is the cosine of the angle of two vectors.  This function is useful when an application calculates similarity of documents..PPAlthough each function of Odeum is not reentrant, it does not use any static object internally.  So, it can be used as a thread\-safe function if each calling and reference to the external variable `dpecode' are under exclusion control, on the assumption that `errno', `malloc', and so on are thread\-safe..SH SEE ALSO.PP.BR qdbm (3),.BR depot (3),.BR curia (3),.BR relic (3),.BR hovel (3),.BR cabin (3),.BR villa (3),.BR ndbm (3),.BR gdbm (3)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -