The WordProcessor application is a C++ program that reads a list of ASCII words from STDIN, removes duplicates, sorts the words alphabetically and prints them with the number of how many times each word was encountered. It also allows users to enter a word to look it up in the word list which was initially entered.
This ReadME file contains information on how to install and run the application, as well as the application's design page.
The detailed design of the WordProcessor application can be found on the Design Page.
The initial implementation of the application can be found in challenge/
folder.
Changes made in the current version can be found on CHANGELOG Page
All the test results including binaries, unit test results, code coverage reports can be available in artifacts/
folder
The following are the steps to install dependencies for Wordprocessor applications:
- Update the package index on your Ubuntu system:
sudo apt-get update
- Install the cmake, g++ compiler, lcov coverage tool, Google Test and Google Mock libraries and headers using apt-get:
sudo apt-get install -y googletest
- Once the installation is complete, navigate to the /usr/src/googletest directory:
cd /usr/src/googletest
- Build the Google Test and Google Mock libraries:
sudo cmake CMakeLists.txt
sudo make
- Copy the compiled library files to the system library directory:
sudo cp lib/*.a /usr/lib
The following instructions explain how to install the WordProcessor application:
- Install the dependencies mentioned above.
- Clone the repository by running git clone https://github.com/example/WordProcessor.git.
- Change to the project directory by running cd WordProcessor.
- Build the application by running
build.sh
.
./build.sh -c
The WordProcessor application requires a suitable C++ compiler to be installed. The recommended compiler is g++.
The WordProcessor application uses LCov for coverage. To view the coverage report, run the following command:
make coverage
The WordProcessor application uses Google Test for testing. To run the tests, run the following command:
make test
To run the WordProcessor application, follow these steps:
- Change to the project directory by running
cd WordProcessor
. - Build the application using
build.sh
orbuild.ps1
or manually. The binaries will be available in _bin folder. - Run the application by running
./_bin/bin/WordProcessor
. This will start the program and prompt the user to enter words to add to the word list. - Type in words, one per line, and press enter after each word.
- Once finished entering words, type 'end' on a new line to stop entering words.
- The application will then print the words in the list, sorted alphabetically and with the number of times each word was encountered.
- To look up a word in the list, enter the word on a new line and press enter. The application will print whether the word is in the list and how many times it was encountered.
- To exit the application, press Ctrl + D.