Bahr

class aruudy.poetry.meter.Bahr(info)

Bases: object

Representation of the Arabic meter.

Parameters:info (dict) – Description of parameter info.
name

Bahr’s name, which is composed of:

  • arabic: its name in Arabic
  • english: its name in English
  • trans: its Arabic name’s transliteration.
Type:dict
used_scansion

The most used scansion. The dictionary contains these elements:

  • type: a string describing the type of each foot (tafiila)
  • mnemonic: a string describing the mnemonic of each foot.
  • emeter: a string describing the English meter of each foot.
  • ameter: a string describing the Arabic meter of each foot.
Type:dict
meter

A list of meter’s forms.

Type:list(BahrForm)
std_scansion

the standard scansion. The dictionary contains these elements:

  • type: a string describing the type of each foot (tafiila)
  • mnemonic: a string describing the mnemonic of each foot.
  • emeter: a string describing the English meter of each foot.
  • ameter: a string describing the Arabic meter of each foot.
Type:dict

Methods Summary

get_names() Get the names of the meter.
test_name(key, value) Test if .
to_dict() Transform the bahr to a dictionary.
validate(emeter[, units]) Validate a given emeter into one of the forms.

Methods Documentation

get_names()

Get the names of the meter.

Returns:Bahr’s name, which is composed of:
  • arabic: its name in Arabic
  • english: its name in English
  • trans: its Arabic name’s transliteration.
Return type:dict
test_name(key, value)

Test if .

Parameters:
  • key (str) – can be “arabic”, “english” or “trans”.
  • value (str) – The name we are looking for.
Returns:

True, if this meter have the name specified by “value”

Return type:

bool

to_dict()

Transform the bahr to a dictionary.

Returns:The dictionary has three components “name”, “used_scansion” and “std_scansion” which are dictionaries too. They are described in the attributes section.
Return type:dict
validate(emeter, units=[])

Validate a given emeter into one of the forms.

Search for a form which the given emeter follows.

Parameters:
  • emeter (str) – English meter.
  • units (list(str)) – A list of vocallized and unvocalized elements, generated from the text.
Returns:

the part object.

Return type:

Part