Skip to content

Python script to calculate the Fog Index of a text document.

Notifications You must be signed in to change notification settings

anushaa51/Fog-Index

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fog Index & Gunning Fog Index Calculator

Python script to calculate the Gunning Fog Index & Fog Index of a text document.



What is it?

Gunning Fog Index

The Gunning fog index is a readability test commonly used to evaluate how easily some text can be read by its intended audience. It is calculated as follows :

Gunning Fog Index =

Complex words : Words with 3 syllables or more, that are not compound words.
Compound words : Words that are a combination of 2 or more smaller words. For example, "multinational" is made up of the words "multi" and "national".

Fog Index

Fog Index =

Note :

This project is inclusive of a syllable counter function, and a compound word splitter function. They can be used independently by changing the interfaces between the functions.

The compound word splitter function was provided by Gokul VSD. It uses the Python module named PyEnchant, which is compatible with Linux and only the 32 bit Python on Windows as of May 2018.
Currently, the project takes its input from a text document and gives its output to another text document. It was made as part of an assignment in Software Engineering, in semester 4 of my engineering course.


Sample Outputs

Successful output :

The Fog Index of the given text document is 9.485714285714286
The Gunning Fog Index of the given document is 9.194805194805195
Total number of sentences = 7
Total number of words = 110
Total number of words with 3 or more syllables = 8

Unsuccessful output :
File does not exist, please try again by placing a valid file named 'TestDocument.txt' in current directory

About

Python script to calculate the Fog Index of a text document.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages