Word Counter is a simple word count application created to introduce students involved in the Technology Committee in CEAS Tribunal to TypeScript. This lesson acts as a part 2 to the original JavaScript version of the lesson.
The words to count input box will accept sentences and once the count button is pressed, the sentence will be parsed by the spaces in the text while filtering out punctuation (aside from hyphens). Each word of the parsed result will be displayed below along with the word count.
The specific word input box will accept any specific word to count in the words to count input box. Instead of displaying the total word count, the count of the specific word will be displayed. The displayed parsed result will still show all of the words in the sentence, however, every occurrence of the specific word will be underlined.
- Students will need to implement the code from the original JavaScript version of the lesson.
- Convert all JavaScript files to TypeScript and type annotate the existing code.
- Step by step, implement a version of the preprocessor functionality in an object-oriented style with classes to demostrate the use of TypeScript class annotations.