-
-
Couldn't load subscription status.
- Fork 1.4k
Description
Fork, Commit, Merge - Medium Issue 2 (C++)
Implement a Basic Text File Parser
Note: You don't have ask permission to start solving the issue or get assigned, since these issues are supposed to be always open for new contributors. The actions-user bot will reset the file back to previous state for the next contributor after your commit is merged. So you can just simply start working with the issue right away!
Navigate to the tasks/c++/medium/text_file_parser directory from the root of your project.
Open the TextFileParser.cpp file and start implementing your solution!
Description:
Create a C++ program that reads a text file and counts the frequency of each word in the file. The program should then output each word along with its corresponding count to the console, sorted by the most frequent words first.
Requirements:
- Read a file named
input.txt. - Ignore case (e.g., "The" and "the" are considered the same word).
- Exclude common English stop words (e.g., "the", "is", "at", "which", "on").
- Use standard C++ libraries only.
Example:
Given input.txt:
Hello world!
The world is a beautiful place.
The weather is wonderful.Output should be:
world - 2
beautiful - 1
place - 1
weather - 1
wonderful - 1
hello - 1Compiling and Running:
To test the program you have to first make sure you are in the right directory:
cd tasks/c++/medium/text_file_parserThen compile the files:
g++ -o TextFileParser TextFileParser.cppThen you can run the compiled program by running:
./TextFileParserIf the program works as requested in the task, you are ready to make a pull request!
To work with this issue, you need to have C++ installed to your local machine.
Check out README.md for more instructions of installing C++ and how to make a pull request.
Feel free to ask any questions here if you have some problems!
