Public Member Functions | |
Document () | |
Document (const char *draft) | |
Document (ESTMTDB *db, int number, int options) | |
~Document () | |
void | add_attr (const char *name, const char *value) |
void | add_text (const char *text) |
void | add_hidden_text (const char *text) |
int | get_id () |
std::vector< std::string > * | get_attr_names () |
const char * | get_attr (const char *name) |
const char * | text () |
const char * | get_dump_draft () |
const char * | make_snippet (std::vector< std::string > _words, int wwidth, int hwidth, int awidth) |
bool | scan_words (std::vector< std::string > _words) |
Public Attributes | |
ESTDOC * | doc |
Private Attributes | |
std::string | text_buf |
|
constructor Definition at line 65 of file HyperEstraierWrapper.cpp. References doc. 00065 { 00069 doc = est_doc_new(); 00070 }
|
|
destructor Definition at line 71 of file HyperEstraierWrapper.cpp. References doc. 00071 { 00075 doc = est_doc_new_from_draft(draft); 00076 }
|
|
constructor(for internal use only) Definition at line 77 of file HyperEstraierWrapper.cpp. References doc. 00077 { 00081 doc = est_mtdb_get_doc(db, number, options); 00082 }
|
|
destructor Definition at line 83 of file HyperEstraierWrapper.cpp. References doc. 00083 { 00087 est_doc_delete(doc); 00088 }
|
|
add an attribute to a document object Definition at line 89 of file HyperEstraierWrapper.cpp. References doc. 00089 { 00093 est_doc_add_attr(doc, name, value); 00094 }
|
|
add a hidden sentence to a document object Definition at line 101 of file HyperEstraierWrapper.cpp. References doc.
|
|
add a sentence of text to a document object Definition at line 95 of file HyperEstraierWrapper.cpp. References doc.
|
|
get the value of an attribute of a document object Definition at line 125 of file HyperEstraierWrapper.cpp. References doc. 00125 { 00129 return est_doc_attr(doc, name); 00130 }
|
|
get a list of attribute names of a document object Definition at line 113 of file HyperEstraierWrapper.cpp. References doc. 00113 { 00117 std::vector<std::string> * vs = new std::vector<std::string>; 00118 CBLIST * attr_names = est_doc_attr_names(doc); 00119 for (int i=0; i < cblistnum(attr_names); i++) { 00120 vs->push_back(cblistval(attr_names, i, NULL)); 00121 } 00122 cblistclose(attr_names); 00123 return vs; 00124 }
|
|
dump draft data of a document object Definition at line 145 of file HyperEstraierWrapper.cpp. References doc. 00145 { 00149 return est_doc_dump_draft(doc); 00150 }
|
|
get the ID number of a document object Definition at line 107 of file HyperEstraierWrapper.cpp. References doc. 00107 { 00111 return est_doc_id(doc); 00112 }
|
|
make a snippet of the body text of a document object Definition at line 151 of file HyperEstraierWrapper.cpp. References doc. 00151 { 00155 CBLIST * words; 00156 std::vector<std::string>::iterator iter; 00157 00158 words = cblistopen(); 00159 00160 for (iter = _words.begin(); _words.end() != iter; iter++) { 00161 cblistpush(words, iter->c_str(), -1); 00162 } 00163 00164 const char *result = est_doc_make_snippet(doc, words, wwidth, hwidth, awidth); 00165 00166 cblistclose(words); 00167 00168 return result; 00169 }
|
|
check whether the text of a document object includes every specified words Definition at line 170 of file HyperEstraierWrapper.cpp. References doc. 00170 { 00174 CBLIST *words; 00175 std::vector<std::string>::iterator iter; 00176 00177 words = cblistopen(); 00178 00179 for (iter = _words.begin(); _words.end() != iter; iter++) { 00180 cblistpush(words, iter->c_str(), -1); 00181 } 00182 00183 int result = est_doc_scan_words(doc, words); 00184 00185 cblistclose(words); 00186 00187 return result; 00188 }
|
|
get a list of sentences of the text of a document object Definition at line 131 of file HyperEstraierWrapper.cpp. 00131 { 00135 if (text_buf == "") { 00136 const CBLIST *texts; 00137 texts = est_doc_texts(doc); 00138 text_buf = ""; 00139 for(int i = 0; i < cblistnum(texts); i++) { 00140 text_buf += cblistval(texts, i, NULL); 00141 } 00142 } 00143 return text_buf.c_str(); 00144 }
|
|
Definition at line 63 of file HyperEstraierWrapper.cpp. Referenced by add_attr(), add_hidden_text(), add_text(), Document(), Database::etch_doc(), get_attr(), get_attr_names(), get_dump_draft(), get_id(), make_snippet(), Database::put_doc(), scan_words(), text(), and ~Document(). |
|
Definition at line 61 of file HyperEstraierWrapper.cpp. Referenced by text(). |