Inverted index: Difference between revisions

Content added Content deleted
m (→‎{{header|Perl 6}}: handle case of search word not found)
m (→‎{{header|Perl 6}}: moved hash initialization inside do block)
Line 2,029: Line 2,029:
{{works with|rakudo|2015-09-16}}
{{works with|rakudo|2015-09-16}}
<lang perl6>sub MAIN (*@files) {
<lang perl6>sub MAIN (*@files) {
(my %norm).push: do for @files -> $file {
my %norm;
$file X=> slurp($file).lc.words;
do for @files -> $file {
%norm:push: $file X=> slurp($file).lc.words;
}
}
(my %inv).push: %norm.invert.unique;
(my %inv).push: %norm.invert.unique;