Finding Arabic Poem Meter Using Context
Finding Arabic Poem Meter Using Context
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
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 ()ا.
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 يكتبو يكتبوا
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 ناوس ٍ ْنَاْوُو
س
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
Meter name
Rhyme for this meter.
The parse tree in Fig. 1, shows us, how sound string finds
the meter.
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.
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.