Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
47 views8 pages

Finding Arabic Poem Meter Using Context

arabic poem

Uploaded by

bz1kwlytb
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views8 pages

Finding Arabic Poem Meter Using Context

arabic poem

Uploaded by

bz1kwlytb
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

J. of Commun. & Comput. Eng.

Copyright © Modern Science Publishers


ISSN 2090-6234 www.m-sciences.com
Volume 3, Issue 1, 2013, Pages 52:59

Finding Arabic Poem Meter using Context Free Grammar

Mohammad A. Alnagdawi · Hasan Rashideh · Ala' Fahed Aburumman

Received: 24 January 2013/ Accepted: 10 March 2013

Abstract In this paper, we make a program that can find 2 Related work
the poem meter name (called Bahar in Arabic) by Arud
M. A. Ismail and others use the “Expert System for Testing
science, this science provides a methodology to classify the Harmony of Arabic Poetry”. The design of ESHT
Arabic poems into 16 meters, to help a user to find the (Expert System harmony Test) is to check the name of the
meter name for any Arabic poem using context free meter in three steps: First step: the user enters the poetry and
grammar (CFG). And we discuss the solutions for heuristic rule in knowledge base converting text to Arud
problems, from the starting phase to the result, using form, that means to keep any letter is spoken and discard any
letter is not spoken, and the heuristic knowledge base is
regular expression and CFG. And the result 75% of the
written by RBS (Rule-Based Systems) Second step: is
verse is found its meter, when input enters correctly. converting from Arud form to binary form (0’s and 1’s)
using deterministic knowledge, deterministic means same
Keywords Arud · Context Free Gramar · CFG · Regular inputs give same outputs and by passing the same rules. Last
expression · Arabic poem meter. step: this is the core of this system, consultation which is
1 Introduction taken by human expert knowledge stored in a knowledge
base. But the author doesn’t mention the experiment
The Arud science, collected and explained by Arabic result.[2]
scientist called Al-Farahidi, is concerned of finding the
Arabic meter name by studying rhyming verses (verse called Shalabi, Ryadh and others use the “Computing System
Bayt in Arabic), through a sequence of the vowel sound for Analyzing Arabic Poems Meter” to find the Arabic
(called Haraka in Arabic) and the constant sound (called poem meter name through two steps: First step, by using
Sukoon in Arabic) in a specific verse, then finding the meter Arud rules which analyze the verse and define long and
name that the verses belonging to. Finding the poem meter short sounds. Second step: using the generated string of
in a traditional way is hard work for a non-expert, this short and long sounds, comparing between rhythms of each
problem encourages us to build this program. To consider meter one by one with the rhythms of verses that are needed
any verse as rhymed, it should belong to the one of the to check. Finally, if algorithm succeeds to find the correct
sixteen Arabic meters of the poetry rhythms. If not, this rhyme for this verse, then it will find the correct Arabic
poem is expressed as deviate. meter name. This algorithm implemented using Turbo C
under MS-DOS, and this tool can’t be used in present
In this paper, a new computerized method is proposed to operating systems.
find the poetry meters using CFG, we generate program
code using tool called ANTLR (Another Tool This paper only contains algorithm, without
for Language Recognition [1]). implementation section or experiment results.[3]

3 Methodology
Mohammad A. Alnagdawi · Hasan Rashideh · Ala' Fahed
Aburumman This tool (also called program) implementation using 3
phases: first phase, converting from poetry form to Arud
Computer Science Department, Faculty of Graduate Studies, AL-Balqa' form. Second phase, is segmentation phase. Third phase, is
Applied University, Jordan. detecting the poem meter name of poem. Each phase
prepares the input to the next phase and so on, until reaches
E‐mail: [email protected], [email protected], to the final result (meter name). And now we will discuss the
[email protected] 3 phases in detail:
Finding Arabic Poem Meter using Context Free Grammar 53
3.1 Converting from poetry form to Arud form read, below are the rules to do this work, and we write these
rule using Regular Expression[4] to make proper action:
To convert any text to Arud form, we just need to write any
letter is read and discard any letter is not

Table 1. Arabic letter


