Skip to content

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.

Notifications You must be signed in to change notification settings

RitheeshBaradwaj/WordProcessor

Repository files navigation

WordProcessor Application

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.

Status

Build WorkProcessor Project

Design

The detailed design of the WordProcessor application can be found on the Design Page.

CHANGELOG

The initial implementation of the application can be found in challenge/ folder. Changes made in the current version can be found on CHANGELOG Page

Artifacts

All the test results including binaries, unit test results, code coverage reports can be available in artifacts/ folder

Table of Contents

Install Build Dependencies

The following are the steps to install dependencies for Wordprocessor applications:

  1. Update the package index on your Ubuntu system:
sudo apt-get update
  1. 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
  1. Once the installation is complete, navigate to the /usr/src/googletest directory:
cd /usr/src/googletest
  1. Build the Google Test and Google Mock libraries:
sudo cmake CMakeLists.txt
sudo make
  1. Copy the compiled library files to the system library directory:
sudo cp lib/*.a /usr/lib

Installation Guide

The following instructions explain how to install the WordProcessor application:

  1. Install the dependencies mentioned above.
  2. Clone the repository by running git clone https://github.com/example/WordProcessor.git.
  3. Change to the project directory by running cd WordProcessor.
  4. Build the application by running build.sh.
./build.sh -c

Suitable Compiler

The WordProcessor application requires a suitable C++ compiler to be installed. The recommended compiler is g++.

LCov for Coverage

The WordProcessor application uses LCov for coverage. To view the coverage report, run the following command:

make coverage

Google Test for Testing

The WordProcessor application uses Google Test for testing. To run the tests, run the following command:

make test

Run Steps

To run the WordProcessor application, follow these steps:

  1. Change to the project directory by running cd WordProcessor.
  2. Build the application using build.sh or build.ps1 or manually. The binaries will be available in _bin folder.
  3. 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.
  4. Type in words, one per line, and press enter after each word.
  5. Once finished entering words, type 'end' on a new line to stop entering words.
  6. The application will then print the words in the list, sorted alphabetically and with the number of times each word was encountered.
  7. 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.
  8. To exit the application, press Ctrl + D.

Thank you!

About

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.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published