bkiseu / WordCount

Counts words of input and reurns dictionary

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Word Count Program

This program counts the frequency of words and returns a dictionary

For example for the input "olly olly in come free"

Uses the Counter Class to iterate through the list thereby enhancing performance

Getting Started

Some prerequisites are required to have achieved desired output.

This code is written in Python3 and may have unexpected functionality when run with Python 2.x

Install pytest:

$ pip install pytest

Alternatively, Install nose

$ pip install nose

Using the Code

clone the code from git using this limk:

git clone https://github.com/Bryoo/WordCount

Ensure you're in the main directory 'prime_numbers' and then run the code

python3 wordcount.py

## Executing the tests included

if you've got pytest

$ py.test test_word_count.py

If you've got nosetests

$ nosetests test_word_count.py

Alternatively, if you do not have either nosetests or pytest installed, use:

$ python3 test_word_count.py


 The test cases present includes some tests for both edge and general cases:



About

Counts words of input and reurns dictionary


Languages

Language:Python 100.0%