summary refs log tree commit diff stats
path: root/raku/word-count/WordCount.rakumod
diff options
context:
space:
mode:
Diffstat (limited to 'raku/word-count/WordCount.rakumod')
-rw-r--r--raku/word-count/WordCount.rakumod5
1 files changed, 5 insertions, 0 deletions
diff --git a/raku/word-count/WordCount.rakumod b/raku/word-count/WordCount.rakumod
new file mode 100644
index 0000000..62bc1a5
--- /dev/null
+++ b/raku/word-count/WordCount.rakumod
@@ -0,0 +1,5 @@
+unit module WordCount;
+
+sub count-words (Str $sentence) is export {
+    $sentence.lc.comb(/\w+\'\w+|\w+/).Bag;
+}