Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
13
Task/Inverted-index/Raku/inverted-index.raku
Normal file
13
Task/Inverted-index/Raku/inverted-index.raku
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
sub MAIN (*@files) {
|
||||
my %norm;
|
||||
do for @files -> $file {
|
||||
%norm.push: $file X=> slurp($file).lc.words;
|
||||
}
|
||||
(my %inv).push: %norm.invert.unique;
|
||||
|
||||
while prompt("Search terms: ").words -> @words {
|
||||
for @words -> $word {
|
||||
say "$word => {%inv.{$word.lc}//'(not found)'}";
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue