| Server IP : 173.236.233.93 / Your IP : 216.73.217.165 Web Server : nginx/1.28.1 System : Linux dp-9c4aecd272 6.8.0-136-generic #136-Ubuntu SMP PREEMPT_DYNAMIC Wed Jul 1 21:53:05 UTC 2026 x86_64 User : wp_7qsbbu ( 25017242) PHP Version : 8.3.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /bin/ |
Upload File : |
#!/usr/bin/perl
use strict;
use warnings;
use Plucene;
use Plucene::TestCase;
use Benchmark 'cmpthese';
use File::Slurp;
chomp(my @words = read_file('/usr/share/dict/enable'));
my $sentence = sub {
my $words = shift;
return join " ", map $words[ rand @words ], 1 .. $words;
};
sub add_sentences {
my $length = shift;
new_index { add_document(content => $sentence->($length)) for 1 .. 100 };
}
print Plucene->VERSION, "\n";
cmpthese(
10 => {
'short' => sub { add_sentences(1) },
'medium' => sub { add_sentences(10) },
'long' => sub { add_sentences(100) },
});