Author image Алексей Капранов
and 1 contributors


Text::Hyphen::TR - determine positions for hyphens inside Turkish words


This module is an implementation of Knuth-Liang hyphenation algorithm for Turkish text using patterns from hyph-utf8 TeX package.

    use Text::Hyphen::TR;
    my $hyphenator = new Text::Hyphen::TR;

    print $hyphenator->hyphenate($turkish_word_in_Unicode, '-');
    # prints hyphenated with dashes


See Text::Hyphen for the interface documentation.

This module only provides Turkish patterns.


Donald Knuth and Frank Liang for the algorithm.

Alexander Lebedev for all his valuable work on russian ispell dictionaries and russian hyphenation patterns. See his archive at or his hyphenation page at

Patterns used in this module are generated by generate_patterns_tr.rb script which is available at

The only change is one extra pattern that will not split "-acak" future tense suffix as "a-cak" at the very end of the word. The original pattern list contains the same pattern for the "-ecek" suffix and those two are actually variants of the same suffix so it makes no sense to have patterns for one and not the other.

Algorithm for pattern generation developed by P. A. MacKay for the Ottoman Texts Project in 1987. Rules adapted for modern Turkish by H. Turgut Uyar <uyar at>. Initiative to improve Turkish patterns by S. Ekin Kocabas <kocabas at>. Pattern generation script written by Mojca Miklavec <mojca.miklavec.lists at> in June 2008.


Lingua::TR::Hyphenate is a completely different implementation. It has at least one bug acknowledged by its author which this module does not have. Try hyphenating "antrparantez".,,


This code is hosted on Github, please see

Please report any bugs or feature requests to GitHub issues.


Copyright (C) Alex Kapranoff.

This is free software; you can redistribute it and/or modify it under the terms GNU General Public License version 3.

The patterns that are used inside this module may also be obtained from CTAN under LPPL license. See and specifically


Alex Kapranoff <>