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 | |
---|