Revision 114, 0.7 kB
(checked in by naoya_t, 16 years ago)
|
ypsilon: mecab-ffi first import
|
Line | |
---|
1 | (import (rnrs) |
---|
2 | (core) |
---|
3 | (srfi :28) |
---|
4 | (binding mecab-ffi)) |
---|
5 | |
---|
6 | (format #t "mecab version: ~s\n" (mecab-version)) |
---|
7 | |
---|
8 | (let ([m (mecab-new2 "")] |
---|
9 | [src "でもガミラスはまだまだ遠いかもしれないよ\x0;"]) |
---|
10 | ;; (display (mecab-sparse-tostr m src)) |
---|
11 | (format #t "~a => \n" src) |
---|
12 | (let loop ((node (mecab-sparse-tonode m src))) |
---|
13 | (unless (mecab-node-eos? node) |
---|
14 | (format #t "~a ~a pos:~d chartype:~d\n" |
---|
15 | (mecab-node-surface node) |
---|
16 | (mecab-node-feature node) |
---|
17 | ;;(mecab-node-length node) |
---|
18 | (mecab-node-posid node) |
---|
19 | (mecab-node-char-type node)) |
---|
20 | (loop (mecab-node-next node)) |
---|
21 | )) |
---|
22 | (mecab-destroy m)) |
---|