- By Rowan Lea
- ·
- Posted Jan 25, 2024 10:21:11 AM
Songbird
Inspired by the creative works of Gawain Hewitt: https://gawainhewitt.co.uk/
As a developer that writes blog posts I want a tool that helps me to understand better the text I am writing. For that I need a way to know the following:
interface Processor {
analyse(text: string);
}
The usage of such interface is not required.
Given the following text:
Hello, this is an example for you to practice. You should grab this text and make it as your test case.
The output should be:
Those are the top 10 words used:
1. you
2. this
3. your
4. to
5. text
6. test
7. should
8. practice
9. make
10. it
The text has in total 21 words
Next up, the kata starts to be a bit more complex. Make sure to complete this challenge first before going on into the second.
Now I would like to know how much time would it take the user to read my post, for that I should apply the following formula:
(The average reading rate is actually 238, according to this study, but 200 is a nice compromise and is easier to remember.)
Here's the formula:
Example:
783 words ÷ 200 = 3.915 (3 = 3 minutes)
.915 × .60 = .549 (a little over 54 seconds, so I'd bump it up to 60 seconds, or a full minute)
reading time for this example article is 4 minutes.
Besides the previous features, the text processing also should have:
javascript
anything inside should be ignored)Given the example for 1, this would be a text with code snippets:
Hello, this is an example for you to practice. You should grab
this text and make it as your test case:
if (true) {
console.log('should should should')
}
The text processing output should ignore the code snippet. Meaning, that the output should be:
Those are the top 10 words used:
1. you
2. this
3. your
4. to
5. text
6. test
7. should
8. practice
9. make
10. it
The text has in total 21 words
Note that, the word should is the same, and it does not goes up in the list as should appears four times (more than the word you).
Inspired by the creative works of Gawain Hewitt: https://gawainhewitt.co.uk/
What do we want to build? We are building a shopping cart for an online grocery shop. The idea of this kata is to build the product in an iterative..
Iteration 1 Business rules We want to build an ATM machine and the first thing we need to do, is to create the software that will breakdown which..
Join our newsletter for expert tips and inspirational case studies
Join our newsletter for expert tips and inspirational case studies