41 |
my $sql = qq{ |
my $sql = qq{ |
42 |
SELECT $field |
SELECT $field |
43 |
FROM archive_$field |
FROM archive_$field |
44 |
WHERE eprintid = $id |
WHERE eprintid = $id and lang = 'hr' |
45 |
}; |
}; |
46 |
warn "# sql: $sql\n" if $debug; |
warn "# sql: $sql\n" if $debug; |
47 |
my @results = map { _x( $_->{$field} ) } @{ $dbh->selectall_arrayref($sql, { Slice => {} }) }; |
my @results = map { _x( $_->{$field} ) } @{ $dbh->selectall_arrayref($sql, { Slice => {} }) }; |
60 |
|
|
61 |
sub slogovi { |
sub slogovi { |
62 |
my $text = shift; |
my $text = shift; |
63 |
my @s; |
|
64 |
|
my $count = 2; |
65 |
|
my $out = ''; |
66 |
|
|
67 |
foreach my $w ( split(/\W*\s+\W*/, $text ) ) { |
foreach my $w ( split(/\W*\s+\W*/, $text ) ) { |
68 |
my $pos = 0; |
warn "w: $w\n" if $debug; |
69 |
|
my @s; |
70 |
while ( $w =~ s/^([^aeiou]*[aeiou])//i ) { |
while ( $w =~ s/^([^aeiou]*[aeiou])//i ) { |
71 |
push @s, $pos++ . $1; |
push @s, $1; |
72 |
} |
} |
73 |
push @s, $pos . $w if $w; |
push @s, $w if $w; |
74 |
warn "slogovi = ", dump( @s ), $/ if $debug; |
warn "slogovi = ", dump( @s ), $/ if $debug; |
75 |
|
foreach my $p ( 0 .. ( $#s - $count + 1 ) ) { |
76 |
|
map { $out .= $s[ $p + $_ ] } 0 .. $count - 1; |
77 |
|
$out .= ' '; |
78 |
|
} |
79 |
} |
} |
80 |
return @s; |
warn "$out\n" if $debug; |
81 |
|
return $out; |
82 |
} |
} |
83 |
|
|
84 |
1; |
1; |