ruby-pytst is a port of pytst to Ruby. It is a implementation of Ternary Search Trie (TST) and it also supports scanning by the Aho-Corasick algorithm. It is built with SWIG.
This software is distributed under LGPL.
I have successfully built on the following environments.
tst_wrap.cxx in this package was generated on 1 with SWIG 1.3.19.
Masaki Yatsu <yatsu AT yatsu.info>
You can download ruby-pytst from RubyForge project page.
[RubyForge: ruby-pytst's file list]
Generate the Makefile.
% ruby extconf.rb
Make it.
% make
Then, install it as root.
% make install
If you want to generate the Ruby wrapper codes from tst.i by yourself, execute the following at the beginning.
% swig -c++ -ruby -Iinclude tst.i
There is no documentation at this point, but there is README.html of pytst in the doc directory.
There are examples in the example directory. You can run examples like this.
% ruby example/tokenize.rb
ruby-pytst supports following character sets.
You have to specify $KCODE *before* you create a Pytst::TST.
There is the EUC-JP example in the example directory.
% ruby -Ke example/japanese_euc.rb
The option '-Ke' means $KCODE = 'EUC'.