Skip to content

Commit f9d58cb

Browse files
kytrinyxIsaacG
andauthored
Rework word-count documentation (#2247)
* Rework word-count documentation This PR is part of our project of making our Practice Exercises more consistent and human. For more context please see the following forum-thread: https://forum.exercism.org/t/new-project-making-practice-exercises-more-consistent-and-human-across-exercism/3943 The main change is to frame the exercise within the context of story. * Update exercises/word-count/instructions.md Co-authored-by: Isaac Good <[email protected]> * Update exercises/word-count/instructions.md Co-authored-by: Isaac Good <[email protected]> * Normalize formatting in word-count --------- Co-authored-by: Isaac Good <[email protected]>
1 parent d48e19a commit f9d58cb

File tree

3 files changed

+55
-31
lines changed

3 files changed

+55
-31
lines changed

exercises/word-count/description.md

Lines changed: 0 additions & 31 deletions
This file was deleted.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Instructions
2+
3+
Your task is to count how many times each word occurs in a subtitle of a drama.
4+
5+
The subtitles from these dramas use only ASCII characters.
6+
7+
The characters often speak in casual English, using contractions like _they're_ or _it's_.
8+
Though these contractions come from two words (e.g. _we are_), the contraction (_we're_) is considered a single word.
9+
10+
Words can be separated by any form of punctuation (e.g. ":", "!", or "?") or whitespace (e.g. "\t", "\n", or " ").
11+
The only punctuation that does not separate words is the apostrophe in contractions.
12+
13+
Numbers are considered words.
14+
If the subtitles say _It costs 100 dollars._ then _100_ will be its own word.
15+
16+
Words are case insensitive.
17+
For example, the word _you_ occurs three times in the following sentence:
18+
19+
> You come back, you hear me? DO YOU HEAR ME?
20+
21+
The ordering of the word counts in the results doesn't matter.
22+
23+
Here's an example that incorporates several of the elements discussed above:
24+
25+
- simple words
26+
- contractions
27+
- numbers
28+
- case insensitive words
29+
- punctuation (including apostrophes) to separate words
30+
- different forms of whitespace to separate words
31+
32+
`"That's the password: 'PASSWORD 123'!", cried the Special Agent.\nSo I fled.`
33+
34+
The mapping for this subtitle would be:
35+
36+
```text
37+
123: 1
38+
agent: 1
39+
cried: 1
40+
fled: 1
41+
i: 1
42+
password: 2
43+
so: 1
44+
special: 1
45+
that's: 1
46+
the: 2
47+
```
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Introduction
2+
3+
You teach English as a foreign language to high school students.
4+
5+
You've decided to base your entire curriculum on TV shows.
6+
You need to analyze which words are used, and how often they're repeated.
7+
8+
This will let you choose the simplest shows to start with, and to gradually increase the difficulty as time passes.

0 commit comments

Comments
 (0)