The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Lingua::TR::Hyphenate - A hyphenator for Turkish.

SYNOPSIS

  use Lingua::TR::Hyphenate;

  my @syllables = Lingua::TR::Hyphenate::hyphenate('bilgisayar');
  # OR,
  #@syllables = Lingua::TR::Hyphenate::hyphenate('bilgisayar',
  #    {Separator=>'.'});
  if(@syllables){

    print "The hyphenated word is: ", join('-',@syllables), "\n";

  }else{

    print "This word cannot be hyphenated.\n";

  }

  my $hyphenated = Lingua::TR::Hyphenate::hyphenate('bilgisayar', 
      {Separator=>'\-'});
  if(defined($hyphenated)){
  
    print "The hyphenated word is: $hyphenated\n";

  }else{

    print "This word cannot be hyphenated.\n";

  }

DESCRIPTION

This module implements a deterministic hyphenator for Turkish.

The only subroutine, hyphenate, takes a word as its input. Optionally, the separator can be given as an attribute to hyphenate subroutine. The default separator is a dot ('.'). For example, if the result is to be given to LaTeX, then '\-' can be used as the separator. The separator is not used if the subroutine is called in list context.

RETURN VALUE

The hyphenate() method returns the hyphenated word, the segments (hyphens, or syllables) separated by dots ('.') (or any string given as separator) in scalar context, and returns the array of syllables in list context. If hyphenation is not possible for the given word, then it returns undef.

WARNINGS

Currently only ISO8859-9 input is accepted.

BUGS

No sanity check is made in the argument of hyphenator subroutine.

Some loanwords that contain 'r' are hyphenated incorrectly, such as "antrparantez" (While it must be hyphenated as "antr-pa-ran-tez," the module hyphenates it as "ant-rpa-ran-tez").

AUTHOR

Lingua::TR::Hyphenate was developed by Engin Gunduz <e.gunduz@computer.org>.

SEE ALSO

perl.