Diacritic Letter in Paper IPA Definition
‫ــُــ‬ dhammah u High back rounded vowel
‫ــَــ‬ fathah a Low short vowel
ِ‫ـــ‬ kasrah i High front vowel
‫ـّــ‬ shaddah : Geminate: consonant is double in duration
‫ــْـ‬ sukoon Ø The letter not diacritized nor geminated
‫ــًـ‬ tanween_fathah an Low vowel + alveolar nasal
‫ــٌـ‬ tanween_dhammah un High back rounded vowel + alveolar nasal
‫ــٍـ‬ tanween_kasrah in High front vowel + alveolar nasal
‫آ‬ alif maddah /ʔaː/
‫ء‬ hamza
‫ا‬ alif /aː/
‫ى‬ alif_maqsurah /a:/
‫ب‬ ba /b/
‫ت‬ taʹ /t/
‫ث‬ tha /θ/
‫ج‬ jeim [ʒ]
‫ح‬ ha /ħ/
‫خ‬ kha /x/
‫د‬ dal /d/
‫ذ‬ dhal /ð/
‫ر‬ ra /r/
‫ز‬ zayn /z/
‫س‬ sein /s/
‫ش‬ shin /ʃ/
‫ص‬ sad /sˤ/
‫ض‬ sad /dˤ/
‫ط‬ sa /tˤ/
‫ظ‬ sa [ðˤ]
‫ع‬ ayn /ʕ/
‫غ‬ ghayn /ɣ/
‫ف‬ fa /f/
‫ق‬ qaf /q/
‫ك‬ kaf /k/
‫ل‬ lam /l/
‫م‬ mim /m/
‫ن‬ noon /n/
‫ھـ‬ ha /h/
‫و‬ waw /w/
‫ي‬ ya /e/
54 Mohammad A. Alnagdawi · Hasan Rashideh · Ala' Fahed Aburumman

Tanween (‫)تن وين‬: is doubling the short vowel, and can convert Rule:
Tanween fathah, Tanween dhammah or Tanween kasrah by
replacing it with the appropriate vowel ( ُ◌ – dhammah, َ◌ – Reg <- Alif Madah
fathah or ِ◌ –kasrah ) then add the Noon letter with constant Hamzat wasl (‫)ھم زة الوص ل( )ا‬: a letter at the beginning of the
ْ to the end of the word.
(called sukoon in Arabic) ( ‫)ن‬ word to make it easy to read, it may come with Sukoon, only
Rule: remove Hamzat Alwasel (‫)ا‬.

Reg <-( tanween_fathah | Rule:


tanween_dhammah | tanween_kasrah) Reg <- Alif_wasel (sukoon)?

Shaddah (‫)ش دة‬: to indicate the letter is doubled. Any letter with Allam Alqmareih (‫)الالم القمرية‬: it is an article. If it comes before
shaddah ( ◌ّ ) the letter should be duplicated: first letter with a one of these letters Hamza, Ba, Jeim, Ha, Kha, Ayn, Ghayn,
constant (sukoon) and second letter with a vowel (haraka). For Fa, Qaf, Kaf, Mim, Ha, Waw Or Ya ( ‫ء ب ج ح خ ع غ ف ق ك م ھـ و‬
example see Table 2 below. ‫ )ي‬and inside the text, so remove the Alif letter, but if there
isn’t any text before do not remove the Alif and Lam letter -it
Table 2. Shaddah example doesn’t affect the word. Example: see Table 5
Word in After Original
Pronounce Table 5. an Example of Allam Alqmareih
English modified word
Word in After Original
Cactus Sabaar ‫صـبْــبَـار‬ ‫صـبّـار‬ Pronounce
English modified word
Inside And the
wal‐jamal ‫ولجمل‬ ‫والجمل‬
the text camel
Rule:
Before
the text
Reg <- shaddah(fathah |dhammah The camel Al‐jamal ‫الجمل‬ ‫الجمل‬
(no
|kasrah)
action)
Waw Aljama’ (‫)واو الجم ع‬: is a letter used to make a single verb
plural. If there is a Waw (‫ )و‬with constant Alif (with sukoon)
ْ at the end of word, is called Waw Aljama' (‫)وا‬, only we need
(‫)ا‬ Rule:
to remove the constant Alif (‫)ا‬, ْ because it is not read. See Reg <-(space) Alif(fathah|dhammah
example in Table 3 below. |kasrah|sukoon)?
Lam (fathah|dhammah|kasrah
Table 3. Waw Aljama’ example |sukoon)?
Word in After Original (Hamza|Ba|Jeim|Ha|Kha|Ayn|
Pronounce Ghayn|Fa|Qaf|Kaf|Mim|Ha|Waw
English modified word
|Ya)
They write Yaktubu ‫يكتبو‬ ‫يكتبوا‬

Allam Alshamseah (‫)الالم الشمسية‬: it is an article. If it comes


