Lingua::FR::Hyphen - Hyphenate French words


    use strict;
    use warnings;
    use Lingua::FR::Hyphen;
    use utf8;
    binmode( STDOUT, ':utf8' );
    my $hyphenator = new Lingua::FR::Hyphen;
    foreach (qw/  
        représentation  Montpellier avocat porte-monnaie 
        0102030405 rouge-gorge transaction consultant 
        rubicon développement UNESCO 
        /) {
        print "$_ -> " . $hyphenator->hyphenate($_) . "\n";

    # représentation -> repré-sen-ta-tion
    # Montpellier -> Montpellier
    # avocat -> avo-cat
    # porte-monnaie -> porte-monnaie
    # 0102030405 -> 0102030405
    # rouge-gorge -> rouge-gorge
    # transaction -> tran-sac-tion
    # consultant -> consul-tant
    # rubicon -> rubicon
    # développement -> déve-lop-pe-ment


Lingua::FR::Hyphen hyphenates French words using Knuth Liang algorithm.



This constructor allows you to create a new Lingua::FR::Hyphen object.

$hyphenator = Lingua::FR::Hyphen->new([OPTIONS])

min_word => integer

Minimum length of word to be hyphenated. (default : 6).

  min_word => 4,
min_prefix => integer

Minimal prefix to leave without any hyphens. (default : 3).

  min_prefix => 3,
min_suffix => integer

Minimal suffix to leave without any hyphens. (default : 3).

  min_suffix => 3,
cut_proper_nouns => integer 0 or 1

hyphenates or not proper nouns: (default : 0 (recommended)).

  cut_proper_nouns => 0,
cut_compounds => integer 0 or 1

hyphenates compounds: (default : 0 (recommended)).

  cut_compounds => 0,


hyphenates French words using Knuth Liang algorithm and following the rules of the French language.

$hyphenator->hyphenate($word, $delimiter ? )

Two arguments : the word and the delimiter (optionnal) (default : "-").

  $hyphenator->hyphenate($word2, '/');


Djibril Ousmanou, <djibel at>

Laurent Rosenfeld, <laurent.rosenfeld at>


This module is based on the Knuth-Liang Algorithm. Frank Liang wrote his Stanford Ph.D. thesis (under the supervision of Donald Knuth) on a hyphenation algorithm that was aimed at TeX (the typesetting utility written by Knuth) and is now standard in Tex, and has been adapted to many open source projects such as OpenOffice, LibreOffice, Firefox, Thunderbird, etc. His 1983 PhD thesis can be found at He invented both the "packed or compressed trie" structure for storing efficiently the patterns and the way to represent possible hyphens in those patterns.

This module is also partly derived from Alex Kapranoff's Text::Hyphen module to hyphenate English language words.

The list of hyphenation (« césure » or « coupure de mots » in French) patterns for the French language was derived from the Dicollecte site (, which produces several French open source spell check dictionaries, used notably for Latex, OpenOffice and LibreOffice. The list of patterns itself can be found there:

The list of proper nouns used for preventing their hyphenation (it is usually considered bad to hyphenate proper nouns in French) was compiled from several sources, but the main source was the Hunspell dictionary for French words, which can also be found on the Dicollect site (see from which we extracted proper nouns as well as acronyms (which also should no be hyphenated), although this module will not hyphenate all-capital words anyway.


Please report any bugs or feature requests to bug-lingua-fr-hyphen at, or through the web interface at I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.


See Text::Hyphen.


You can find documentation for this module with the perldoc command.

    perldoc Lingua::FR::Hyphen

You can also look for information at:


Copyright 2015 Djibril Ousmanou.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See for more information.