Project Profile

The goal of this project is to complete the implementation of a program that performs a simple glossary analysis. In particular, the program extracts "words" from a text file and prints to the console a mapping of the words found in the provided text file and their associated frequencies. You can download a bunch of example book text files to help with your implementation. For example, a working implementation will produce the following output (assuming your compiled program is called wordfreak ) given a sequence of text files from the command line:

$ ./wordfreak aladdin.txt holmes.txt newton.txt
THE : 1
ADVENTURES : 1
OF : 1
ALADDIN : 1
Once : 1
upon : 1
a : 47
time : 1
widow : 5
had : 21
an : 6
only : 4
son : 6
...

A working implementation must also accept text files from standard input. For example, this is an alternate way a correct implementation can be executed (for more details on the bash pipe | operator see this tutorial ):

$ cat aladdin.txt holmes.txt newton.txt | ./wordfreak
THE : 1
ADVENTURES : 1
OF : 1
ALADDIN : 1
Once : 1
upon : 1
a : 47
time : 1
widow : 5
had : 21
an : 6
only : 4
son : 6
...

A working implementation must also accept an environment variable called WORD_FREAK set to a single file from the command line to be analyzed:

$ WORD_FREAK=aladdin.txt ./wordfreak
THE : 1
ADVENTURES : 1
OF : 1
ALADDIN : 1
Once : 1
upon : 1
a : 47
time : 1
widow : 5
had : 21
an : 6
only : 4
son : 6
...

Furthermore, your submission is restricted to only using the following system calls: open() , close() , read() , write() , and lseek() for performing I/O. You are allowed to use other C library calls (e.g., malloc() , free() ), however, all I/O is restricted to the Linux kernel's direct API support for I/O.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.