LoginSignup
2
1

More than 3 years have passed since last update.

TinySegmenter for VBA クラス版

Last updated at Posted at 2017-05-12

前口上

日本語文章を分かち書きをしてくれるオリジナルのjavascript版
http://chasen.org/~taku/software/TinySegmenter/
のVBA版がある
http://pub.ne.jp/arihagne/?entry_id=2768818
らしいけど繋がらないので、
http://www16.plala.or.jp/arihagne/software/TinySegmenter.txt
を取ってきて、オリジナルのv0.2の修正内容の反映と(雑に)クラス化してみました。

コード

ちょっと長いのでGISTからどうぞ。
https://gist.github.com/acknpop/c42a90c67525cdfaf3b789c28f89e6f2

使用例

上記クラスをインポートしてから、下記をモジュールに書いて実行。


Sub Sample()
    Dim ts as TinySegmenter
    Set ts = New TinySegmenter

    Debug.Print Join(ts.segment("私の名前は中野です"), "|")

    Set ts = Nothing
End Sub

補記

Excel上で形態素解析が必要な場合は下記をご参照。
http://qiita.com/mima_ita/items/bc2aeb060ee12d280d7b
http://qiita.com/acknpop/items/4c64f73e385aee417c98

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1