root/lang/scheme/r6rs/mosh/ffi/mecab-ffi/trunk/sample.scm @ 111

Revision 110, 0.5 kB (checked in by naoya_t, 16 years ago)

mosh/mecab-ffi: (binding mecab) => (binding mecab-ffi)

Line 
1(import (rnrs)
2        (mosh)
3        (binding mecab-ffi))
4
5(let ([m (mecab-new2 "")] [src (string->utf8z "ぼく、ひげぽん。")])
6  (let loop ((n (mecab-sparse-tonode m src)))
7    (unless (mecab-node-eos? n)
8      (when (mecab-node-normal? n)
9        (format #t "~d ~a pos:~d chartype:~d\n"
10                (mecab-node-surface n)
11                (mecab-node-feature n)
12                (mecab-node-posid n)
13                (mecab-node-char-type n)))
14      (loop (mecab-node-next n))))
15  (mecab-destroy m))
16
Note: See TracBrowser for help on using the browser.