项目作者: GokulVSD
项目描述 :
提供计算Gunning /常规FOG索引所需的功能。包含一个音节计数器和一个基于字典的复合字分割器。
高级语言: Python
项目地址: git://github.com/GokulVSD/FOGIndex.git
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']