summary refs log tree commit diff stats
path: root/raku/word-count/WordCount.rakumod
blob: 62bc1a5b85befac131a3ed847c0ecad6579f8791 (plain) (blame)
1
2
3
4
5
unit module WordCount;

sub count-words (Str $sentence) is export {
    $sentence.lc.comb(/\w+\'\w+|\w+/).Bag;
}