Algorithm::Diff で類似文字列検索 2008-04-22-3 [Algorithm][Programming] Perl のモジュール Algorithm::Diff[2004-12-12-2]を使って、線形時間で類似文字列検索するサンプルプログラム。 まあ、 agrep があればそれでいいんですけどね。 サンプルコード(ads.pl): #!/usr/bin/perl use strict; use warnings; use Algorithm::Diff; use utf8; use Encode; use open ':utf8'; binmode STDIN, ":utf8"; binmode STDOUT, ":utf8"; my $key = shift; my @seq1 = split(//, decode('utf-8', $key)); while (<
![Algorithm::Diff で類似文字列検索](https://cdn-ak-scissors.b.st-hatena.com/image/square/af37977ee866988286b95e74fff98500a190545c/height=288;version=1;width=512/https%3A%2F%2Fchalow.net%2Fimages%2Ftcl-logo-25.png)