In [1]:
from quranSurah import QuranSurah
In [2]:
qs=QuranSurah(36)
In [3]:
# Information about the Surah
print (qs)
In [4]:
# Statistics about the Surah
print ("===== ده عبارت ۲کلمهای پربسامد =========================")
for res in qs.topFrequentWords(2,10):
print (res)
print ("===== ده ریشه ۲کلمهای پربسامد =========================")
for res in qs.topFrequentRoots(2,10):
print (res)
In [6]:
# Text of the Surah
print (qs.text[0])
In [5]:
# Root in each ayah
# e.g. in ayah 17 (indices start from zero in the array)
ayah=16
print ("===== آیه =========================")
print (qs.text[ayah])
print ("===== ریشهها ========================")
print (qs.roots[ayah])
print ("===== ریشهها بدون کلمات زائد =========================")
print (qs.nonStopWord_roots[ayah])
In [10]:
# Retrieve the central ayat, based on surface form, 1-gram/ top 10,
results=qs.getAvgAyahTFIDF(qs.text,1,10)
for res in results:
print (res)
In [11]:
# Retrieve the central ayat, based on root, bi-gram/ top 10,
results=qs.getAvgAyahTFIDF(qs.roots, 1,10)
for res in results:
print (res)
In [12]:
# Retrieve the central ayat, based on root, 1-gram/ top 10,
results=qs.getAvgAyahTFIDF(qs.nonStopWord_roots, 1,10)
for res in results:
print (res)