Friday, December 14, 2012

another interpretation of algorithm in salat

another interpretation :
================

if (prayer == sobh) then

(&) 2 rakaa jahr + soura

end

if (prayer == maghreb) then

(&&) make & and tachahoud and add 1 rakaa sir

end

if (prayer == icha) then

make (&&) and add 1 rakaa sir

end

if (prayer == nafila in dohr time) then

($) 2 rakaa sirr + soura

end

if (prayer == dohr) or (prayer == asr) then
make ($) and tachahoud and add 2 rakaa sirr

end

Wednesday, December 12, 2012

From english natural language text to java code

It seems that the easiest way to convert/transform/translate an english natural language text to java code is as it is said, i.e. we do not need to use uml, xml, xmi or what ever.

We have to create a java program that parses the natural language text (using opennlp for example), extract subject-verb-object sentences and transform text into java code lines, for example :

Franck goes to the mosk every day five time.

Class Person {

 ///bla bla :)
}

void public main() {

Person Franck;
int day;
int time;

for day  in 1..7 {
for time in 1 .. 5 {
Franck.go(mosk);
}
}

}


of course, there are many errors, but it just to gives an idea of how we could create a Natural Langage Translator to Java.

Monday, December 3, 2012

from text to java



    1. choose a encyclopedic text.
    2. modelize using a UML modeling tool (like StarUML, or EA)
    3. Export to XML, or XMI file.
    4. Analyse the XML or XMI file to understand different tags.
    5. parse this file, and save into a .txt file &.
    6. use a natural langage parser (Like opennlp, or stanfordnlp).
    7. parse the english text &.
    8. store information in an XML, or XMI, or XSD file as in the chosen uml tool.
    9. use the & uml tool chosen before.
    10. open the xml, xmi, or xsd file.
    11. obtain the uml diagrams.
    12. generate the java files.

    an interpreted algorithm for rows constructing for salat

    search for soutra

    If (number of muslims == 1)

    pray

    if (number of muslims == 2)

    stand side-by-side;

    and pray


    if (number of muslims > 2)

    choose one of the muslims as an imam.

    the imam stand in front of the other muslims .

    if (number of muslims > N : number of places that a row in a mosk can handle)

    the N+1 muslims moves to row 2

    and so on.

    mathematical expression/equation of salat

    ((7+l)*m)*bool + ((7)*p*(the contrary of bool) = perfect :)

    7 : is for number of verses in fatiha

    l and n : integer representing number of verses from zero to more
    (zero is when rakaa is in sirr).

    m and p : integer from 1 to maximum 2 (1 is for witr)

    bool : is a boolean for sirr or jahr

    +when number of rakaa is more than 2
    and it is optional




    Saturday, December 1, 2012

    pseudo-algorithm of islamic prayer salat

    My interpretation may contain errors, please comment :



    switch (prayer) {

    => case sobh :

    2 rakaa jahr + soura

    => case dohr :

    2 rakaa sir + soura and tachahoud and 2 rakaa sir

    => case asr :

    2 rakaa sir + soura and tachahoud and 2 rakaa sir

    => case maghreb :

    2 rakaa jahr + soura and tachahoud and 1 rakaa sir

    => case icha :

    2 rakaa jahr + soura and tachahoud and 2 rakaa sir

    }


    How to analyse islamic process and history

    In order to automatically analyse and extract processes and patterns from islamic history and bibliography, it is possible to imagine the following method :

    1) developp a java program that parses and analyses natural language to extract "subject-verb-object" phrases and sentences from english natural language text.

    2) store information in XML or XMI file.

    3) create a translator for : XMI ==> Java. for example. (or to UML)
    4) generate the java file and execute it to see the result.



    Sunday, October 14, 2012

    Allah is beautiful, he loves beauty

    Allah est beau, il aime la beauté.




    The works of Dr. kais dukes, Dr. Said ghazzawi, and Dr. abdeldaeem kaheel inspired me to propose my own contribution to the scientific islamic community, here are some humble ideas:
     
    Analyzing, modelling, designing and developing Islamic knowledge  Using Unified Modelling Language, Model Driven Engineering, and Object Oriented Programming


     As far as we are concerned in this paper, we propose to classify Islamic Knowledge into three categories:
    1.       Holy Quran,
    2.       Hadith,
    3.       Saying of renowned Muslims.
    In this paper, we will focus, only on the prophet Muhammad (pbuh) sayings (hadiths), as they provide us with important source of information, regarding our methodology.
    In the following section, we present a new methodology for modeling hadiths, using what is called UML activity diagram.

    A.  Activity Modelling for an activity hadith

    In our methodology, we present several basic rules:
    1.                     We decompose an activity (such as Salat), to many different sub-activities (such as rakâa). For example :
    2.                     We decompose a sub-activity (such as rakâa), to many different actions (such as takbir, reading, rokôo, soujoud, joulouss, etc...). For example :
    3.                     We decompose an action, or activity, or sub-activity into three components :
    a.       Condition (IF)
    b.       Result of the condition (Then),
    c.        Alternative Result (Else).
    First, we consider that a hadith that explains actions and activities of the prophet Muhammad (pbuh). The following hadith is the perfect illustration of the principle:
    أنَّ فَهْدًا حَدَّثَنَا ، قَالَ : حَدَّثَنَا أَبُو غَسَّانَ ، قَالَ : حَدَّثَنَا زُهَيْرٌ ، قَالَ : حَدَّثَنَا أَبُو إِسْحَاقَ ، قَالَ : أَتَيْتُ الأَسْوَدَ بْنَ يَزِيدَ ، وَكَانَ لِي أَخًا وَصَدِيقًا ، فَقُلْتُ يَا أَبَا عَمْرٍو ، حَدِّثْنِي مَا حَدَّثَتْكَ عَائِشَةُ رَضِيَ اللَّهُ عَنْهَا أُمُّ الْمُؤْمِنِينَ ، عَنْ صَلاةِ رَسُولِ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ ، فَقَالَ : قَالَتْ : " كَانَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ يَنَامُ أَوَّلَ اللَّيْلِ وَيُحْيِي آخِرَهُ ، ثُمَّ إِنْ كَانَتْ لَهُ حَاجَةٌ قَضَى حَاجَتَهُ ، ثُمَّ يَنَامُ قَبْلَ أَنْ يَمَسَّ مَاءً ، فَإِذَا كَانَ عِنْدَ النِّدَاءِ الأَوَّلِ ، وَثَبَ وَمَا قَالَتْ قَامَ فَأَفَاضَ عَلَيْهِ الْمَاءَ ، وَمَا قَالَتْ : اغْتَسَلَ وَأَنَا أَعْلَمُ مَا تُرِيدُ وَإِنْ كَانَ جُنُبًا تَوَضَّأَ وُضُوءَ الرَّجُلِ لِلصَّلاةِ "
    From:
    شرح معاني الآثار للطحاوي » بَابُ الْجُنُبِ يُرِيدُ النَّوْمَ أَوِ الأَكْلَ
    First, we have to separate the activity statements from the rest of the Islamic text:
    كَانَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ يَنَامُ أَوَّلَ اللَّيْلِ وَيُحْيِي آخِرَهُ ، ثُمَّ إِنْ كَانَتْ لَهُ حَاجَةٌ قَضَى حَاجَتَهُ ، ثُمَّ يَنَامُ قَبْلَ أَنْ يَمَسَّ مَاءً ، فَإِذَا كَانَ عِنْدَ النِّدَاءِ الأَوَّلِ ، وَثَبَ وَمَا قَالَتْ قَامَ فَأَفَاضَ عَلَيْهِ الْمَاءَ ، وَمَا قَالَتْ : اغْتَسَلَ وَأَنَا أَعْلَمُ مَا تُرِيدُ وَإِنْ كَانَ جُنُبًا تَوَضَّأَ وُضُوءَ الرَّجُلِ لِلصَّلاةِ "
    The highlighted text represents a judgment of the narrator, and could help understand the structure of the activities.
    وَمَا قَالَتْ قَامَ فَأَفَاضَ عَلَيْهِ الْمَاءَ، وَمَا قَالَتْ: اغْتَسَلَ وَأَنَا أَعْلَمُ مَا تُرِيدُ
    In this step, we try to differentiate between activity, sub-activities, and actions. For ease of comprehension, we give the letter (A) for activities, the acronym (Sub) for sub-activities, and the letter (a) for actions.
    يَنَامُ أَوَّلَ اللَّيْلِ
    Action
    وَيُحْيِي آخِرَهُ
    Activity
    ثُمَّ إِنْ كَانَتْ لَهُ حَاجَةٌ
    If condition
    قَضَى حَاجَتَهُ
    Then action
    ثُمَّ يَنَام
    Action
    قَبْلَ أَنْ يَمَسَّ مَاءً
    Condition (and action)
    فَإِذَا كَانَ عِنْدَ النِّدَاءِ الأَوَّلِ
    If condition
    وَثَبَ
    Then action
    وَإِنْ كَانَ جُنُبًا
    If condition
    تَوَضَّأَ وُضُوءَ الرَّجُلِ لِلصَّلاةِ
    Then Activity
    For computer scientist, this structure is very likely an algorithm, which could be encoded in computer understandable language, please refer to discussions at the end of the paper.

    B.  UML Activity Modelling for an activity hadith

    Since the previous hadith focused on actions and activities, we choose to call it “activity hadith”. In consequence it should be modelled by a tool providing such possibilities; we present hereafter an example of hadith’s modelling using UML activity diagram.




    Dear brothers and sisters, welcome in Islam.

    Popular Posts