Rule: before one of these letters Ta, Tha, Dal, Dhal, Ra, Zayn, Sein,
Shin, Sad, Dad, Ta, Za, Lam Or Noon ( ‫ت ث د ذ ر ز س ش ص ض ط‬
Reg <- waw(fathah|dhammah ‫ )ظ ل ن‬always remove Lam (‫)ل‬, but remove Alif depends on its
|kasrah)Alif sukoon position, if inside the text remove it, if there is no text before it,
don’t remove it. Example: see Table 6.

Alif Maddah (‫) آ‬: converting Alif Maddah to the Alif with Rule:
ْ For example see Table 4
haraka (‫ )أ‬with Alif with sukoon (‫)ا‬. Reg <- (space) Alif(fathah|dhammah
below. |kasrah|sukoon)?
Lam (fathah|dhammah
Table 4. Alif Maddah example |kasrah|sukoon)?
Pronounce After modified Original letter (Ta’|Tha|Dal|Dhal|Ra|Zayn
|Sein|Shin|Sad|Dad|Ta|Za
alif maddah ‫اَ◌ُ ْا‬ ‫آ‬
|Lam|Noon)
...
Table 6. an Example of Allam Alshamseah
Word in English Pronounce After modified Original word
Inside the text And the religion Wad‐den ‫ودّين‬ ‫والديّن‬
Before the text (no
The religion Ad‐den ‫ا ّدين‬ ‫ال ّدين‬
action)
Finding Arabic Poem Meter using Context Free Grammar 55
Prepositional: Remove Alif maqsurah (‫ )ى‬or Ya (‫ )ي‬from One rule as example:
preposition Ila, Fi or Ala ( ‫الى‬/ ‫عـلى‬/‫)في‬, also if sukoon comes
after Alif maqsurah and Ya then the letter should be Haza (‫)ھذا‬:
removed.[6] Example: see Table 7.
Reg <- Ha (fathah|dhammah|kasrah
Table 7. Prepositional examples
|sukoon)?
Word in After Original Dhal (fathah|dhammah|kasrah
Pronounce
English modified word |sukoon)?
In Fi ِ‫ف‬ ‫في‬ Alif (fathah|dhammah|kasrah
to Ila َ ‫إل‬ ‫إلى‬ |sukoon)?
On Ala َ ‫عل‬ ‫على‬

Rule: And with other words, same rules apply, with changed
Fi (‫)في‬: letters.
Reg <- fa'h (fathah|dhammah
|kasrah|sukoon)?
Ya (fathah|dhammah|kasrah
3.2 Segmentation Phase
|sukoon)? After completing previous step we can start applying the
next step. It is called segmentation phase. The Main idea of
Ala and Ila (‫) إلى على‬: segmentation phase is to divide input text (Arud form) to:
short sound (s), vowel (Harakh) or long sound (l), vowel
(Haraka) flowed by constant (sukoon). In other words, if it
<-(Ayn|Alif) (fathah|dhammah
Reg
|kasrah|sukoon)? is one letter so it is called short sound and if it is two letters,
Lam so it is called long sound[7].
(fathah|dhammah|kasrah|sukoon)?
Alif_maqsurah(fathah|dhammah After finishing this phase, we get sound string, and send
|kasrah|sukoon)? the sound string to the next phase to find meter name, and
this is the last phase.
Special cases: Add the letter to these words as mentioned in
the Table 8: [5]
Example 1:
Table 8. Add alif to some words
Poetry Arud
‫َسـتُبْـ ِديْ لَكَ ْاالَ يﱠـاْ ُم َماْ ُك ْنتَ َجاْ ِھال‬
Word in English Pronunciation
text Text َ ‫َو يَأْتِ ْي‬
‫ك بِ ْاالَ ْخبَاْ ِر َم ْن لَ ْم تُ َز ﱢو ِد‬
This (masculine) Hatha ‫ھذا‬ ‫ھَاْ َذ ْا‬
This (feminine) Hatheh ‫ھذه‬ ‫ھَاْ ِذ ِھ ْى‬
This (use with
Show the segmentation example in Table9
Hathan ‫ھذان‬ ‫ھَاْ َذ ْا ٍن‬
double masculine)
This (use with
Hatain ‫ھتين‬ ‫ھَاْتَي ٍْن‬
double feminine)
These haʹulaʹ ‫ھؤالء‬ ْ َ ‫ھَاْؤ‬
‫ُال ِء‬
That Thalek ‫ذلك‬ َ‫َذ ْالِك‬
Allah Allah ‫ﷲ‬ ْ َ ‫ْال‬
ُ‫اله‬
But laken ‫لكن‬ َْ
َ‫ال ِكن‬
David dawuud ‫داود‬ ‫د َْاوُوْ َد‬
Peacock tawuus ‫طاوس‬ ٍ ْ‫طَاْوُو‬
‫س‬
Sarcophagus nawuus ‫ناوس‬ ٍ ْ‫نَاْوُو‬
‫س‬

