...怎么使用libscws,每一个线程都需要进行分词? typedef struct { xdict_t d; rule_t r; unsigned char *mblen; unsigned int mode; unsigned char *txt; int zis; int len; int off; int wend; scws_res_t res0; scws_res_t res1; word_t **wmap; struct scws_zchar *zmap...
scws.h也有问题 struct scws_topword { char *word; float weight; short times; char attr[3];//原来是2 scws_top_t next; }; 应该跟以下结构一致。 struct scws_result { int off; float idf; unsigned char len; char attr[3]; scws_res_t ne...
...,如scws.c:1527行附近的下面两行, top = (scws_top_t) malloc(sizeof(struct scws_topword)); top->weight = cur->idf; 182行的下面两行 res = (scws_res_t) malloc(sizeof(struct scws_result)); \ res->off = o; 234行的这两行 dst = malloc(len+1); memcpy(dst, src, len);
.c文件追加 [code] typedef struct xdb_tree_node { char *key; int vlen; int voff; struct xdb_tree_node* next; } xdb_tree_list, *xdb_tree_plist; int travel_index = -1; xdb_tree_plist _xdb_tree_plist = NULL; void _xdb_next_tree_read(xdb_t x, xptr_t ptr) { if (ptr->len...
...试拷贝 scws_st 结构,不保证这类拷贝结果会有用。 typedef struct { xdict_t d; rule_t r; unsigned char *mblen; unsigned int mode; unsigned char *txt; int len; int off; scws_res_t res0; scws_res_t res1; word_t **wmap; struct scws_zchar *zmap; } scws_st, *scws_t; ...
运行 configure 时有没有正确的指定了 scws 的路径呢, 看这样的提示应该是有一些头文件丢失导致了struct 定义缺失, 所以就大量的 .h 出现语法错误. 看你这里的提示应该是缺省 pthread 库... 检查一下吧
..._t" ../../storage/myisam/myisamdef.h:217: warning: no semicolon at end of struct or union ../../storage/myisam/myisamdef.h:222: error: syntax error before "mmap_lock" ../../storage/myisam/myisamdef.h:222: warning: data definition has no type or storage class ../../storage/myisam/myisamdef.h:223:...
..._t" ../../storage/myisam/myisamdef.h:217: warning: no semicolon at end of struct or union ../../storage/myisam/myisamdef.h:222: error: syntax error before "mmap_lock" ../../storage/myisam/myisamdef.h:222: warning: data definition has no type or storage class ../../storage/myisam/myisamdef.h:223:...
..._t" ../../storage/myisam/myisamdef.h:216: warning: no semicolon at end of struct or union ../../storage/myisam/myisamdef.h:221: error: syntax error before "mmap_lock" ../../storage/myisam/myisamdef.h:221: warning: data definition has no type or storage class ../../storage/myisam/myisamdef.h:222:...
...fine SCWS_WORD_MALLOCED 0x100 只要将 0x100 改变 0x80 即可,因为 struct scws_word 中定义的 flag 为 unsigned char 即 8bit, 容不下 0x100 导致,所有的 ->flag |= SCWS_WORD_MALLOCED 失效,以至于在 scws.c 中无法正确的释放这些内存。 再次感谢您的汇报...