arXiv:2611.12691cs.CLNov 2026

Manuscript Offprint

arXiv:2611.12691

A Lattice-Based HMM Approach to Aruz Scansion of Ottoman Poetry

Mehmet Emre Tiryaki

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Ottoman Divan poetry is composed in aruz, a quantitative meter based on the weights of syllables. The meter is sensitive to specific characters recorded in the original writing in the Arabic script. This work is concerned with automatic meter finding and scansion alignment for Ottoman Divan poetry, especially on modern Turkish spelling without the special diacritics that scholarly transliterations of Ottoman preserve. We define two tasks on this input, first identifying the meter used in the poem, and second aligning the meter's weights with the syllabification of the poem, identifying the flaws and freedoms the poet has taken along the way. We build a corpus of 52,000 lines split by poet, with scansion annotations for 500 test lines, and a robustness benchmark generated at the deviation rates measured on real web and OCR copies. Our model is a hidden Markov model over the positions of each meter, decoded over a lattice of every candidate path, and trained by EM from the printed meter, without scansion labels. On a held-out set it scans 77.6% of the test lines fully correctly, against 26.8% for the available rule-based scanner, 55.0% for a neural tagger trained with the same supervision and 63.6% for Claude Opus 5.5 few-shot. The code is open-sourced and the tool is released on the web.

1 Introduction

Scansion, the task of assigning a rhythmic structure to a written line of poetry, is a sequence labeling problem that NLP has approached with rules, HMMs, CRFs, neural taggers and LLMs (Agirrezabal et al., 2016, 2017; Ruiz Fabo et al., 2026). One type of verse that has received relatively little attention in this context is Ottoman Divan poetry, the classical Turkish poetry of the educated elite, written from the late thirteenth century to the second half of the nineteenth century. Divan poetry is composed in a quantitative meter called aruz, taken

over from Arabic and Persian poetry (Çetin, 1991; İpekten, 2010). In aruz every syllable is either open or closed, closed if its vowel is long or it ends in a consonant, open otherwise. Each meter fixes a sequence of short and long positions, and a line fills it with open and closed syllables. In this paper, we address the scansion of Divan poetry: identifying a poem's meter and aligning each syllable of each line to its position in that meter.

An automated tool that can robustly determine a Divan poem's meter and align each syllable has many uses for Turkish literature researchers and poetry readers. The meter directly influences prosody, since a reader who is not aware of the correct meter cannot recite the line correctly. Finding it by hand is slow and error-prone even for trained readers, who can disagree on the same poem (Kurt and Kara, 2012), and it is a standing difficulty for students of Turkish literature. Editors depend on the scansion, since a line that will not scan is the sign of a misreading or a misprint (Köksal, 2009). And more than a thousand divan collections remain in Turkish libraries, many of them unstudied (Kurt and Kara, 2012). Tracing the meters, flaws and choices of poets across eras would benefit greatly from an automated scanner.

The problem is not trivial, for two main reasons. The first is the script. The poems were written in the Arabic alphabet, which records the long vowels and consonants the meter counts. Since the alphabet reform of 1928 (Lewis, 1999), Turkish has been written in Latin letters, and the original texts, in a script few now read and hard to OCR, remain largely without machine-readable text (Kirmizialtin and Wrisley, 2022). Scholarly editions mark modern Latin with diacritics to signify differences in the original writing, but most readers use this poetry in plain modern Turkish spelling, in school, on websites or typed from a manuscript, without special diacritics (§2). A scanner must therefore work from modern spelling, where the weights have to be restored, and should not depend on the scholarly marks even when they are present, since editions do not always supply them and can be incorrect or inconsistent. Here is a couplet by the fifteenth-century poet Mihrî Hatun in the Arabic script in which it was written, in the scholarly transcription of its edition, and in the modern spelling¹

original إى كدوشدك مبرى هربى فئاتك بابه سن دحى فى عار إمشسن يويله بيلزدم سى

scholarly Ey ki dişdiün Mihrî her bir bi-vefânuñ pâyna Sen dahi bi-‘ar imîssin bôyle bilmezdiûm seni

modern Ey ki dişdiün Mihrî her bir bi-vefanun payna Sen dahi bi-ar imîssin bôyle bilmezdiûm seni

("You who fell, Mihrî, at the feet of every ingrate / so you too are shameless. I did not know you so.")

Take bi-vefanun payî, ‘at the feet of every ingrate’, from the first line. The meter requires its six syllables to be long, short, long, long, long, short:

meter-∪---∪
scholarlybivefānuñpāyi
modernbivefanunpayi

bi, fā and pā are closed because their vowels are long, and the scholarly edition marks the long vowel. The modern spelling does not, so bi, fa and pa look exactly like the open ve and yi.

The second reason is that, even when the original letters are known, a line does not always match its meter syllable for syllable. Aruz tolerates a set of departures from the expected weights, called flaws (kusur) (Düzenli and Bulak, 2018). For example an open syllable may fill a long position, a closed one a short position, and a word may or may not be linked to the next (§2). In the couplet above, the open second syllable of dahi fills a long position and is read with a long vowel. These are not marked in the text, and which flaws a line takes is determined by the meter of the poem, not by the line itself, so a single line admits many readings.

These decisions cannot be made syllable by syllable. Whether a syllable takes a flaw depends on the syllables before and after it, and on the meter, which is not given. Since a single line often fits more than one meter, the meter, and with it the reading of every line, can only be settled for the poem as a whole.

Computational work on aruz has concentrated on Arabic (§8). Rule-based systems (Abuata and Al-Omari, 2018) and recurrent networks (Yousef et al., 2019; Al-shaibani et al., 2020) identify the meter of a verse and they work on Arabic script. For Ottoman poetry the only system we know of

is that of Kurt and Kara (2012), which is a deterministic rule-based algorithm running on scholarly edition strings. It is bound by the scholarly transliteration. It reads the syllable weights directly off the edition’s letters, so it cannot be used on the modern spelling, and even on scholarly text a long-vowel mark the edition left out is recognized as a flaw instead of being corrected. This over-dependence on the scholarly edition input makes the system prone to mistakes. Large language models, used zero- or few-shot, are the obvious alternative. As we show in §7, the strongest models we tried, prompted with the rules, the meters and worked examples, read at best 63.6% of held-out lines correctly.

We first define two tasks on a poem given in plain modern Turkish spelling with no meter marked, a form to which a scholarly transcription reduces by removing its diacritics, identifying the poem’s meter, and scanning each of its lines with every syllable’s position in the meter and any flaw it takes. For these tasks we build a corpus of 52,000 lines from thirteen critical editions, split by poet, and scansion annotations for 500 test lines (§3, §4).

Our model follows from the difficulties above. A trained spelling model proposes scholarly forms for each word, and every reading of the line these forms allow is laid out in a lattice. A hidden Markov model over the positions of the meters scores the paths through that lattice. The only supervision is the printed meter of each training poem, from which the model is trained by EM (§5). We compare it with the scanner of Kurt and Kara (2012) run on the same spelling model, a neural tagger trained with the same supervision, and with two large language models, and we examine which parts of the model account for the difference (§6, §7). Since the text people actually scan is rarely clean edition text, we also build a perturbation benchmark at the deviation rates measured on web and OCR copies and test every system but the language models on it (§4, §7). The code and data pipeline are released at https://github.com/MehmetETiryaki/aruz-paper, and the model is freely available as a web tool at https://mehmetemretiryaki.com/aruz.