From d0933cff896dcfa1378211d82e9f6ce4e0f51691 Mon Sep 17 00:00:00 2001 From: davhojt Date: Wed, 25 May 2022 00:50:10 +0300 Subject: [PATCH] docs(counting_words): correct grammar --- subjects/counting_words/README.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/subjects/counting_words/README.md b/subjects/counting_words/README.md index ea17ba188..cf504660b 100644 --- a/subjects/counting_words/README.md +++ b/subjects/counting_words/README.md @@ -2,25 +2,25 @@ ### Instructions -In this program you will have to create a function `counting_words` that -receives a `&str` and returns each word and the number of times it appears on the string. +Create a function named `counting_words`, that receives a `&str`. It should return each word and the number of times it appears on the string. -The program will count as a word the following: +Each of the following will count as **1** word: -- A number like ("0" or "1234") will count as 1. -- A simple word or letter like ("a" or "they") will count as 1. -- Two simple words joined by a single apostrophe ("it's" or "they're") will count as 1. +- A number like "0" or "1234". +- A word or letter like "a" or "they". +- Two words joined by a single apostrophe like "it's" or "they're"). -The program must respect the following rules: +The function must respect the following rules: -- The count is case insensitive ("HELLO", "Hello", and "hello") are 3 uses of the same word. -- All forms of punctuation have to be ignored except for the apostrophe if used like the example above. +- The count is case insensitive, so that "HELLO", "Hello", and "hello" are 3 uses of the same word. +- All forms of punctuation are to be ignored, except for the apostrophe if used like the example above. - The words can be separated by any form of whitespace (ie "\t", "\n", " "). ### Expected Function ```rust -fn counting_words(words: &str) -> HashMap {} +fn counting_words(words: &str) -> HashMap { +} ``` ### Usage