|
Lingua::TR::Hyphenate - A hyphenator for Turkish. |
Lingua::TR::Hyphenate - A hyphenator for Turkish.
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";
}
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.
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.
Currently only ISO8859-9 input is accepted.
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'').
Lingua::TR::Hyphenate was developed by Engin Gunduz <e.gunduz@computer.org>.
|
Lingua::TR::Hyphenate - A hyphenator for Turkish. |