Table 9. How segmentation work


Arud ُ
‫ت َزوْ ِو ِد‬ ‫ِر َم ْن لَ ْم‬ ْ‫اخ بَا‬
ْ ْ‫كَ بِل‬ ‫َو يَأْ تِ ْي‬ ‫تَ َجا ِھـ لَ ْن‬ ‫ُم َماْ كـ ُ ْن‬ ‫َل كَلْ أَيْ يَا‬ ْ‫س تُبْ ِدي‬
َ
Encode lsls ll s llls lls lsls ll s lll s ll s
56 Mohammad A. Alnagdawi · Hasan Rashideh · Ala' Fahed Aburumman

3.3 Detecting the poem meter name


To find the poem meter name for this verse, compare its sound Rule:
string (come from previous phase) with all grammars. When This is rule for Al-Taweel meter. It is built and suitable from
any of these grammars is valid, that means this verse, belongs right to left Arabic direction text, and Twl_d2 or Twl_d1:
to this meter. Now, we will see one meter (called Taweel means one of rhythm that exists in Table 10.
meter) as example for showing how this phase work.
R -> Taweel | Baset | Maded
Taweel Meter (‫)الطوي ل‬: This meter contains only 2 types of | Wafer | Kamal | Hazaj
rhythms repeated 4 times for each, they are called: Faulun and | Mutadark | Mutakareb | Rajz
Mphaeiln (‫ مف اعيلن‬- ‫)فعولن‬, and this meters drives into 3 rhythms | Raml | Mujtath | Kafef
which are: Faulo, Mphaeil and Mphaeiln ( - ‫ مفاع ـي ُل‬- ‫فع ول‬ | Mudare | Muktadeb | Munsareh | Saree
‫)مفاعـلـن‬,
ِ see Table10 .[1] Taweel -> Twl_d2 Twl_d1 Twl_d2 Twl_d1 Twl_d2
Twl_d1 Twl_d2 Twl_d1
This is the fully pattern: Twl_d2 -> l l l s | s l l s | l s l s

‫فَعُوْ لُ ْن َمفَاْ ِع ْيلٌ ْن فَعُوْ لُ ْن َمفَاْ ِع ْيلٌ ْن‬ Twl_d1 -> l l s | s l s


ٌ ْ ٌ ْ
‫فَعُوْ لُ ْن َمفَا ِع ْيل ْن فَعُوْ ل ْن َمفَا ِع ْيل ْن‬
ُ
Example 2: show the process for finding meter for this Arabic
Fulan Mphaeiln Faulun Mphaeiln
versus (verse) poem:
Fulan Mphaeiln Faulun Mphaeiln
This is original verse poem:

And this is a list of all cases may exist in this meter with the
ْ‫ْضنَا‬ ِ ‫أَبَاْ ُم ْن ِذ ٍر أَ ْفنَيْتَ فَا ْستَب‬
َ ‫ْق بَع‬
code of them (see Table10 ):
‫ْض‬
َ ‫ك بَع‬ ٍ ‫ْال َش ﱢر أَ ْھ َونُ ِم ْن بَع‬
َ ‫ْض َحنَاْنَ ْي‬
Table10 . Taweel meter sound string. In Table 11, first row is the poem verse converted to Arud
Twl_d2 Twl_d1 form, and second row is sound string generated from Arud
Mphaeiln ( ْ‫ ) َمفَاْ ِع ْيلٌن‬: l l l form (first row).
Faulun ( ْ‫)فعولن‬: l l s
s
Mphaeiln (‫ ) مفاعيل‬: s l l s Faulo (‫) فعو ُل‬ :s l s
Mphaeiln (‫ )مفا ِعل‬: s l s l

Table 11. Example 2 segmentation phase


Arud ْ ‫نُ من بع‬
‫ضن‬ ‫ِر أھـ و‬ ْ‫ك بع ض شر‬ ‫ح نا ني‬ ْ‫ض نا‬
َ ْ‫ق بعـ‬
ِ ‫تَ فسْ تب ْـ‬ ْ ‫ِذ‬
ْ‫رن أف نيـ‬ ‫أ باْ ُم ْنـ‬
Sound string l l l s sl s lsl s l ls l s l s l l s l l l s l l s
Finding Arabic Poem Meter using Context Free Grammar 57

Meter name
Rhyme for this meter.

Fig. 1: Pares Tree for example 2

The parse tree in Fig. 1, shows us, how sound string finds
the meter.

4 Conflict Between Meters The sound string: “lsslslllslllsslslllsll”.


