root/lang/scheme/r6rs/mosh/ffi/mecab-ffi/trunk/sample.scm
@
109
| Revision 109, 508 bytes (checked in by naoya_t, 17 years ago) |
|---|
| Line | |
|---|---|
| 1 | (import (rnrs) |
| 2 | (mosh) |
| 3 | (binding mecab)) |
| 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.
