Purpose: Accept a file name(s), or content from stdin, and produce a list of the most common three-word sequence.
This assumes Python 3.x as Python 2.x is well past the end-of-life date.
# Ensure pep8 is available
$ pip -r requirements.txt
# Launch the demo script
$ python3 run_me.py moby-dick.txt
Example Output (top 5 lines):
the sperm whale - 86
of the whale - 78
the white whale - 71
one of the - 64
of the sea - 57
# Ensure pep8 is available
$ pip -r requirements.txt
# Launch the demo script
$ python3 -m unittest test
Example Output:
.....
----------------------------------------------------------------------
Ran 5 tests in 0.919s
OK
- Verify that 100 results are returned using stdin
- Verify the second result is exactly as expected using stdin
- Verify that 100 results are returned using file reading
- Verify the third result is exactly as expected using file reading
- Verify pep8 compliance