Exemple #1
0
    def transfer_vocalizations(self):
        """ load indexed vocalized words  from the main index and save them as a list in a dynamic py """
        QSE = QuranicSearchEngine(self.__ixpath)

        if QSE.OK:
            mfw = QSE.most_frequent_words(9999999, "aya_")
        else:
            mfw = []

        V = QArabicSymbolsFilter( \
                                       shaping = False, \
                                       tashkil = True, \
                                       spellerrors = False, \
                                       hamza = False \
        ).normalize_all

        vocalization_dict = {}
        for w in mfw:
            word = w[1]
            if vocalization_dict.has_key(V(word)):
                vocalization_dict[V(word)].append(word)
            else:
                vocalization_dict[V(word)] = [word]

        raw_str = self.dheader + u"\nvocalization_dict=" + str(
            vocalization_dict).replace(",", ",\n")

        fich = open(self.__dypypath + "vocalizations_dyn.py", "w+")
        fich.write(raw_str)

        return raw_str
Exemple #2
0
    def transfer_vocalizations( self ):
        """ load indexed vocalized words  from the main index and save them as a list in a dynamic py """
	QSE = QuranicSearchEngine( self.__ixpath )

	if QSE.OK:
		mfw = QSE.most_frequent_words( 9999999, "aya_" )
	else:
		mfw = []

	V = QArabicSymbolsFilter( \
                                shaping = False, \
                                tashkil = True, \
                                spellerrors = False, \
                                hamza = False \
	).normalize_all



        vocalization_dict = {}
        for w in mfw:
            word = w[1]
            if vocalization_dict.has_key( V( word ) ):
                vocalization_dict[V( word )].append( word )
            else:
                vocalization_dict[V( word )] = [word]

        raw_str = self.dheader + u"\nvocalization_dict=" + str( vocalization_dict ).replace( ",", ",\n" )

        fich = open( self.__dypypath + "vocalizations_dyn.py", "w+" )
        fich.write( raw_str )

        return raw_str
Exemple #3
0
 def QSE( path = Paths.QSE_INDEX ):
     return QuranicSearchEngine( path )
Exemple #4
0
This is a test module for most of features provided by alfanous.main module.

"""
import profile

from alfanous.main import QuranicSearchEngine, FuzzyQuranicSearchEngine
from alfanous.main import TraductionSearchEngine
from alfanous.main import WordSearchEngine
from alfanous.main import QPaginate
#from alfanous.ResultsProcessing import QFilter



if __name__ == '__main__':
    
    QSE = QuranicSearchEngine( "../alfanous/indexes/main/" )
    FQSE = FuzzyQuranicSearchEngine( "../alfanous/indexes/main/" )
    TSE = TraductionSearchEngine( "../alfanous/indexes/extend/" )
    QWSE = WordSearchEngine( "../alfanous/indexes/word/" )

    if QWSE.OK:
        print "most frequent vocalized words"
        MFW = QWSE.most_frequent_words( 10, "word" )
        for term in MFW:
            print "\t", term[1], " - frequence = ", term[0], "."
        print "most  frequent unvocalized words"
        MFW = QWSE.most_frequent_words( 10, "normalized" )
        for term in MFW:
            print "\t", term[1], " - frequence = ", term[0], "."

Exemple #5
0
from __future__ import print_function
"""
This is a test module for most of features provided by alfanous.main module.

"""

from alfanous.main import QuranicSearchEngine, FuzzyQuranicSearchEngine
from alfanous.main import TraductionSearchEngine
from alfanous.main import WordSearchEngine
from alfanous.results_processing import QPaginate
from six.moves import input
#from alfanous.ResultsProcessing import QFilter

if __name__ == '__main__':

    QSE = QuranicSearchEngine("../alfanous/indexes/main/")
    FQSE = FuzzyQuranicSearchEngine("../alfanous/indexes/main/")
    TSE = TraductionSearchEngine("../alfanous/indexes/extend/")
    QWSE = WordSearchEngine("../alfanous/indexes/word/")

    if QWSE.OK:
        print("most frequent vocalized words")
        MFW = QWSE.most_frequent_words(10, "word")
        for term in MFW:
            print("\t", term[1], " - frequence = ", term[0], ".")
        print("most  frequent unvocalized words")
        MFW = QWSE.most_frequent_words(10, "normalized")
        for term in MFW:
            print("\t", term[1], " - frequence = ", term[0], ".")

        RESULTS, TERMS = QWSE.search_all("word_id:1",
Exemple #6
0
appuifw.app.menu = [(u"search", search),
                    (u"about...", ((u"about alfanous", about), (u"about me",
                                                                about)))]

appuifw.note(u"Application is now running")
query = unicode(appuifw.query(u"Type a query:", "text"))
limit = appuifw.query(u"Limit:", "number")
sortedby = appuifw.query(u"Sortedby:", "text")
choices = [u"score", u"mushaf", u"tanzil"]

index = appuifw.popup_menu(choices, u"sortedby:")
sortedby = choices[index]

appuifw.note(u"your query: " + str(query), "info")

QSE = QuranicSearchEngine()
res, terms = QSE.search_all(query, limit=limit, sortedby=sortedby)

app_lock = e32.Ao_lock()
app_lock.wait()
"""
#sound example

   1. import audio  
   2.   
   3. sound = audio.Sound.open("E:\\Sounds\\mysound.mp3")  
   4.   
   5. def playMP3():  
   6.      sound.play()  
   7.      print "PlayMP3 returns.."  
   8.   
Exemple #7
0
appuifw.app.menu = [(u"search", search), (u"about...",((u"about alfanous", about), (u"about me", about)))]  

appuifw.note(u"Application is now running")
query = unicode(appuifw.query(u"Type a query:", "text"))
limit = appuifw.query(u"Limit:", "number")
sortedby = appuifw.query(u"Sortedby:", "text")
choices = [u"score", u"mushaf", u"tanzil"]  

index = appuifw.popup_menu(choices, u"sortedby:")   
sortedby=choices[index]
    
appuifw.note(u"your query: " + str(query), "info")    
   
   
QSE = QuranicSearchEngine()    
res, terms = QSE.search_all(query, limit=limit, sortedby=sortedby)



app_lock = e32.Ao_lock()
app_lock.wait()



"""
#sound example

   1. import audio  
   2.   
   3. sound = audio.Sound.open("E:\\Sounds\\mysound.mp3")