In some cases there exist verse belongs to 2 meters in the
same time, and we can solve like this problem by defining The sound string mentioned above for this verse is
sound string (long and sort string) as special case[8]. Now, accepted in 2 meters rule: Kamel and Saree meters, below
discuss this problem using the following example: find parse tree for 2 meters, see (Figure 2 and Fig. 3). Or
you can use another verse form the same poem, to find
correct meter name.

ِ ‫ت بَيْنَ ْالخ َْل‬


‫ق ُم ْشت َِر ٍك‬ ِ ْ‫أَ ْل َمو‬

ْ َ ‫ال سُوْ قِ ِه يَ ْبقَ ْى َو‬


َ َ‫ال َمل‬
‫ك‬ َْ

Figure 2. Kamel Meter Conflict


58 Mohammad A. Alnagdawi · Hasan Rashideh · Ala' Fahed Aburumman

Fig. 3: Saree Meter Conflict

5 Experiment Results
The data set include 128 verses from different Arabic poem,
Verses not found the meter name are 32 (25%), and verses
find correct meter name are 96 (75%).

6 Implementation
Here see some form from real software. The first screenshot
enter new verse to find meter name, see
Fig. 4.

Fig. 5: Arabic Poem Meter Finder screenshot 2

6 Conclusion and Future Work


In this paper, we implemented a tool for finding Arabic Poem
Meter using Context Free Grammar. The tool make use of
Fig. 4: Arabic Poem Meter Finder screenshot 1 CFG to detect verses of Arabic poetry. Our approach uses
trimmed poems (words with Taskeel) to detect the Arabic
The second screenshot see what happened when press poem meter. As an enhancement of our approach, in the near
‘Extract’ (see Fig. 5). future, we are going to work on a plain text (words without
Tashkeel) to make it easier for user to input.
Finding Arabic Poem Meter using Context Free Grammar 59
The analysis of the result shows 75% success ratio for a
dataset with 128 verses of various Arabic poems. We plan to
work on combining more algorithms and test it on a bigger
dataset to reach an optimal solution with a high success ratio
in the near future.

References
1. Mousa, Mahjoub. Al-Mezan (‫)الميزان‬. s.l. : Madbole press,
1997. ISBN 997-208-198-9.
2. Expert System for Testing the harmony of Arabic poetry. M.
A. Ismail and others. 2004.
3. Computing System for Analyzing Arabic Poems Meter.
Shalabi, Ryadh, Kana'an, Gassan and AL-Jarah, Ahmad.
Irbid : Yarmouk Research, 2003.
4. Regular Expressions. MSDN Library. [Online] Microsoft
Corporation.
http://msdn.microsoft.com/en-us/library/2k3te2cs%28VS
.80%29.aspx.
5. Yamout, Phd. Gaze. Buhour Al-Sh'er Alaraby 2nd edition
(‫)بحور الشعر العربي‬. s.l. : Dar Al-Fikr Al-Lebnane, 1992.
6. Arud and Qwafi scince. [Online]
http://www.angelfire.com/biz/kha98/lifeskills/arabic/ar
abic5.htm.
7. Younes, Ali. Poem Awzan and Qwafi ‫مدخل (أوزان الشعر و قوافيه‬
‫)ميسر لتذوقھا و دراستھا‬. Cairo : Dar Ghareeb, 2005. 977-215-855-8.
8. Ibrahem, Mahmoud. Al-Mujtathe and Al-Muktadeb meter
(‫)البحر المجتث و المقتضب‬. Language Jewels (‫)جواھر اللغة‬. [Online]
http://zahra1.com/Edu_Letur/AROOD/AL3ROOD_Mgta
th&Mqtadab.htm.
9. Alfred V. Aho and others,. Compilers : principles,
techniques, and tool 2nd ed. s.l. : Pearson Education, Inc,
2007. ISBN 0-32 1-4868 1.
10. Meter Poetry- Al -Wafer (‫البحور الشعرية‬- ‫)الوافر‬. Arabic Network
Subject (‫)شبكة مادة العربية‬. [Online] [Cited: May 20, 2010.]
http://www.arabe.edunet.tn/aroudh/html/index12.html.
11. Al-Wasel, Saad Abdullah. (‫)موسوعة العروض و القافية‬
Encyclopedia of Arud and Rhyme. 2005.
12. Parr, Terence. ANTLR - Home. ANTLR. [Online] [Cited:
December 6, 2010.] www.antlr.org.
13. Liberty, Jesse and Xie, Donald. Programming C# 3.0. s.l. :
O'Reilly Media, Inc, 2007. ISBN-0596527438.

You might also like