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.



    Popular Posts