feat(analyzing): add functionWordCount and contentWordCount with tests - #80
Conversation
|
@Samarth2190 Hi 👋, |
|
@Samarth2190 Sir, I’ve updated the tests to use Node’s test runner and removed the Jest config. All tests are passing now ✅. |
|
Hi @Samarth2190 Sir, just checking in. Please let me know if there’s anything I should improve or adjust in this PR. |
|
@satyasrisundarapalli Please make the necessary changes to README file too |
|
@Samarth2190 Hi Sir👋, I’ve updated the README.md with the details for contentWordCount and functionWordCount. Please let me know if any further changes are needed 🙂 |
|
@Samarth2190 Ok sir,I will work on it. |
|
Hi @Samarth2190 Sir! I’ve updated the README file to follow the standard format, added proper examples, and improved the return sections for contentWordCount and functionWordCount. I also cleaned up the package.json by removing unnecessary dependencies. Thanks for guiding me through this! Looking forward to your review! |
|
Hi @Samarth2190 Sir ! |
|
Hi @Samarth2190 Sir👋, just wanted to kindly follow up on this PR. Please let me know if you’d like me to make any changes or improvements before it can be merged. Thanks a lot for your time and review! |
|
Hi @Samarth2190 👋, |
|
Hi @satyasrisundarapalli , there are some minor inconsistencies in the README file. The format is not the same as other utility definitions in the file. Also there is some changes made in the pacakage.json and package-lock.json. Looking forward to merging your PR! |
@Samarth2190 Ok sir, I will fix those issues. |
|
Hi @Samarth2190 Sir ! |
✨ Summary
This PR introduces new utilities to analyze function words and content words in text.
✅ Changes
Added functionWordCount in src/analyzing/functionWordCount.ts
Added contentWordCount in src/analyzing/contentWordCount.ts
Added unit tests for both utilities in src/tests/analyzing/
🧪 Testing
Verified that function words (e.g., the, is, of) are counted correctly.
Verified that content words (e.g., elephants, run, fast) are counted correctly.
Added test cases for empty strings, punctuation handling, and case insensitivity.
🔗 Related Issue
Resolves: Function words vs content words