Code Monkey home page Code Monkey logo

bookbot's Introduction

Bookbot

Summary

Bookbot reads a book from a text file, counts the number of words and characters in the book and prints the results in a simple book report to the standard output (console screen).

Repository mirrors

Requirements

Python version 3.0 or higher.

Quick guide

Clone this repository.

git clone https://github.com/dananglin/bookbot.git
cd bookbot

You can print the program's help message with the -h flag.

./bookbot -h

Download a book in text format (e.g. txt, markdown, etc). As an example you can download the free ebook called Frankenstein or The Modern Prometheus from here.

mkdir -p books
curl -L https://raw.githubusercontent.com/asweigart/codebreaker/master/frankenstein.txt -o books/frankenstein.txt

Run Bookbot to produce the book report.

$ ./bookbot books/frankenstein.txt
--- Begin report of books/frankenstein.txt ---
77986 words found in the document

The character 'a' was found 26743 times
The character 'b' was found 5026 times
The character 'c' was found 9243 times
The character 'd' was found 16863 times
The character 'e' was found 46043 times
The character 'f' was found 8731 times
The character 'g' was found 5974 times
The character 'h' was found 19725 times
The character 'i' was found 24613 times
The character 'j' was found 504 times
The character 'k' was found 1755 times
The character 'l' was found 12739 times
The character 'm' was found 10604 times
The character 'n' was found 24367 times
The character 'o' was found 25225 times
The character 'p' was found 6121 times
The character 'q' was found 324 times
The character 'r' was found 20818 times
The character 's' was found 21155 times
The character 't' was found 30365 times
The character 'u' was found 10407 times
The character 'v' was found 3833 times
The character 'w' was found 7638 times
The character 'x' was found 677 times
The character 'y' was found 7914 times
The character 'z' was found 243 times
--- End report ---

bookbot's People

Contributors

dananglin avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.