「make install」で、wget http://ta2o.net/tools/sufary/src/sufary-2.3.8.tar.gz tar zxvf sufary-2.3.8.tar.gz cd sufary-2.3.8 ./configure --prefix=/home/YOURID/opt make make install
「make install」がうまくいかないので手作業。cd perl/SUFARY perl Makefile.PL make make test rsync -av blib/lib/ ~/lib/perl rsync -av blib/arch/auto ~/lib/perl/
echo "hello\nhi\nhell\n" > a.txt mkary -q a.txt
#!/usr/bin/perl BEGIN {unshift @INC, "/home/YOURID/lib/perl"}; use strict; use warnings; use SUFARY; my ($fn, $key) = @ARGV; my $sa = SUFARY->new($fn); my ($left, $right) = $sa->range_search($key); exit unless defined $left and defined $right; for (my $i = $left; $i <= $right; $i++) { print $sa->get_line($sa->get_position($i)); }
% ./sa.pl a.txt hello hello % ./sa.pl a.txt el hell hello % ./sa.pl a.txt hi hi % ./sa.pl a.txt h hell hello hi
mkdir mttmp cd mttmp wget http://www.forkosh.com/mimetex.exe/freebsd/mimetex.zip unzip mimetex.zip mv mimetex.cgi ~/www/chalow.net/misc/