Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #19: Implementing reading time feature and tester file #121

Closed
wants to merge 4 commits into from
Closed

Fixes #19: Implementing reading time feature and tester file #121

wants to merge 4 commits into from

Conversation

yohan-choi-dev
Copy link

I added basic features for text analysis. In the beginning, my goal was to add reading-time features. However, I realized that word count, the level of writing (readability based on Flesch-Kincaid grade level) and reading-time is highly connected.

For instance, the formula for readability is formula_image
To get the level of writing, we need the number of words, and the formula to get reading time is the total number of words / word per minute. Beside reading-level library that I use to get Flesch_Kincaid Grade, it also returns the count of words.

Since the three basic features are highly coupled, I think that coupling them together as one class will be better than implementing three different functions. I tried to implement the OOP concept into the function. Because an ES6 class does not fully support encapsulation, I used ES5 syntax with the closures concept in JavaScript to implement private members.

The analyzeText() function return analysis object that contains wordCount, readability, readingTime. The analyzeText() function contains two different public query functions, getAnalysis(), and getAsyAnalsis(). In case of using promise channing, getAsyAnalsis() can be used.

The tester file provides queries to check if functions work well, but it will need more functionality.

I'm not familiar with JavaScript so if you have any opinions, feel free to share your opinions. I will refect the opinions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants