Skip to content

GokulVSD/FOGIndex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

FOG Index

Provides functions required for calculation of Gunning / regular FOG index

Part of an assignment in Software Engineering (SE) during 4th semester BE. These functions were developed as a preliminary solution to meet the deadline. A more accurate and complete version of the Gunning FOG Index calculator may be found here: AnushaB05/Fog-Index

The compound word splitter utilises PyEnchant's dictionary, it tries to split the word into non-compound words containing two or more letters. The simple syllable splitter may not be very accurate, but for the purpose of FOG index calculation, it gets the job done, while being relatively efficient.

Install PyEnchant:

# PyEnchant doesn't work with 64 bit Python on Windows

pip install pyenchant

Uses:

Syllable Counter

from SimpleSyllableCounter import syllables

  syllables('continuity')
  syllables('pierce')
  syllables('pain')
  syllables('unanimous')
  syllables('ancient')
  syllables('euphemism')
  syllables('oesophagus')

Returns:

5
1
1
4
2
3
4

Compound Word Splitter

from CompoundWordSplitter import split

  split('Undertake','en-UK')
  split('daydream','en-US')
  split('Nail-Polish')
  split('manual')

Returns:

['Under', 'take']
['day', 'dream']
['Nail', 'Polish']
['manual']

About

Provides functions required for calculation of Gunning / regular FOG index. Contains a syllable counter and a dictionary based compound word splitter.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages