A Haskell program to check the vezin (meter) of Ottoman Divan poetry.
If you want to learn more about the meter of these poems, this is a place to start. This repository currently does not have much documentation about why things are the way they are, since it's mostly related to the grammatical rules of Turkish and the prosody rules of Divan poetry.
Currently, all Divan.hs does is to check the vezin patterns of a verse.
Tests should explain what Divan.hs currently is able to do. View tests/tests.hs
to read the tests or run cabal test
on your terminal to see the test results.
Divan.Tefile.detectTefile
function currently doesn't cover all vezin patterns, it needs Divan.Tefile.tefileMap
to be expanded. But still, Divan.Tefile now is able to take a verse and return the tefile names, such as "mefâilün mefâilün feûlün". (Tef'ile's are the vezin pattern names.)
In the long run, it should aim to generate simple Divan poems by using the mazmun (imagery) patterns for a given vezin. But there is no work on that yet.
In order to use or compile the program you need to have Haskell installed.
You also need to install Guguk, an unstable library NLP library for Turkish, which is why it is not on Hackage yet. You can install Guguk with these commands:
git clone https://github.com/joom/Guguk.git && cd Guguk && cabal install
cabal install
cabal repl
cabal test
cabal build divan
This is the terminal command to run Divan.hs on a part of one of Fuzûlî's ghazal's.
# assuming default build location
./dist/build/Divan/divan example/input.txt
And this is the output we got from the program, for that ghazal excerpt:
Öyle ser-mestem ki idrâk etmezem dünyâ nedir
öy - le - ser - mes - tem - ki - id - râ - ket - me - zem - dün - yâ - ne - dir
-.---.---.---.-
fâilâtün / fâilâtün / fâilâtün / fâilün
Ben kimem sâkî olan kimdir mey û sahbâ nedir
ben - ki - mem - sâ - kî - o - lan - kim - dir - me - yû - sah - bâ - ne - dir
-.---.---.---.-
fâilâtün / fâilâtün / fâilâtün / fâilün
Âh u feryâdın Fuzûlî incidibdir' âlemi
â - hu - fer - yâ - dın - fu - zû - lî - in - ci - dib - dir - â - le - mi
-.---.---.---.-
fâilâtün / fâilâtün / fâilâtün / fâilün
Ger belâ-yı ışk' ile hoşnûd' isen gavga nedir
ger - be - lâ - yı - ışk - i - le - hoş - nûd - i - sen - gav - ga - ne - dir
-.-.-..--..--..-
fâilün / müfâ'aletün / müfteilün / müfteilün
The first line is the verse itself. The second line is how the program syllablizes the verse. The third line is the symbol string for the vezin (list of Open and Closed). The fourth line is a tef'ile list suggestion.
The last verse of this excerpt is incorrect, because the program cannot yet detect the aruz flaws (kusur) that are made on purpose. However, it must be pretty much functional so far!
Haddock generated documentation can be read from here.