Inverted index: Difference between revisions
Content added Content deleted
m (→{{header|Perl 6}}: handle case of search word not found) |
SqrtNegInf (talk | contribs) 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; |
|||
$file |
do for @files -> $file { |
||
%norm:push: $file X=> slurp($file).lc.words; |
|||
} |
} |
||
(my %inv).push: %norm.invert.unique; |
(my %inv).push: %norm.invert.unique; |