| 102 | ;; |
| 103 | (define-cproc cabocha-sparse-totree (c::<cabocha-t> str::<const-cstring>) |
| 104 | (call <cabocha-tree-t> "cabocha_sparse_totree")) |
| 105 | |
| 106 | (define-cproc cabocha-sparse-totree2 (c::<cabocha-t> str::<const-cstring> len::<uint>) |
| 107 | (call <cabocha-tree-t> "cabocha_sparse_totree2")) |
| 108 | |
| 109 | ;; |
| 110 | ;; tree |
| 111 | ;; |
| 112 | (define-cproc cabocha-tree-new () |
| 113 | (call <cabocha-tree-t> "cabocha_tree_new")) |
| 114 | (define-cproc cabocha-tree-destroy (tree::<cabocha-tree-t>) |
| 115 | (call <void> "cabocha_tree_destroy")) |
| 116 | (define-cproc cabocha-tree-empty (tree::<cabocha-tree-t>) |
| 117 | (call <int> "cabocha_tree_empty")) |
| 118 | (define-cproc cabocha-tree-clear (tree::<cabocha-tree-t>) |
| 119 | (call <void> "cabocha_tree_clear")) |
| 120 | (define-cproc cabocha-tree-clear-chunk (tree::<cabocha-tree-t>) |
| 121 | (call <void> "cabocha_tree_clear_chunk")) |
| 122 | (define-cproc cabocha-tree-size (tree::<cabocha-tree-t>) |
| 123 | (call <uint> "cabocha_tree_size")) |
| 124 | (define-cproc cabocha-tree-chunk-size (tree::<cabocha-tree-t>) |
| 125 | (call <uint> "cabocha_tree_chunk_size")) |
| 126 | (define-cproc cabocha-tree-token-size (tree::<cabocha-tree-t>) |
| 127 | (call <uint> "cabocha_tree_token_size")) |
| 128 | (define-cproc cabocha-tree-sentence (tree::<cabocha-tree-t>) |
| 129 | (call <const-cstring> "cabocha_tree_sentence")) |
| 130 | (define-cproc cabocha-tree-sentence-size (tree::<cabocha-tree-t>) |
| 131 | (call <uint> "cabocha_tree_sentence_size")) |
| 132 | (define-cproc cabocha-tree-set-sentence (tree::<cabocha-tree-t> sentence::<const-cstring> length::<uint>) |
| 133 | (call <void> "cabocha_tree_set_sentence")) |
| 134 | (define-cproc cabocha-tree-read (tree::<cabocha-tree-t> input::<const-cstring> length::<uint> input-layer::<int>) |
| 135 | ;; cabocha_input_layer_t : enum { INPUT_RAW_SENTENCE, _POS, _CHUNK, _SELECTION, _DEP } |
| 136 | (call <int> "cabocha_tree_read")) |
| 137 | (define-cproc cabocha-tree-read-from-mecab-node (tree::<cabocha-tree-t> node::<const-mecab-node-t>) |
| 138 | (call <int> "cabocha_tree_read_from_mecab_node")) |
| 139 | |
| 140 | (define-cproc cabocha-tree-token (tree::<cabocha-tree-t> i::<uint>) |
| 141 | (call <cabocha-token-t> "cabocha_tree_token")) ;; const |
| 142 | (define-cproc cabocha-tree-chunk (tree::<cabocha-tree-t> i::<uint>) |
| 143 | (call <cabocha-chunk-t> "cabocha_tree_chunk")) ;; const |
| 144 | |
| 145 | (define-cproc cabocha-tree-add-token (tree::<cabocha-tree-t>) |
| 146 | (call <cabocha-token-t> "cabocha_tree_add_token")) |
| 147 | (define-cproc cabocha-tree-add-chunk (tree::<cabocha-tree-t>) |
| 148 | (call <cabocha-chunk-t> "cabocha_tree_add_chunk")) |
| 149 | |
| 150 | (define-cproc cabocha-tree-strdup (tree::<cabocha-tree-t> str::<const-cstring>) |
| 151 | (call <const-cstring> "cabocha_tree_strdup")) |
| 152 | (define-cproc cabocha-tree-alloc (tree::<cabocha-tree-t> size::<uint>) |
| 153 | (call <const-cstring> "cabocha_tree_alloc")) |
| 154 | |
| 155 | (define-cproc cabocha-tree-tostr (tree::<cabocha-tree-t> format::<int>) ;; cabocha_format_t : ENUM { FORMAT-TREE -LATTICE -TREE_LATTICE -XML -NONE } |
| 156 | (call <const-cstring> "cabocha_tree_tostr")) |
| 157 | ;(define-cproc cabocha-tree-tostr2 (tree::<cabocha-tree-t> format::<cabocha-format-t str::<const-cstring> length::<uint>) |
| 158 | ; const char *cabocha_tree_tostr2(cabocha_tree_t* tree, cabocha_format_t format, |
| 159 | ; char *str, size_t length); |
| 160 | (define-cproc cabocha-tree-set-charset (tree::<cabocha-tree-t> charset::<int>) ;; cabocha_charset_t : enum { EUC_JP, CP932, UTF8, ASCII } |
| 161 | (call <void> "cabocha_tree_set_charset")) |
| 162 | (define-cproc cabocha-tree-charset (tree::<cabocha-tree-t>) |
| 163 | (call <int> "cabocha_tree_charset")) ;; cabocha_charset_t |
| 164 | (define-cproc cabocha-tree-set-posset (tree::<cabocha-tree-t> posset::<int>) ;; cabocha_posset_t : enum { IPA, JUMAN } |
| 165 | (call <void> "cabocha_tree_set_posset")) |
| 166 | (define-cproc cabocha-tree-posset (tree::<cabocha-tree-t>) |
| 167 | (call <int> "cabocha_tree_posset")) ;; cabocha_posset_t |
| 168 | (define-cproc cabocha-tree-set-output-layer (tree::<cabocha-tree-t> output-layer::<int>) |
| 169 | ;; cabocha_output_layer_t : enum { OUTPUT*_RAW_SENTENCE, _POS, _CHUNK, _SELECTION, _DEP } |
| 170 | (call <void> "cabocha_tree_set_output_layer")) |
| 171 | (define-cproc cabocha-tree-output-layer (tree::<cabocha-tree-t>) |
| 172 | (call <int> "cabocha_tree_output_layer")) ;; cabocha_output_layer_t |
| 173 | |
| 174 | (define-cproc cabocha-learn (&rest args) |
| 175 | (expr <int> "cabocha_call_int_func(&cabocha_learn,args)")) |
| 176 | (define-cproc cabocha-system-eval (&rest args) |
| 177 | (expr <int> "cabocha_call_int_func(&cabocha_system_eval,args)")) |
| 178 | (define-cproc cabocha-model-index (&rest args) |
| 179 | (expr <int> "cabocha_call_int_func(&cabocha_model_index,args)")) |
| 180 | |
| 181 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 182 | (define-cproc cabocha-chunk-link (chunk::<cabocha-chunk-t>) |
| 183 | (expr <int> "chunk->link")) |
| 184 | (define-cproc cabocha-chunk-head-pos (chunk::<cabocha-chunk-t>) |
| 185 | (expr <uint> "chunk->head_pos")) |
| 186 | (define-cproc cabocha-chunk-func-pos (chunk::<cabocha-chunk-t>) |
| 187 | (expr <uint> "chunk->func_pos")) |
| 188 | (define-cproc cabocha-chunk-token-size (chunk::<cabocha-chunk-t>) |
| 189 | (expr <uint> "chunk->token_size")) |
| 190 | (define-cproc cabocha-chunk-token-pos (chunk::<cabocha-chunk-t>) |
| 191 | (expr <uint> "chunk->token_pos")) |
| 192 | (define-cproc cabocha-chunk-score (chunk::<cabocha-chunk-t>) |
| 193 | (expr <float> "chunk->score")) |
| 194 | (define-cproc cabocha-chunk-feature-list (chunk::<cabocha-chunk-t>) |
| 195 | " return Scm_MakeStringList(chunk->feature_list,chunk->feature_list_size);") |
| 196 | (define-cproc cabocha-chunk-feature-list-size (chunk::<cabocha-chunk-t>) |
| 197 | (expr <uint> "chunk->feature_list_size")) |
| 198 | |
| 199 | (define-cproc cabocha-token-surface (token::<cabocha-token-t>) |
| 200 | (expr <const-cstring> "token->surface")) |
| 201 | (define-cproc cabocha-token-normalized-surface (token::<cabocha-token-t>) |
| 202 | (expr <const-cstring> "token->normalized_surface")) |
| 203 | (define-cproc cabocha-token-feature (token::<cabocha-token-t>) |
| 204 | (expr <const-cstring> "token->feature")) |
| 205 | (define-cproc cabocha-token-feature-list (token::<cabocha-token-t>) |
| 206 | " return Scm_MakeStringList(token->feature_list,token->feature_list_size);") |
| 207 | (define-cproc cabocha-token-feature-list-size (token::<cabocha-token-t>) |
| 208 | (expr <uint> "token->feature_list_size")) |
| 209 | (define-cproc cabocha-token-ne (token::<cabocha-token-t>) |
| 210 | (expr <const-cstring> "token->ne")) |
| 211 | (define-cproc cabocha-token-chunk (token::<cabocha-token-t>) |
| 212 | (expr <cabocha-chunk-t> "token->chunk")) |
| 213 | |
| 214 | |