This is a project that will count the consonants and vowel in a certain text. You just have to write some text in the top text input and your character statistics will be updated as you are typing in real time without any lag. Below the number of consonants will be displayed the top 3 consonants and how many times they appeared in the text. The same happens for the vowels.
Install: Clone and run npm install
.
Dev mode: To run in dev mode run the command grunt serve
(If no browser opens go to: http://localhost:8000/).
Tests: To run tests you need to run the command mocha
(you have to install it previously globally).
Build: To build the application run the command grunt build
and then check the ./dist) folder.
- Generated project with webapp generator: In this way everything is already setup and I can focus on the task instead of the setup of the project.
- Created tests;
- Implemented the logic code;
- Implemented the user interface;
- Added compatibility with +IE8;
The goal is to allow the user to type in a text area and display the following information about the text that is typed:
- number of consonants that appear in the text
- number of vowels that appear in the text
- the top 3 consonants and top 3 vowels used and how many times they appear in the text.
This all has to update as the user is typing.
We'd like to see how you would handle this problem without using any MV* frameworks. jQuery or utility libraries are okay if you feel like you need any.
Unit tests (testing framework of your choice, headless or in-browser doesn't matter)
The logic of the app has been tested here.
Efficient and fast. Typing shouldn't cause any freezing.
Yes, you can test it here. There was no need to use a webworker in this case (IE8 also doesn't support them).
Separation of concerns. The DOM updates should be handled separately from the other logic.
The logic of the app is in the TextAnalyzer.js class and the view part of the app is in the EikeApp module.
It should also work in IE8+ (we'll have to support IE8 for the near future unfortunately).
Yes, has been tested with browserstack (Win7 @ IE8), but you can also test it by opening this link on IE8 browser.