Intro. to Programming : Spring 2019

Csci 1020 March 4, 2019 Program Assignment 8

Modify a GUI which determines the grade level of text.

Here is the source code to modify:

p8.py

Here is something to start with:

oz.txt


Modifying your grade-level function

   grade_level = 70*num_unique_words/(num_words+1.0)
   TXstat.insert(END,"\nThis is at grade level ="+str(grade_level))

num_unique_words = the number of different words

num_words = the total number of words, with repetitions

There are various programs which do this for documents. Simple measures can be a helpful guide. The formula used above can be improved. You should pick out some text items, books with 100 or so pages, and see what the values are for num_unique_words and num_words, then use your estimate of the book's grade level to adjust you function. You won't be graded on your grad level program, and I don't know the answer. Other measures would also be helpful, say average number of words per sentence, but work with what is available, those two numbers: num_words and num_unique_words.

This assignment doesn't require much change otherwise, but you are, of course, welcome to make changes as you please.

The Text widget used here has a great many features which are not demonstrated. It can be used to create a web browser or a word processor. There are three separate Text widgets used in this sample.

There are also File Save dialog widgets in addition to the File Open widget used in this program. These look the same as you see in many applications, and no surprise because these are indeed exactly the same in many cases, a piece of operating system/desktop code provided which application writers can use.


Content is neither approved nor reviewed by FDLTCC.