3 |
package EPrints; |
package EPrints; |
4 |
|
|
5 |
use Exporter 'import'; |
use Exporter 'import'; |
6 |
@EXPORT_OK = qw(_x); |
@EXPORT_OK = qw(_x slogovi); |
7 |
|
|
8 |
use Encode qw/from_to decode_utf8 decode/; |
use Encode qw/from_to decode_utf8 decode/; |
9 |
use Data::Dump qw/dump/; |
use Data::Dump qw/dump/; |
58 |
return "$v "; |
return "$v "; |
59 |
} |
} |
60 |
|
|
61 |
|
sub slogovi { |
62 |
|
my $text = shift; |
63 |
|
my @s; |
64 |
|
foreach my $w ( split(/\W*\s+\W*/, $text ) ) { |
65 |
|
my $pos = 0; |
66 |
|
while ( $w =~ s/^([^aeiou]*[aeiou])//i ) { |
67 |
|
push @s, $pos++ . $1; |
68 |
|
} |
69 |
|
push @s, $pos . $w if $w; |
70 |
|
warn "slogovi = ", dump( @s ), $/ if $debug; |
71 |
|
} |
72 |
|
return @s; |
73 |
|
} |
74 |
|
|
75 |
1; |
1; |